Hi all;
I had a UNI ds-3 development kit with PIC18f4520 on it
I want to toggle some LEDs connected to PORT B of PIC18F4520.I wrote a simple c code,it is given below
void main() {
TRISB = 0;
LATB = 0b01010101;
while(1) {
LATB = ~ LATB;
delay_ms(1000) ;
}
}
There is no problem with toggling in portb but when toggling occurs, LEDs connected to RD5 and RD4 of PIC18f4520 are also toggling.
I was sure that I made the proper configuration setup following the datasheet.
Is there a clue on the datasheet to solve the problem?on which page?
Thanks
Dude i cant tell them why port D bits are also blinking. But one thing for sure is that u did not configure the port B bits properly.
They have Analog function as default so configure them to Digital I/O's pins by using the ANSELH register.