Hi, everybody. I have been reading this forum for a while and have gotten a lot of help from it, but this is my first time that I've not been able to come up with a solution after hours of searching and trying. I am attempting to use a parallel 16x2 lcd display I bought from allelectronics a long time ago. The lcd is driven with the ks0066 chip or an equivalent. I am using a 20m2 to try and control it. I have tried many different codes posted throughout the forum and many different methods for initialization, but none seems to work completely. I can successfully initialize the display in one line mode, and write text to it, but whenever i try to switch to two line mode, the display contrast turns unreadable. All of the text is still displayed on the screen, I just can't read it unless i'm one inch from it. All other functions work well. I can turn the cursor on, blink it, and write anything I want.
This picture is of my set up, with the display in one line mode working correctly. (sorry you probably can't check my wiring because it's a mess)
And here is the data sheet that i've found for this specific module.
View attachment AC-162E.pdf
My best guess is that it has to do with the contrast pin. I have the pin connected to the wiper of a 10k pot, with one side connected to 5v and the other to ground. The contrast is only really usable when the pin is grounded through the pot. I have read about some lcds needing a negative voltage for the contrast pin, and am thinking that this could be the solution, but this doesn't really address why the contrast is readable in one line mode, and not readable in two line mode. Does the contrast pins voltage requirements change when you switch between one and two line mode?
Here is the test code I have pieced together from nick12ab's tutorial, and some others.
Thanks for your time and any input.
This picture is of my set up, with the display in one line mode working correctly. (sorry you probably can't check my wiring because it's a mess)
And here is the data sheet that i've found for this specific module.
View attachment AC-162E.pdf
My best guess is that it has to do with the contrast pin. I have the pin connected to the wiper of a 10k pot, with one side connected to 5v and the other to ground. The contrast is only really usable when the pin is grounded through the pot. I have read about some lcds needing a negative voltage for the contrast pin, and am thinking that this could be the solution, but this doesn't really address why the contrast is readable in one line mode, and not readable in two line mode. Does the contrast pins voltage requirements change when you switch between one and two line mode?
Here is the test code I have pieced together from nick12ab's tutorial, and some others.
Code:
#picaxe 20m2
SETFREQ M8
SYMBOL E = C.5 `To enable pin 4 on lcd
SYMBOL RS = C.7 `To RS pin 6 on lcd
SYMBOL lcddata = pinsb `Port B to d0-d7
`Set pins as outputs
dirsB = %11111111
low RS
output E
pause 100
lcddata = %00110000 : pulsout E,20 `Function set: send 0x30 three times to start the module
pause 20
lcddata = %00110000 : pulsout E,20
pause 20
`lcddata = %00110000 : pulsout E,20
`pause 300
`lcddata = %00111000 : pulsout E,20 `Function set: 8 bit, 2 line , 5x8 font
`pause 200
lcddata = %00001111 : pulsout E,20 `Display on ,cursor on, blink on.
lcddata = %00000001 : pulsout E,20
'Clear display
lcddata = %00000110 : pulsout E,20
'Entry mode set: Increment, cursor shift
main:
low RS
lcddata = 128 : pulsout E,1
high RS
pause 100
lcddata = "H" : pulsout E,1
pause 100
lcddata = "E" : pulsout E,1
pause 100
lcddata = "L" : pulsout E,1
pause 100
lcddata = "L" : pulsout E,1
pause 100
lcddata = "O" : pulsout E,1
pause 1000
do : loop