Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

PIC18F4520 UNI DS-3 port b LED toggling issue

Status
Not open for further replies.

altipatlar006

Newbie level 5
Joined
Jan 24, 2008
Messages
8
Helped
6
Reputation
12
Reaction score
6
Trophy points
1,283
Activity points
1,320
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.

Where am I making a mistake?
Thank you very much
 

Where am I making a mistake?

you apparently didn't read the datasheet for the device you are trying to program.
 

Hi millwood;

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.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top