Prop to Parallax 27979 4x20 Serial LCD?
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):
CON _clkmode = xtal1 + pll16x '80MHz operating frequency. _xinfreq = 5_000_000 Hz = 100 OBJ LCD : "Debug_LCD" Pub Start LCD.init(0, 9600, 4) ' Initialize LCD - here the LCD is attached through a 1K resistor to pin 0. Change the "0" to the pin you're using. Pause(1500) ' Let the LCD settle in LCD.cls ' Clear the screen Splash ' Show startup screens LCD.cls Screenlabels ' Label the values Pub Splash ' Display startup screen LCD.home LCD.backlight(TRUE) LCD.gotoxy(0,0) LCD.str(@Splash1) LCD.gotoxy(0,1) LCD.str(@Splash2) LCD.gotoxy(0,2) LCD.str(@Splash3) LCD.gotoxy(0,3) LCD.str(@Splash4) Pause(1000) ' LCD.backlight(FALSE) ' Uncomment to turn off backlight after Splash Pause(3000) Pub Screenlabels LCD.gotoxy(0,0) LCD.str(String("Timer : ")) LCD.gotoxy(0,1) LCD.str(String("Temperature : ")) LCD.gotoxy(0,2) LCD.str(String("Humidity : ")) LCD.gotoxy(0,3) LCD.str(String("Pressure : ")) PUB Pause(mS) waitcnt(clkFreq/1000 * ms + cnt) DAT Splash1 byte "Environmental Sensor",0 Splash2 byte "Version 1.0 ",0 Splash3 byte "Paul C. Smith ",0 Splash4 byte "Feb 4, 2010 ",0You 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).
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
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