LCD 20x4 20pins driver 20X2 based for serial / i2c.

Haroen

Member
Hi,
I want a large 20x4 LCD display for projects where at a distance(1,2m) it should be readable.
This time I went for another(white 20pins) large 20x4 display then my previous(blue 16pins) medium 20x4 display mentioned in one of my threads.
I've been testing how to drive it also with @marks PICAXE 20X2 driver code without succes.
a) What am I doing wrong:
* I've connected pins1-6 to (Vss,Vdd,Vo,RS,RW,E), and pins11-16 to (DB4-7) of the 20X2 driver,
* Also (LED+ 5V)pin20 to LED_A of the 20X2 driver.
* This white display has 4 extra pins "active" Low:
* The Reset (pin 16) I tied to +5V to prevent reseting.
* Don't know what to do with the /CS1-3 (pins 15,17,19) for chip1-3 selections?
Tried them on all at+5V and all on Gnd without displaying text.

b) Could the Hint1+2 (B.0 and B.1) be switched in @marks his 20X2 LCD driver code with B.4 and B.6 for adding a RotaryEncoder function?
 
Last edited:

inglewoodpete

Senior Member
I'm not sure where you got your setup information from but the 20X2 does not have a reset pin. Pin ("leg") 16 is used as I/O, identified as pin B.2
 

Haroen

Member
In post #1, on the left I mentioned the LCD connections and on the right 20X2 driver.
Pin ("leg") 16 of the LCD display is "Active" Low for Reset.
Sorry, maybe a table would have been more clear.
20x4 LCD display
20X2 driver
pins1-6Vss,Vdd,Vo,RS,RW,E
pins11-16DB4-7
LED+LED_A
Reset (pin 16)+5V?
/CS1-3 (pins 15,17,19) chip1-3 selections+5V or Gnd?
 

Flenser

Senior Member
Haroen,

Your link to the "large 20x4 display" is for a 192X64 dot graphical LCD Module while your link to the medium 20x4 display is for a 20x4 text LCD module and that post has some links to code to drive 20x2 text LCD modules.

The code for the text LCD modules will not work for this 192x64 dot graphical LCD modules.

A search of this forum came up with just this one post from 2009 which refers to a different model LCD from your aliexpress link and does not have any code on how to drive it: Driving a S6B1713 graphical LCD

I've never used one of these 192X64 dot graphical LCD Modules.
 

Haroen

Member
Thanks,
a) So these kind of displays(GLCD) is not part driven as characters and other part driven as graphics?
b) Is there a interpreter chip available/possible to drive this/these display(s) by a picaxe?
c) Is the picaxe LED042 then the only GLCD picaxe supported display?
I have a LED042 but could never figure out the GLCD-cd software for it to work.
 

Flenser

Senior Member
Haroen,

I do not have a LED042 and I've never used one.

Looking at this page for the LED042 on the Picaxe web site LED042 - Serial Graphic LCD (GLCD) Module then you should not be connecting up 20 pins.

The product description on this page says the LED042 is a self assembly kit that is "A module that allows microcontrollers systems like the PICAXE to display messages and images on a 128x64 GLCD (white on blue GLCD included). Interface via one serial line."

The pdf datasheet for the LED042 kit describes a GLIC-K LCD interpreter chip. I don't have the LED042 but it looks to me like the GLIC-K included in this kit is the interpreter chip you ask about in your question 2.

This pdf datasheet shows that the 20 pins on the GLCD panel are connected to the GLIC-K interpreter chip and the picaxe chip connects to the GLIC-K interpreter chip using two pins, 0V and the pin for Serout from the PICAXE, which goes to the GLIC IC pin number 18 (PRX).

Starting at page 6 of this datasheet is the description of the command format for sending serial commands to the LED042 and there are SEROUT examples for using each command.
 

Haroen

Member
Aah, yes that makes sense.
I will retrieve the project and put it to the test.
a) "display messages and image " are indeed seperate commands sets.
b) Correct about the GLIC-K LCD interpreter chip.
But I also wanted to know if a slave interpreter chip was available/possible to drive this/these China GLCD's display(s) by a master picaxe?
c) I guess the picaxe LED042 is the only GLCD picaxe supported display.

I had another question in my post #1:
Could the Hint1+2 (B.0 and B.1) be switched in @marks his 20X2 LCD driver code with B.4 and B.6 for adding a RotaryEncoder function?
 

Flenser

Senior Member
Haroen,

When I was searcing for the LED042 doco I did see that Rev-Ed sell the GLIC-K LCD interpreter chip separately here Serial GLCD Firmware (GLIC-K1)

I found this page Graphical lcd (128×64) Pin out, working and interface that describes how these graphical LCDs work.
Each KS0108 chip controls one 64x64 block of pixels so the 128x64 GLCD has two of the KS0108 controllers that are selected using the signals CS1 and CS2.

The page for your aliexpress GLCD is 192x64 display and there is a circuit diagram that shows three S6B0101 controllers which are selected using the signals CS1-CS3. The title of the page says "build- in KS0108 Controller" so the S6B0101 is probably equivalent to the KS0108.

The doco for the GLIC-K (which you can download from the Rev-Ed page for the LED042 module) has a circuit diagram that shows the GLIC-K LCD interpreter chip has only the CS1 and CS2 signals. Based on this I don't see how the GLIC-K would be able to control a 192x64 display.
 

Flenser

Senior Member
Haroen,

The @marks link in your question about changing the 20X2 LCD drive code goes to the person.
The forum will probably need you to provide a link to the code you want to change before anyone can answer this question.
 

Haroen

Member
@Flenser,
I changed the link in my first post to @marks his 20X2 LCD driver code .

If I understand correctly I don't need an external interpreter for my display to work just for now with only characters the on-board interpreter chips should be activated by pulling them all three LOW.
In my post #3 I tried that but no characters where displayed?
 

Flenser

Senior Member
Haroen,

From my reading of this page Graphical lcd (128×64) Pin out, working and interface my understanding is that the on-board KS0108 Controller chips will not work with only characters and if you want to send characters to one of these GLCDs then you must have an external interpreter.

I don't now if this will help explain but the 20 character x 2 line text LCDs do not accept character commands either and Rev-Ed sell the AXE133 kit for a 16 x 2 LCD that includes an interpreter chip. You send character commands over a serial connection to the AXE133 interpreter chip and the interpreter chip translates that into the commands that the text LCD understands and sends them to the text LCD using the DB0-DB7 pins and the control pins.

The GLIC-K LCD interpreter chip does the equivalent thing for driving a 128 x 64 pixel GLCD. You send character commands over a serial connection to the GLIC-K chip and the GLIC-K chip translates these into the commands for writing blocks of pixels that the two KS0108 Controllers on a 128 x 64 pixel LCD understand and sends them to the GLCD using the data pins DB0-DB7 and the control signals.

Pulling all three CS1, 2 & 3 pins low will not do what you expect. As I understand from what I've read:
- You enable the first KS0108 Controller, disable the other two, and write the data for the first 64 x 64 block of pixels using the data pins DB0-DB7 and the control signals.
- Then you enable the second KS0108 Controller, disable the other two, and write the data for the second 64 x 64 block of pixels using the data pins DB0-DB7 and the control signals.
- Then you enable the third KS0108 Controller, disable the other two, and write the data for the second 64 x 64 block of pixels using the data pins DB0-DB7 and the control signals.
 

Haroen

Member
That makes sense!
Then these 3 questions in my post #7 are answered. These types of larger(not SSD1306) GLCD displays(except for the LED042) are not picaxe supported yet.
a) "display messages and image " are indeed seperate commands sets.
b) Correct about the GLIC-K LCD interpreter chip.
But I also wanted to know if a slave interpreter chip was available/possible to drive this/these China GLCD's display(s) by a master picaxe?
c) I guess the picaxe LED042 is the only GLCD picaxe supported display.
One question remains in my post #1 and #7...
Could the Hint1+2 (B.0 and B.1) be switched in @marks his 20X2 LCD driver code with B.4 and B.6 for adding a RotaryEncoder function?
Is it sufficient to change the code only dirsB?
dirsB = %00001111 to
dirsB = %01011100
How should I rewire the picaxe to the LCD?
Code:
'                   .-----_-----.
'                   | V+     0V |
'                -->| SI     SO |--> a.0 Control output
'       Rx N9600 -->| C.7   B.0 |--> Hint1
'  (10K pulldown)   | C.6   B.1 |--> Hint2
'                   | C.5   B.2 |--> LCD DB6
'                   | C.4   B.3 |--> LCD DB7
'         LCD E  <--| C.3   B.4 |--> LCD DB4
'         LCD RS <--| C.2   B.5 |
'                   | C.1   B.6 |--> LCD DB5
'                   | C.0   B.7 |
'                   '-----------'

'                   .-----_-----.
'                   | V+     0V |
'                -->| SI     SO |--> a.0 Control output
'       Rx N9600 -->| C.7   B.0 |--> Hint1
'  (10K pulldown)   | C.6   B.1 |--> Hint2
'                   | C.5   B.2 |--> LCD DB4
'                   | C.4   B.3 |--> LCD DB5
'         LCD E  <--| C.3   B.4 |--> LCD DB6
'         LCD RS <--| C.2   B.5 |
'                   | C.1   B.6 |--> LCD DB7
'                   | C.0   B.7 |
'                   '-----------'
 
Last edited:

Flenser

Senior Member
Haroun,

Yes, you can switch the B.0,B.1,B2 and B3 pins in @marks his 20X2 LCD driver code to another set of pins to leave Hint1+2 (B.0 and B.1) free for adding a RotaryEncoder function.

It is simple to switch the B.0,B.1,B2 and B3 pins in Marks code to use B.2,,B.3,B.4 and B5 or B.3,,B.4,B.5 and B6 or B.4,,B.5,B.6 and B.7.

I see that in this thread @marks PICAXE 20X2 driver code you were trying to get Marks code to work. Were you able to get Marks code working without any changes?
 

Haroen

Member
Code:
'                   .-----_-----.
'                   | V+     0V |
'                -->| SI     SO |--> a.0 Control output
'       Rx N9600 -->| C.7   B.0 |--> Hint1
'  (10K pulldown)   | C.6   B.1 |--> Hint2
'                   | C.5   B.2 |--> LCD DB4
'                   | C.4   B.3 |--> LCD DB5
'         LCD E  <--| C.3   B.4 |--> LCD DB6
'         LCD RS <--| C.2   B.5 |<-- SDA
'                   | C.1   B.6 |--> LCD DB7
'                   | C.0   B.7 |<-- SCL
'                   '-----------'
B.5(sda) and B.7(scl) are already occupied by I2C.
It is simple to switch the B.0,B.1,B2 and B3 pins in Marks code to use B.2,,B.3,B.4 and B5 or B.3,,B.4,B.5 and B6 or B.4,,B.5,B.6 and B.7.
Every port configuration you mention are side by side including B.5 that can not be used because of I2C.

If I change the code of dirsB = %00001111 to dirsB = %01011100?
Or should I also shift bit6 to bit5?
How to do that easily?

Marks code worked eventually, don't know anymore for certain if I changed the code.
Everything he sends worked great!
 
Last edited:
Top