Offline
Newbie
Karma: 0
Posts: 17
|
 |
« on: January 25, 2013, 05:54:16 pm » |
I would like to connect my 12864ZW display to Arduino. I believe it's ST7920 ( http://www.digole.com/images/file/Digole_12864_LCD.pdf). 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 ;-)
|
|
|
|
|
Logged
|
|
|
|
|
Germany
Offline
God Member
Karma: 69
Posts: 802
If you believe something is right, you won't see what's wrong (David Straker).
|
 |
« Reply #1 on: January 26, 2013, 12:01:17 am » |
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)
Oliver
|
|
|
|
|
Logged
|
|
|
|
|
Germany
Offline
God Member
Karma: 69
Posts: 802
If you believe something is right, you won't see what's wrong (David Straker).
|
 |
« Reply #2 on: January 26, 2013, 04:19:38 am » |
I forgot to mention, that there is a pending bug in u8glib where the reset pin is not handled correctly. http://code.google.com/p/u8glib/issues/detail?id=133You could: - use a RC network for reset - switch to SPI interface - wait for the next official u8glib release (not scheduled yet) - let me know if you need a prerelease Oliver
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 17
|
 |
« Reply #3 on: January 26, 2013, 03:00:05 pm » |
Thank you Olikraus for your time & help.
|
|
|
|
|
Logged
|
|
|
|
|
Germany
Offline
God Member
Karma: 69
Posts: 802
If you believe something is right, you won't see what's wrong (David Straker).
|
 |
« Reply #4 on: January 27, 2013, 06:11:23 am » |
I have added a bugfix release on the u8glib download page. http://code.google.com/p/u8glib/downloads/listOliver
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 1
|
 |
« Reply #5 on: February 03, 2013, 12:13:06 pm » |
This new version works perfect on QC12864B in parallel mode.
Olikraus thanks for this great job!
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 17
|
 |
« Reply #6 on: February 16, 2013, 07:11:42 pm » |
Thank you for the update. It works well on my LCD as well.
|
|
|
|
|
Logged
|
|
|
|
|
Germany
Offline
God Member
Karma: 69
Posts: 802
If you believe something is right, you won't see what's wrong (David Straker).
|
 |
« Reply #7 on: February 17, 2013, 11:15:18 am » |
Thanks for the feedback.
Oliver
|
|
|
|
|
Logged
|
|
|
|
|
|
|
Germany
Offline
God Member
Karma: 69
Posts: 802
If you believe something is right, you won't see what's wrong (David Straker).
|
 |
« Reply #9 on: May 20, 2013, 12:39:09 am » |
Hi You can use the serial interface (PSB = GND) with U8GLIB_ST7920_128X64_1X(E, R/W, RS , rst)
where the four arguments are the Arduino pin numbers, which are connected to the corresponding pin of your display. Oliver
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 21
|
 |
« Reply #10 on: May 20, 2013, 01:32:00 am » |
Thanks Oliver!
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 21
|
 |
« Reply #11 on: May 20, 2013, 04:03:52 am » |
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! 
|
|
|
|
|
Logged
|
|
|
|
|
Germany
Offline
God Member
Karma: 69
Posts: 802
If you believe something is right, you won't see what's wrong (David Straker).
|
 |
« Reply #12 on: May 20, 2013, 12:24:38 pm » |
My personal guess is, that the variable pot is not connected correctly. Instead of the 5V, connect the var pot to Vout.
Oliver
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 21
|
 |
« Reply #13 on: May 20, 2013, 12:43:41 pm » |
I'don't understand...The pot is the potentiometer??? if so, the potentiometer just needs to adjust the contrast. is that right??
|
|
|
|
|
Logged
|
|
|
|
|
Germany
Offline
God Member
Karma: 69
Posts: 802
If you believe something is right, you won't see what's wrong (David Straker).
|
 |
« Reply #14 on: May 20, 2013, 01:29:25 pm » |
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.
|
|
|
|
|
Logged
|
|
|
|
|
|