Page 1 of 1

Arduino mega 2560 and GLCD ST7920

Posted: Tue Aug 24, 2021 6:07 pm
by AndreasR
i'm not sure if it is a bug or i'm not able to do my job :-(
for a project i try to use the arduino mega 2560, no not the 2560R3, and a GLCD 128x64 with the ST7920 controller.
The small project exists in arduino IDE and works fine.
In Arduino IDE i used the U8g2lib to speak to the GLCD via SPI (serial).
Now i will transform it to Flowcode 9.
In Flowcode 9 there is only a ST7920 GLCD 8 bit parallel.
I tried 4bit mode but it will not work.
Display does not react to my small test routine.

Has anybody a hint ?

If i compare the component macro GLCD 7920 from FC8 and FC9 there are differences in the connections description.
Very strange.
I'm totally confused :?:

Re: Arduino mega 2560 and GLCD ST7920

Posted: Wed Aug 25, 2021 4:18 pm
by BenR
Hello,

The parrallel component won't work with a serial type display. I'll see if we can create a specific SPI version of the component for you. Sometimes easier said then done on mono displays as it makes the job of controlling a single pixel a bit tricky.

Re: Arduino mega 2560 and GLCD ST7920

Posted: Wed Aug 25, 2021 4:49 pm
by AndreasR
Dear Ben,
you make me glad :-)
Here are some hints for your work.
The Dispaly is able to work in serial and paralle mode.
Here are the PIN Descriptions:
Display Pin 1 = Vss = GND = 0V
Display Pin 2 = Vdd = Plus = +5V (4mA)
Display Pin 3 = NC (not connencted)
Display Pin 4 = RS CS(SS) chip select SPI (RS in parallel Mode (RS=0: Instruktion, RS=1: Data)
Display Pin 5 = R/W = MOSI SPI = (R/W in parallel Mode (R/W=0: write, RS=1: read)
Display Pin 6 = E SCK = Clock SPI (E enable in parallel Mode)

Display Pin 7 = DB0 in parallel Mode
Display Pin 8 = DB1 in parallel Mode
Display Pin 9 = DB2 in parallel Mode
Display Pin 10 = DB3 in parallel Mode
Display Pin 11 = DB4 in parallel Mode
Display Pin 12 = DB5 in parallel Mode
Display Pin 13 = DB6 in parallel Mode
Display Pin 14 = DB7 in parallel Mode

Display Pin 15 = PSB - parallel serial Selector PSB=0: serial, PSB=1parallel

Display Pin 16 = NC (not connencted)
Display Pin 17 = Reset RST=0: Display off
Display Pin 18 = LCD contrast - Potentimeter on PCB
Display Pin 19 = Display LED + (5V = 33mA, 3,3V = 17mA)
Display Pin 20 = Display LED - = GND = 0V
Display Pin 1+15+20 can be connected to ground

Thx for your work,
Andreas

Re: Arduino mega 2560 and GLCD ST7920

Posted: Thu Aug 26, 2021 10:35 am
by BenR
Thanks Andreas,

Are you able to drive the display in parrallel mode or do you need it to be serial SPI mode?

Re: Arduino mega 2560 and GLCD ST7920

Posted: Thu Aug 26, 2021 4:36 pm
by AndreasR
Hi Ben,
the original project was written in Arduino IDE from me.
In there the display was connected via SPI and it works fine.
Next Step is to leave Arduino IDE and change the programming language to FC 9.
First idea was using exactly the hardware configuration from Arduino IDE.
But i only found the ST7920 parallel component.
I wrote a small testroutine ( you see it at the FC 9 Forum)
Here i tried the 4 Bit parallel mode but nothing happens.
Give me some time and i will test ist at 8 bit parallel mode.
Andreas

Re: Arduino mega 2560 and GLCD ST7920

Posted: Thu Aug 26, 2021 5:43 pm
by AndreasR
Here i'm back again,
The 8 bit mode does not work too.
I tested all the connections and the functionality of the diaplay and the Arduino Mega 2560 by programming the original Arduino Code to the testsystem and set PIN 15 from 5V to GND to change the display to SPI mode.
And voila the display schows the test messages.
So i think it's a problem in the Hardware macro of the ST7920 GLCD
Andreas

Re: Arduino mega 2560 and GLCD ST7920

Posted: Fri Apr 26, 2024 9:10 pm
by estevaon
Hi Ben,

I tried this combination (mega 2560 and ST 7920), and it doesn't works in parallel mode. Is possible create a SPI version of the ST 7920 component?