Page 1 of 1
LCD Display string problems
Posted: Tue May 01, 2007 8:49 am
by fifafrazer
In a school project with a PIC16F877 we have connected an LCD display, that is hd44780 compliant to port A. The display is almost working, but some of the strings are showing up wrong. The first character in some of the strings is wrong i.e. "5nter keycode:" instead of "enter keycode" and "enlocking door" instead of "unlocking door". We first thought that the problem occured because of electrical noise, but the error is exactly the same for a certain flowcode macro. Another group, which also use port A has the exactly same problem, while the group using port B has no problem at all. What could possibly be wrong?
Posted: Tue May 01, 2007 9:07 am
by Steve
On the 16F877, bit 4 of PortA has an "open collector" output and this will need an external pullup resistor to provide the power to drive the LCD display.
Because of this, it may be a better idea to have the LCD display on PortB for your projects.
Posted: Tue May 01, 2007 9:25 am
by fifafrazer
A pullup resistor on bit 4 doesnt solve the problem.
The weird thing is, that we have two blocks in flowcode, that both writes "enter keycode:" to the display. When the first block is executed it shows up as it is supposed to, but the second one shows up as "5nter keycode", and there are no typos in flowcode. Other examples are:
"enlocking door"
"toor unlocked"
"1ccess granted"
"1ccess denied"
Posted: Tue May 01, 2007 9:43 am
by Steve
Hello,
I have just tried this again with a 1k pullup resistor to 5V and it works fine. This is using our EB-006 multiprogrammer E-Block and our EB-005 LCD E-Block.
Without the resistor, our display displays 2onjour (and sometimes "onjour). With the resistor it correctly displays bonjour.
The problem is definitely a hardware issue due to the open-collector nature of pin A4. If you use the display on PortB, then you should not receive this problem.
I guess that the reason it works in your first block of code is either due to a previous instruction to the LCD, or due to residual voltage on the lines to the LCD display due to capacitive effects of the circuit. When I try, I can get the second "onjour every time by placing my finger on the A4 pin!
Posted: Tue May 01, 2007 9:58 am
by fifafrazer
Thank you. It is working now. A 10 k resistor was too big... The 1 k resistor works. You saved our day!