To initialize the library I have to remove comment from:
U8GLIB_ST7920_128X64 u8g(8, 9, 10, 11, 4, 5, 6, 7, 18, U8G_PIN_NONE, U8G_PIN_NONE, 17, 16); // 8Bit Com: D0..D7: 8,9,10,11,4,5,6,7 en=18, di=17,rw=16
The problem is I have no DI pin (the attached spec doesn't have it as well). I've already broken one display so I would like to be sure what I'm doing this time
The data/instruction pin (DI) might have a different name. In your case the corresponding pin is RS (register select).
Also remember to set PSB pin to "high" (connect to 5V)
Hi oliver,
I tried your solution, but the display does not work.
This is the datasheet: http://mikroshop.ch/pdf/QC12864B.pdf (There is an error, Pin 19 5v and Pin 20 0v).
There are my connection:
1 VSS 0V
2 VDD 5.0V
3 V0/NC — Contrast Adjust (into a central pin of the potentiometer, with 5v and GND)
4 RS(CS) analogpin 3
5 R/W(SID) analogpin 2
6 E(SCLK) analogpin 4
15 PSB GND
16 NC — No connection
19 LEDK 5V
20 LEDA 0V
There is the code of the example:
#include "U8glib.h"
U8GLIB_ST7920_128X64_1X u8g(18, 16, 17); // SPI Com: SCK = en = 18, MOSI = rw = 16, CS = di = 17
void draw(void) {
// graphic commands to redraw the complete screen should be placed here
u8g.setFont(u8g_font_unifont);
//u8g.setFont(u8g_font_osb21);
u8g.drawStr( 0, 22, "Hello World!");
}
void setup(void) {
// flip screen, if required
// u8g.setRot180();
// set SPI backup if required
//u8g.setHardwareBackup(u8g_backup_avr_spi);
// assign default color value
if ( u8g.getMode() == U8G_MODE_R3G3B2 )
u8g.setColorIndex(255); // white
else if ( u8g.getMode() == U8G_MODE_GRAY2BIT )
u8g.setColorIndex(3); // max intensity
else if ( u8g.getMode() == U8G_MODE_BW )
u8g.setColorIndex(1); // pixel on
}
void loop(void) {
// picture loop
u8g.firstPage();
do {
draw();
} while( u8g.nextPage() );
// rebuild the picture after some delay
delay(500);
}
If I dont connect to GND the PSB pin, the display lights, but doesn't print the instruction of the Helloword code.
Excuse me can you help me again?
p.s I'm sorry for the not perfect english, i'm italian!
Correct, one side to GND, other side to Vout and the middle pin (wiper) to V0. With the variable pot you should be able to turn all pixel on (contrast max) and off. Usually LCDs need a negative voltage for V0 which is provided by Vout.
Connecting pin 1 and 3 of the variable pot to 5V and GND will not work, because V0 needs negative voltage below GND.
Oliver
Edit: Not all GLCDs provide negative power at Vout. Best would be to measure the voltage of Vout vs. GND first.
Do the following: Apply
1 VSS 0V
2 VDD 5.0V
Then measure the voltage between VSS and PSB. What is the voltage?
Then measure the voltage between VSS and Vout. Waht is the voltage?
Then do the following:
Connect
1 VSS 0V
2 VDD 5.0V
Vout to the first pin of the variable potentiometer
V0 to the second pin of the var pot
VSS to the third pin of the var pot.
What do you see, when you turn the var pot from left to right?
Expected result: You should be able to turn on and off all the pixel. Is this possible?
i'v got the same problem here...can't get the qc12864b /st7920 to display anything in serial mode. As soon as I connect the PSB to ground, the backlight led goes of.
having the red probe on VSS, the black on PDB/Vout i get the following results:
VSS-PDB = -5.1v
VSS-Vout = -4.5v
Did i understand the instrucutions in the previous post correct, that i have to desolder the pot on the back of the display module and replace it with a new one connected to Vo/Vout/Vss ?
Edit2:
backlight doesn't goes off, if i pull the PSB Pin down with a 10k resistor (which i obvously didn't use before).....did i eventaly fryed my display ?