Prop to Parallax 27979 4x20 Serial LCD?
Kevin Horton
Posts: 21
I'm a Prop newbie, trying to drive a Parallax 27979 4x20 Serial LCD with a Prop. The LCD works in test mode, but I haven't yet gotten it to display anything sent from the Prop. I'm wondering if maybe I've got an issue with the way I connected it to the Prop. I want to be sure I've got the hardware side correct so I don't start chasing my tail thinking it is a problem with the code.
I can't find any info on what the logic levels are on this display. Should I be able to directly connect a pin on the Prop to the RX pin on the LCD display? Or, is 3.3v from the Prop not enough to be sensed as a High on the display? If I need to correct the logic levels, can I do it with a pull up resistor, or do I need something like an SN7404N (I've got a few of these)?
Thanks,
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Kevin Horton
Ottawa, Canada
I can't find any info on what the logic levels are on this display. Should I be able to directly connect a pin on the Prop to the RX pin on the LCD display? Or, is 3.3v from the Prop not enough to be sensed as a High on the display? If I need to correct the logic levels, can I do it with a pull up resistor, or do I need something like an SN7404N (I've got a few of these)?
Thanks,
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Kevin Horton
Ottawa, Canada
Comments
I'm pretty sure you can drive the LCD direct from the Prop (Prop to LCD RX).
This posting may be of help:
·http://forums.parallax.com/showthread.php?p=869529
Jim
Try out Jon Williams code. He always writes good stuff: Link
I'm fairly certain that the serial RX pin can be driven by a prop pin.
Post Edited (AJM) : 2/5/2010 2:06:28 PM GMT
Make certain that you have a 5V power supply to the LCD. While the serial input may work at 3.3V, I don't think that you can power the LCD with just 3.3V.·(though I guess the test mode wouldn't work if your power supply·were inadequate, so you must be okay already on that front).
I'm using the Debug_LCD object, with code that looks like this (I just tested it: it works just fine in this form):
You can see in this code two different ways to send strings of text to the LCD, either by declaring them in the DAT section (with a terminating "0") and then passing a pointer (the "@" sign "points" to the data through its address) to LCD.str, or using the "String" function to convert quoted text to a zero-terminated string that LCD.str can work with.
One thing that has stymied me a few times working with a Prop and an LCD is how fast things happen. My text was appearing, but disappearing again before I saw it. Try putting a pause in after your attempt to display something.
Post Edited (sylvie369) : 2/5/2010 2:43:47 PM GMT
AJM - I was trying to use Jon's object, but unfortunately it does not include any example code, and I obviously made a few bad guesses, or perhaps stupid mistakes, because my code did nothing useful.
ARGGH - I just found the error in my original code. It was a stupid, stupid typo in a waitcnt statement after I initialized the LCD. Word to the wise - if you want to wait 5 ms, you want waitcnt(clkfreq / 200 + cnt), not waitcnt(clkfreq * 200 + cnt). My original code worked, but I never waited 200 seconds before deciding it was broke.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Kevin Horton
Ottawa, Canada
Post Edited (Kevin Horton) : 2/5/2010 11:59:47 PM GMT
It feels good to realize that you did know what you were doing after all, doesn't it?
I've made that kind of mistake quite a few times, usually with a wire plugged into the wrong hole on a protoboard (discovered after 2 hours of messing with code).
Post Edited (sylvie369) : 2/5/2010 11:25:34 PM GMT
Can anyone have a look at this LCD and tell me that it will work on the propeller? (full circuit diagram there also)
www.sure-electronics.net/download/DE-LD013_Ver1.0_EN.pdf
Thank you!
Post Edited (mugur) : 2/6/2010 12:08:23 PM GMT
Thanks,
Nick
You need to use a crystal because the timing on serial data is dependent on a fixed frequency. The internal clock is not exact and drifts over time.·Using the software you cited, set the switches to 9600 baud, (SW1-OFF, SW2-ON).
Jim
When you get a crystal (5Mhz) installed, run the code here:
http://obex.parallax.com/objects/40/
It is set up for 19,200 baud so you will need to set both switches to ON on the back of the LCD. I have it running now on my Propeller.
Jim
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Kevin Horton
Ottawa, Canada