Setting up 16x2 LCD on Propeller Activity board
STiGMa
Posts: 7
I got an old basic 16x2 LCD I would like to use it with my Propeller Activity board. Unfortunately, I am pretty new into this and I do not know how and where I should connect its pins with the activity board. I spent a good number of hours searching the web, but I didn't manage to do it. I connected Pin#1 to the board's ground and Pin#2 to its 5V point; it seems that the LCD switches on. I do not know how to connect the other pins.
Could you please give me some advice/hints or references.
Thanks,STiGMa
Could you please give me some advice/hints or references.
Thanks,STiGMa
Comments
I've seen three basic types of 16x2 LCD (also known as Hitachi HD44780):
If it's I2C, I'm actually not sure of a driver. I'm sure there are ready-made drivers for LCDs over I2C, I just haven't looked for one.
Pin 4 RS or address select
Pin 5 R/W which can be tied low as it is only used to read the busy flag but this is redundant.
Pin 6 E which is taken high to select the display for data transfer
Pin 7..14 DB0..DB7 data lines.
Originally these displays were meant to be driven from a data bus of a microprocessor such as the old Z80s etc but many small micros these days do not have an external data bus and end up driving these from I/O pins to emulate the bus.
If you are short of I/O pins you can drive the LCD in 4-bit data mode using DB7..DB4 so you only need 2 other I/O for RS and E.
I would avoid using drivers that try to use the R/W to read back the redundant busy flag as that also means you now have to provide for reading 5V signals.
Anyway I always write my own drivers and they simply insert a short 2ms delay when using the clear display and return home commands.
All other commands have a maximum execution time of 37us so there is no need to read a busy flag because Spin and others will take longer than that bit banging the I/O etc.
Also I like to use an RC filter from one of the I/O so that software adjusts the contrast using the Prop's duty cycle mode rather than a potentiometer.
You haven't mentioned what language you are using but if you are working with Spin and want the easy way out then just grab the object of your choice and wire up the display accordingly.
Could you please give me some advice/hints or references.
Thanks,STiGMa
Do you have the part number for the display?
That would keep us from guessing if it is serial or parallel interface.
The LCD is like the one below.
I followed an instructable and mounted the lcd on a breadboard for better use.
I also pinned the +ve and the ground to the propeller and the lcd now switches on.
I am still missing how to send data to the LCD. Is there a minimal code, in C preferable, which I can use as a starting point?
http://obex.parallax.com/object/73
Have not tried it yet.
You may want to try some 4 Bit code:
http://forums.parallax.com/discussion/153326/4-bit-parallel-lcd-drive
Using the API is as easy as pasting the following code into your main source file and renaming the source file as whatever.cpp instead of whatever.c.
http://tymkrs.tumblr.com/post/87994050098/parallel-lcd-propeller-and-in-spin
It looks like it might be a parallel LCD. I found reading the object for it very helpful in terms of knowing where the pins go to. This isn't in C, but in spin as well. Hope it helps!