LCD and LEDs can't work at the same time !!

Status
Not open for further replies.

kareem3d

New Member
I have made an elevator project, i am using mikro C and PIC16F877A.
http://www.misr-news.com/test.txt
NB : up and down variables are for the motor to spin in both directions

The project works great on protues but when i wrote it on the PIC and tested on a test board, the LCD and the motor worked fine but the 4 LEDs (led_0,led_1,led_2,led_3) sometimes work, sometimes flashes and sometimes don't even illuminate light !

But when i removed all the LCD commands the LEDs worked great!!

So i only can make one of them work at a time !
 
ok i iwll make a completely wil guess. are you using interupts in your program? if so maybe the interupt is fireing before the program can get to the routine with the leds. proteus dosnt sim interupts well
 
ok my fault for being too lazy to look at the link! so your not using interupts in that case you will need to give a schematic otherwise its mainly guess work.
if it works with LCD removed then its a hardware problem i would have thought
 
Last edited:
Looking at the source code, it seems the LCD D4..D7 lines are connected to RC4..RC7 and the discrete LEDs are connected to RC0..RC3. Doesn't it seem more likely that the LCD driver is clobbering the RC0..RC3 outputs?

Is it possible to look at the LCD driver?
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…