Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 04:20 25 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Pico with ST7920 LCD in SPI mode

Author Message
58kk90
Regular Member

Joined: 14/06/2023
Location: United Kingdom
Posts: 49
Posted: 03:56am 13 Jul 2024
Copy link to clipboard 
Print this post

I've been trying to get one of the ST7920 Chinese Ebay 128 x 64 LCD's running with a Pico without any success.
I am running version 5.08.00 and have the display wired in SPI mode following the wiring in an earlier thread on here.

Like this

LCD Reset (pin 17) goes to GP3
LCD RS (pin 4) goes to GP5
LCD RW (data in pin 5) goes to GP7
LCD E (clk pin 6) goes to GP6

Then I have Gnd connected to pins 1,15 and 20 and VCC connected to pins 2 and 19.

First problem I have is when I do

OPTION LCDPANEL ST7920, LANDSCAPE,GP5,GP3

I get an error   'Error : duplicated pin'

I have checked and neither GP5 or GP3 are used for anything else, this happens from the get go after an 'option reset' and with no program uploaded to the pico.

Anyone else tried these type of display's and had them working at all?

Tony.
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6781
Posted: 07:03am 13 Jul 2024
Copy link to clipboard 
Print this post

I think you might need to set it up like this:
SETPIN GP5, DOUT 'the SETPIN commands may not be needed
SETPIN GP3, DOUT
OPTION SYSTEM SPI GP6, GP7, GP8 'this is the hardware SPI port
OPTION LCDPANEL ST7920, LANDSCAPE, GP5, GP3 'any pins can be used for these

You can't use that SPI bus for anything else as this display has a fixed CS that's always enabled. I must admit that I've not used one of these.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
58kk90
Regular Member

Joined: 14/06/2023
Location: United Kingdom
Posts: 49
Posted: 08:44am 13 Jul 2024
Copy link to clipboard 
Print this post

Hi Mixtel90
Thank you for the help, I have tried what you suggest,  following an 'option reset' I enter

SETPIN GP5, DOUT
SETPIN GP3, DOUT
OPTION SYSTEM SPI GP6, GP7, GP8


and after entering the last line above I get Error : not valid SPI pins

Tony
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9110
Posted: 11:05am 13 Jul 2024
Copy link to clipboard 
Print this post

I think there may be a bug in the firmware for the ST7920. I can't work on it until later this month. In the meantime I wouldn't waste too much time on it until I have a chance to test/fix
 
58kk90
Regular Member

Joined: 14/06/2023
Location: United Kingdom
Posts: 49
Posted: 12:01pm 13 Jul 2024
Copy link to clipboard 
Print this post

Thanks Peter, I had wondered if that was the case or if it was something I was doing.
I'll keep an eye on the forum until I see something from you that confirms it one way or another.

Tony
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9110
Posted: 11:45am 16 Jul 2024
Copy link to clipboard 
Print this post

Please try the version just posted on the release candidate thread. You should now be able to configure the display but I can't test any further than that as no access to a display until the end of the month
Edited 2024-07-16 21:46 by matherp
 
58kk90
Regular Member

Joined: 14/06/2023
Location: United Kingdom
Posts: 49
Posted: 12:35pm 16 Jul 2024
Copy link to clipboard 
Print this post

Thanks Peter, I tried the version which seems to be the latest from the release candidate thread 5.09.00RC5 and I appear to get the same as with 5.08

OPTION SYSTEM SPI GP6,GP7,GP4
OPTION LCDPANEL ST7920, LANDSCAPE,GP5,GP3

The last line gives
Error : duplicated pin

I'll have a search to see if I can find a later version in the thread, but scanning quickly on my phone, that was the only one I could see.

Tony
 
58kk90
Regular Member

Joined: 14/06/2023
Location: United Kingdom
Posts: 49
Posted: 12:37pm 16 Jul 2024
Copy link to clipboard 
Print this post

Cancel the last, I have found the one you meant when you said 'just posted'.
I'll give this version a try later this afternoon.

Tony.
 
58kk90
Regular Member

Joined: 14/06/2023
Location: United Kingdom
Posts: 49
Posted: 06:12pm 16 Jul 2024
Copy link to clipboard 
Print this post

Peter,
I tried the 2024-07-16_212924 version, I no longer get the Error : duplictaed pin message, but the display shows garbage unfortunately.

I can see the data, clock and RS pins toggling nicely on the scope though now which RS was not doing on the previous version.

Tony.
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9110
Posted: 01:47pm 25 Jul 2024
Copy link to clipboard 
Print this post

This version is tested and working. I think the garbage was because I was clocking the SPI bus too fast.


PicoMite.zip

Connections as tested
GND - 1,15,20
5V - 2,19
GP0 - 4 (RS)
GP1 - 17 (RST)
GP6 - 6 (E)
GP7 - 5 (R/W)





 
58kk90
Regular Member

Joined: 14/06/2023
Location: United Kingdom
Posts: 49
Posted: 06:17am 26 Jul 2024
Copy link to clipboard 
Print this post

Great thanks Peter, i'll try it this morning and report back ....

Tony.
 
58kk90
Regular Member

Joined: 14/06/2023
Location: United Kingdom
Posts: 49
Posted: 05:39am 27 Jul 2024
Copy link to clipboard 
Print this post

I can confirm that it works perfectly using the Chinese Ebay ST7920 LCD's

Tried both the white backlit version and the yellow backlit version, the yellow was the 3.3v version and the white was the 5v version, both work perfectly with the Pico.

Thanks Peter.

Tony
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024