ST7920 wirh Arduino Mega doesn't work

Hello,

I’m trying to use my ST7920 screen with the u8g2 library, I’ve tried the old u8glib also. I’ve first tried to use it in 8-bit parallel mode, but since that didn’t work I thought it would be easier to figure out what the problem is with SPI (much less wires to care about). So I hooked up my Arduino Mega first (now I’m trying it with a Nano, thougt maybe my Mega has a problem) as follows:

ST7920 Arduino Nano

GND → GND
VCC → 5 V
RS → 10
R/W → 11
E → 13
PSB → GND (to select SPI)
RST → 8
BLK → GND

Here’s a photo of my setup:

.

The exact names of the pins can be seen here:

.

The exact LCD I ordered:

So the problem is I hook up everything, put any example sketch on the Arduino (have tried multiple), but nothing appears on the screen. As you can see on the pin image, there’s a built-in potmeter to set the contrast on the screen. When I use that potmeter, the background color of the screen changes, as you can see on the next two images, but nothing else happens.


(and no, it’s not because the ambient light is different or because I played with the screen protector).

I also tried to use an external potmeter etc., nothing seems to be working. Has anyone got any ideas I could try?

Go on. It is useful to show a photo of your wiring. But we need to see your constructor. e.g.

U8G2_ST7920_128X64_1_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* CS=*/ 10, /* reset=*/ 8);

David.

Thanks for the reply, David, I forgot to post that one.
I've tried a couple of ST7920 constructors for SPI, but currently I'm using the one you wrote in your reply except that my version has an 'F' where yours has a '1':

U8G2_ST7920_128X64_F_SW_SPI u8g2(U8G2_R0, /* clock=/ 13, / data=/ 11, / CS=/ 10, / reset=*/ 8);.

The U8g2 examples can use both full buffer F or small buffer 1, 2, ... constructors

I suggest that you test your jumper wires. (Mind you, your wires look better quality than the typical Chinese male-male jumpers)

Your header strip soldering could be "improved". But it does not look too bad.

Oops. You seem to have separate Nano USB and external power.
God gave you the Nano with a USB cable. It can provide 5V power to the LCD.

Only use the external power if you want to remove the USB cable. i.e. do not use both at once.
If the backlight is too bright, use a 22R, 47R series resistor in the backlight.

David.

Oh, I See.

I checked the wires yesterday already and indeed found a broken one.

Yeah, I know, I gave my best doing the soldering but that's the best I can do, unfortunately. Anyway, they should be fine, right?

Now the powering: as I mentioned above I began with a Mega and when I powered the screen from it the Power LED on my Mega almost turned off. I found that weird as I have powered servus, rf modules etc. from that Mega, but the easiest solution I could think of was the external supply. The Nano gets power conveniently over USB which I use anyway for programming. Could that be the problem? Or is a common GND maybe enough?

Oh yeah, I could solve a brightness issue, would be great If that was my only remaining problem :wink:

Thanks again for helping me out.

Some 16x2, some 20x4, some 128x64, some ... put a 0R series resistor on the pcb.

This means that a 2.5V backlight will draw a massive current from a 5V supply.

Since your display is specifically designed for 5V operation, I would expect a sensible series resistor would be mounted in the backlight circuit.
My ST7920 backlight takes about 60mA.

Incidentally, Green transreflective LCDs do not require any backlight at all. Or a dim backlight at night.
They also "look" nicer than the Blue transmissive LCDs.

David.

Okay, so I supplied 5 V to the display from the Nano now, which was connected via USB to my PC. Unfortunately, nothing changed. Could I try something else?

If you are worried about high backlight current, just add a series resistor e.g. 47R

Just double-check your wires. There are not many. Post a photo that shows each colour jumper wire with its associated Nano pin and breadboard row.

Another pair of eyes might spot something.

David.

The current seems okay with the Nano, nothing gets hot and the Power LED isn’t dim. So here’s my wiring:

BLA is not connected. You always need a backlight on a Blue/White display.

Otherwise your wiring appears to be ok.

David.

Oh, right, sorry. Now I see the backlight (photo). Should that line in the middle be there? I have been seeing that the whole day, just without backlight. Unfortunately, nothing else has changed, no text, no graphics.