I am doing LED Chaser using PIC16F877A.Here,there are 8 LEDs are running like a ring vounter, however,I met some troubles now.
I have try many time program is save in the editor. or go to the mp lab IDE project wizard and open the file and select the compiler or micro-controller enter
this file not running and i select the left click an doptation is Compile it then i do it and a message is compiling or outout is building sucessful
but after putting the mico inproject then led not blinking. pin vdd and vcc also check.
Why?
PIC16F877A-I/L Datasheet: http://www.kynix.com/uploadfiles/pdf8798/PIC16F877A-I2fL.pdf
Circuit Diagram
The code:
void main()
{
CMCON = 0x07; // To turn off comparators
ADCON1 = 0x06; // To turn off adc
TRISB = 0x00; // Sets all pins in PORTB as output
PORTB = 1; // Set RB0 to high 00000001
do // To set infinite loop
{
Delay_ms(300); // 300 mili seconds delay
PORTB = PORTB<<1; //Shifting right by one bit
if(PORTB >= 0b10000000) //To reset to 00000001
{ //when the count becomes 10000000
Delay_ms(350); // 350 mili seconds delay
PORTB = 1;
}
}while(1); // To set infinite loop
}
I’ll appreciate it if you could help me.