Parallel Alphanumeric LCD (MOP-AL202C)
HackWar
Posts: 17
I am trying to get my Matrix Orbital LCD display to work with my Propeller. This display is HD44780 compliant and backlit. I found several spin objects which should make this whole process a walk in the park. Unfortunately, it's not that straightforward. The problem is that I cannot get the display to show anything at all. I've tried the "LCD Driver HD44780 16x2 4 bit 8 bit DEMO" object but no luck there. I switch on the power on the board and the display is activated (see photo). When I compile and upload the supplied demo program nothing really happens. I connected the pins as described in the comments. The datasheet of the display describe some kind of initialization steps which do not make any sense to me.
I have built several small projects with the BS2 BoE but the Propeller is something different. I'm really stuck here, I could really use some good advice
Hardware used:
MSR1 Robot control board
Matrix Orbital MOP-AL202C display (datasheet here)
I have built several small projects with the BS2 BoE but the Propeller is something different. I'm really stuck here, I could really use some good advice
Hardware used:
MSR1 Robot control board
Matrix Orbital MOP-AL202C display (datasheet here)
Comments
but once you get it up and running, it's a pretty neat display. (except for the buggy busy flag, but that's a gripe for another time)
Looking at the way the display is showing, it doesn't look like it has been successfully initialized, or it appears that the initialization data is incorrect.
Are you sure your wiring is correct? Are you sure your bus is connected in the correct direction? Are you sure your pins are correctly defined?
Are you actually calling the driver initialization routine at the start of your program? Can you see if your program is actually running by having it do something else (turn on an led or something).
There is also a contrast problem, have you simply tried adjusting the contrast or have a means of adjusting the contrast?
What I am saying is that if you tried to send it some text strings, some portion of it may be on the first line that is way too dark even if it was some bad initialization.
The display chip starts up in 1 line mode, and this looks like a 2 line display. contrast setting between one line and two line mode are different.
As for how to initialize it, it is simply a matter of just sending a certain bit pattern and then waiting for a certain amount of time, then sending another, waiting, sending another, etc.
In other words, it's not smart enough to power up and automatically start displaying on the LCD by itself, it must be told information about the actual LCD it is connected to.
I also tried some other LCD drivers and that's why I in the end wrote my own one. I remember one driver having initialization problems after a reset. So, the display only worked when doing a power on, but it failed to work after a reset. So far I had no problems with any of my displays and I only heard of one problem here in the forum which has been solved by increasing a value for the timing. (Have to search for the thread)
I'd simply give it a try, but be aware that this is definitely a 4 bit interface, no possibility to switch to 8 bit without changing the code:
http://obex.parallax.com/objects/576/
The interface to the PASM is a little bit low-level, but there is a SPIN wrapper somewhere in the forum which gives you the common functions.
8 bit interface in my eyes is simply a waste of precious propeller pins. You can still refresh the display faster than the liquid crystals can turn - not to speak about perception of the eyes.
It indeed seems an initialization issue. Tonight I will try the suggested driver and see if that will help me, actually it is the only object I did not try yet. Thanks for the support so far!
The attached object has been used commercially in a camera pan/tilt/trolley controller that a friend of mine makes. It handles the 4-bit LCD interface as well as six button inputs (four arrows which share LCD data buss, Enter, and Escape). You can ignore the button inputs if you choose (set the buttons mask to %000000). As I had not previously shared this I added comments that should help you get through it. Some of my timing values are fairly conservative; I tend to do this with commercial code -- better to be safe than have an issue when it's in the customer's hands.
EDIT:
I've made a simple test by just calling the 'start' function like this:
LCD.start(8, %000000)
The start pin on my board is 8 and it is connected to pin 14 of the display (number 9 is connected to 13 etc...) Unfortunately no luck yet, but I really feel that I'm doing something wrong here, I just don't know where to look (still bit of a newb). Are the initialization steps different for each LCD which is HD44780 compatible? I'm understading to think that they are, this is what the datasheet of the display says:
... Before beginning any application, it is recommended that all display settings be initialized. Below are
algorithms for initializing the display in both 8-bit and 4-bit communication modes.
Before the first wait condition, please allow Vcc to rise to 2.7V then wait 40ms. During the three
function set commands that follow, note that the busy flag cannot be checked; it becomes available in
the last block. The unit will always expect a total of 8 bits to be sent, so note the structure used in four
bit mode. The last initialization block will set the number of lines and character font as specified, turn
the display off, issue the display clear command, and finally set the entry mode as desired...
This appears to be different from all the init steps I've seen so far in all objects.
Some pointers anyone?
I am concerned that signals on certain pins are connected together and also grounded because the cable is treating these as grounds.
http://pinouts.ru/HD/AtaInternal_pinout.shtml
I'm not 100% sure how this works, but I think from this pinout diagram that the following pins are considered grounds and thus connected all together: 2, 19, 22, 24, 26, 30, and 40. Plus pin 20 is missing, and pin 34 is questionable depending on what kind of cable it is. Are you trying to use any of these pins to pass signals? Or are you already aware of the limitations of using this particular ribbon cable?
Some other things to check:
Are you powering the display module's pin #2 with 3.3V or with 5.0V?
what is the voltage level of the outputs you are using to send data and control signals to the display?
Probably...
Don't worry, we all go through this.
I feel pretty confident my code is well-vetted, so I would suggest you check your connections. Remember, you can use the .startx() method to define your pins; in this case the only requirement for contiguous pins are those on the LCD buss (and DB4 must be the LSB).
I agree with Whicker that you ribbon cable is the likely culprit. Whenever possible, simplify connections. I like to use these wires when experimenting:
-- http://www.pololu.com/catalog/category/67
I keep a stock of the M/M, M/F, and F/F in various colors -- makes chasing connections so much easier.
Also make sure your LCD contrast voltage on pin 3 is correct. Easiest way is to just ground this pin for testing as it will be good enough. I normally use an RC from the Prop and run a counter in DAC mode to vary the voltage in software.
Here's the proof (please ignore the typo):