varunme
Advanced Member level 3
my code
************************************************************************************
stepper.c
#include <htc.h>
__CONFIG( HS & UNPROTECT & BORDIS & PWRTDIS & WDTDIS );
// Main function
void main(void) {
TRISB=0;
PORTB=0;
/*
INTCON = 0x0; // Disable inerupt
CMCON = 0x07; // Comparators Off
ADCON1 = 0x06; // Port as Digital IO
CCP1CON = 0; // P1B, P1C, P1D assigned as port pins
TRISC=0;
PORTC=0;
*/
// loop forever - echo
while(1) {
PORTB=0b00000001;
_delay(250);
PORTB=0b00000010;
_delay(250);
PORTB=0b00000100;
_delay(250);
PORTB=0b00001000;
_delay(250);
}
}
**************************************************************
not working , what can be the reason ?
it works in proteus but in real world with LED itsn't working
************************************************************************************
stepper.c
#include <htc.h>
__CONFIG( HS & UNPROTECT & BORDIS & PWRTDIS & WDTDIS );
// Main function
void main(void) {
TRISB=0;
PORTB=0;
/*
INTCON = 0x0; // Disable inerupt
CMCON = 0x07; // Comparators Off
ADCON1 = 0x06; // Port as Digital IO
CCP1CON = 0; // P1B, P1C, P1D assigned as port pins
TRISC=0;
PORTC=0;
*/
// loop forever - echo
while(1) {
PORTB=0b00000001;
_delay(250);
PORTB=0b00000010;
_delay(250);
PORTB=0b00000100;
_delay(250);
PORTB=0b00001000;
_delay(250);
}
}
**************************************************************
not working , what can be the reason ?
it works in proteus but in real world with LED itsn't working