Display help needed 2X20 Optrex!!
grasshopper
Posts: 438
I am new to the forums as well as the propeller IC and I think both are great.
I am in disparate need of some help. I am trying to display some basic letters and numbers on a 2x20 Optrex PWB51505C-COB display. Can some one post code that will help me in my efforts? I believe it is a parallel display and fairly common.
Thanks
I am in disparate need of some help. I am trying to display some basic letters and numbers on a 2x20 Optrex PWB51505C-COB display. Can some one post code that will help me in my efforts? I believe it is a parallel display and fairly common.
Thanks
Comments
One important part of the effort is the proper initialization routine. Are you sure it is OK?
How about the 'contrast' setting? Maybe the pot is too far high or low. Do you see any dark 'character' boxes? If not re-adjust that pot. You should see at least one line of the 20 char positions dark; choose a mid-dark setting.
Usually once the 'init' is done right, it is smooth sailing. Do you have the data sheet on the module? That should help you figure out whether the init coding and delays are OK.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Harley Shanko
http://obex.parallax.com/objects/104/
It is also configured as a four line display, you have to change the address offset for a 2 line display.
It will all become clear when you read through the code!
The demo program is configured Hydra like (10 Mhz/ 8X), as I used it for a SpinStamp
When - and you most likely will - you run the display with 5V you should add 1k series resistors in the lines you readfrom. The demo program contains status read, but you can out-comment, when you do not need it, so saving the resistors. But I think it will do no harm with the generally low current from a typical display.
Post Edited (deSilva) : 10/10/2007 8:44:37 PM GMT
#1 the display can be used in 4 bit or 8 bit mode. Can someone explain the advantages / disadvantages of each mode? I am sur 8 bit mode hase more special features but i want some one to open my mind.
# 2 the code i used from deSilva works but the lettering is incorrect and all alien looking. If i tell it HELLO i get %$M@ or something like this. Can you help me more?
Thanks and please remember i am a student so my knowledge is growing
#1 4 bit mode just sends 8 bits in two packages of 4 bits. Some people have reported that there can be initialization problems in 4 bit mode, as the display can get out of sync.
These are the connections I used
These are the connections I used
PORTA
LCD
PIN 1 5Volts - Anode
PIN 2 Cathode through a 220Ohm Resistor to GND
PIN 3 Contrast - GND
PIN 4 5Volts
PIN 5 RD/!WR GNDPIN 4
PIN 6
Register Select
PIN 7 GND
PIN 5
PIN 8 Enable
PIN 09 D0 Not connected
PIN 10 D1 Not connected
PIN 11 D2 Not connected
PIN 12 D3 Not connected
PIN 3
PIN 13 D4
PIN 2
PIN 14 D5
PIN 1
PIN 15 D6
PIN 0
PIN 16 D7
Here is the data sheet www.floodhound.com/books/515.pdf
Some things i have tried so far: connecting the floating D0-D3 to ground but no luck, I also tried making the 4 a 2 in the in the CON section of the LCDDEMO lcdlines = 2.
Please help.
would work. You changed the setting in the CON section for E and RS I am sure?!
When you want to use Pin 0 to 3 you can set CSHL to 0.
The source code is very straight forward and easy to understand; one most likely can improve it at many places, be it just for an exercise!
PIN 3
PIN 13 D4
PIN 2
PIN 14 D5
PIN 1
PIN 15 D6
PIN 0
PIN 16 D7
has the msb to lsb of the nibble swapped. D7 is the msb of the LCD's byte or high nibble. Does your code swap the nibbles? That sure could give the display fits when sending commands and produce weird characters.
Possibly pin 3 should be connected to the tap of a potentiometer with ends at 5v and ground. Adjust pot (contrast) for some darkness on display. Fine tune once initialization is right.
Don't understand your pin5 note of 'GNDPIN4', which you show has 5v on it?
The LCDs I've used before mostly had the following pins assigned:
1. Gnd
2. 5v
3. Vee - the contrast pin
4. Register Select - one level used for commands on initialization, other level used for sending data to display
5. R/W - can be grounded if don't need to ever read the display registers
6. Enable - can be enabled all the time in some instances
7. DB0
...
14. DB7
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Harley Shanko
Yes i can see i made a mistake posting it should
PROP
LCD
PIN 1 5Volts - Anode
PIN 2 Cathode through a 220Ohm Resistor to GND
PIN 3 Contrast - GND
PIN 4 5Volts
PIN 5 RD/!WR GND
PIN 4
PIN 6 Register Select
PIN 7 GND
PIN 5
PIN 8 Enable
PIN 09 D0 Not connected
PIN 10 D1 Not connected
PIN 11 D2 Not connected
PIN 12 D3 Not connected
PIN 3
PIN 13 D4
PIN 2
PIN 14 D5
PIN 1
PIN 15 D6
PIN 0
PIN 16 D7
Harley I understand that i should use a potentiometer and i will during the finial design but for testing purposes it is working fine. I am not sure about the MSB. I will look into the D4-D7 pins to see if i have them correctly installed. I need a better data sheet as well unless you can see data regarding the MSB in the one i provided. I can see that my display has all of the requirements that you have listed except i am using a 16pin vs. 14 pin 2X20.
here is what i have
No.........Symbol..........Function
1...........LED (A)..........LED Anode Terminal
2...........LED (K)..........LED Cathode Terminal
3...........VSS...............Power Supply (0V, GND)
4...........VCC...............Power Supply for Logic
5...........VEE...............Power Supply for LCD Drive
6.......... RS.................Register Select Signal
7...........R/W...............Read/Write Select Signal H : Read L : Write
8...........E...................Enable Signal (No pull-up Resister)
9...........DB0...............Data Bus Line / Non-connection at 4-bit operation
10.........DB1...............Data Bus Line / Non-connection at 4-bit operation
11.........DB2...............Data Bus Line / Non-connection at 4-bit operation
12.........DB3...............Data Bus Line / Non-connection at 4-bit operation
13.........DB4...............Data Bus Line
14.........DB5...............Data Bus Line
15.........DB6...............Data Bus Line
16.........DB7...............Data Bus Line
[noparse]:)[/noparse]
All datashets contain equal information. The HD44780 (or compatibles) has not changed for 20 years now , neither has the pin-out...
And there is enough informtaion in the source code I think.
I have not made the changes yet but i am eager to do so now that i think i understand you. Before i make the change do i need to specify in the code that i am using a 2X20 because i think the code states it will run up to a 4X20.
I am excited now thanks deSilva for all your help.
4-bit : Pro's - Only four data lines needed, unused lines can be used for something else. Fewer lines to wire-up Con's - It takes two writes to the LCD display to send data bytes, slower than 8-bit mode.
8-bit : Pro's - Only a single write needed to send data bytes, quicker than 4-bit mode. Con's - Needs 8 lines available, all used for data transfer, more lines to wire-up.
Also note the fine LOOKUP statement. Somehow LOOKUP and LOOKDOWN are rarely used in code I have seen...
The configuration in Marcel's driver is
The images will explain the rest.
The nice application shows decoding pulse dialing from an surplus dial plate @ 90 cents. BTW: The internals of it are a masterpiece of mechanics...
Edit:
The pin-outs of all 44780 compatible displays are the same. In most cases there are pins 15 and 16, either - logically - following pin 14, but also can be allocated before pin 1! They are sometimes also marked A(node) and K(athode) for background lighting
Note that in low-cost displays (sub $5), there is no bg lighting installed, but there is space and pads to add it (for the same price again )
Post Edited (deSilva) : 10/14/2007 12:30:17 PM GMT
Propeller
Display
0.....................13
1.....................14
2.....................15
3.....................16
As a side note the Object shows a wiring diagram and it is backwards for my display. I dont know if this is for all 2X20's but it was for mine
But there can always be misunderstandings, so I undertook the major effort to shoot those photographs
BTW: It might be that those were the "counted" pins 13,14,15,16, but I am rather sure there are small numbers somewhere on the display PCB saying those are pins 11, 12, 13, and 14.
Post Edited (deSilva) : 10/15/2007 11:25:07 PM GMT
or what ever the degree symbol is in Hex $08 is not it.
Please fill me in.
The codes already available are generally printed in the data sheet. codes 128 to 255 generally consist of Kanji characters..
All right, all right.. here you are.
Post Edited (deSilva) : 10/16/2007 5:50:28 PM GMT