LCD Display string problems

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 2 and 3.

Moderators: Benj, Mods

Post Reply
fifafrazer
Posts: 4
Joined: Thu Jan 18, 2007 7:43 pm

LCD Display string problems

Post 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?

User avatar
Steve
Matrix Staff
Posts: 3433
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times

Post 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.

fifafrazer
Posts: 4
Joined: Thu Jan 18, 2007 7:43 pm

Post 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"

User avatar
Steve
Matrix Staff
Posts: 3433
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times

Post 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!

fifafrazer
Posts: 4
Joined: Thu Jan 18, 2007 7:43 pm

Post by fifafrazer »

Thank you. It is working now. A 10 k resistor was too big... The 1 k resistor works. You saved our day!

Post Reply