Arduino mega 2560 and GLCD ST7920

Use this section to discuss your embedded Flowcode projects.
Post Reply
AndreasR
Posts: 13
http://meble-kuchenne.info.pl
Joined: Tue Feb 09, 2021 5:16 pm
Been thanked: 2 times

Arduino mega 2560 and GLCD ST7920

Post 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 :?:
Attachments
Drehtisch-1.fcfx
(10.33 KiB) Downloaded 132 times

BenR
Matrix Staff
Posts: 1706
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 435 times
Been thanked: 598 times

Re: Arduino mega 2560 and GLCD ST7920

Post 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.

AndreasR
Posts: 13
Joined: Tue Feb 09, 2021 5:16 pm
Been thanked: 2 times

Re: Arduino mega 2560 and GLCD ST7920

Post 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

BenR
Matrix Staff
Posts: 1706
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 435 times
Been thanked: 598 times

Re: Arduino mega 2560 and GLCD ST7920

Post by BenR »

Thanks Andreas,

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

AndreasR
Posts: 13
Joined: Tue Feb 09, 2021 5:16 pm
Been thanked: 2 times

Re: Arduino mega 2560 and GLCD ST7920

Post 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

AndreasR
Posts: 13
Joined: Tue Feb 09, 2021 5:16 pm
Been thanked: 2 times

Re: Arduino mega 2560 and GLCD ST7920

Post 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
Attachments
Drehtisch-1.fcfx
(10.33 KiB) Downloaded 161 times

Post Reply