Offline
Newbie
Karma: 0
Posts: 30
|
 |
« on: November 06, 2012, 06:52:50 am » |
Hi recently acquired a JN12864J lcd module from China how do i interface it with a atmega 328 also what libraries do i need ?
Thx
|
|
|
|
|
Logged
|
|
|
|
|
Norfolk UK
Offline
Edison Member
Karma: 23
Posts: 1317
|
 |
« Reply #1 on: November 06, 2012, 07:06:04 am » |
Hi flak88, To save people the hassle of hunting the web for details on the device a link to it would have been helpful. A quick google finds thousands of references but most useful looking are http://arduino.cc/forum/index.php/topic,91732.msg688825.html#msg688825
|
|
|
|
|
Logged
|
|
|
|
|
Germany
Offline
God Member
Karma: 69
Posts: 798
If you believe something is right, you won't see what's wrong (David Straker).
|
 |
« Reply #2 on: November 06, 2012, 03:30:51 pm » |
Good link. Crosscheck: If the display has a pin labeled with PSB, then it is a display with a st7920 controller. You could use u8glib ( http://code.google.com/p/u8glib/) with "U8GLIB_ST7920_128X64(...)" Set a0 to U8G_PIN_NONE. Oliver
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 30
|
 |
« Reply #3 on: November 07, 2012, 05:01:55 am » |
Sorry didnt post a direct link I bought the lcd from ebay it didn't have a datasheet in the description.
Had a look though the U8glib cant find the header that defines the pins to be used for this controller im using a atmega 328 btw.
Any ideas ?
|
|
|
|
|
Logged
|
|
|
|
|
Germany
Offline
God Member
Karma: 69
Posts: 798
If you believe something is right, you won't see what's wrong (David Straker).
|
 |
« Reply #4 on: November 07, 2012, 02:04:40 pm » |
Hi
Google for ST7920.pdf. It will give you all required information: Connect PSB to GND RS (chip select) to pin 2 of your Arduino RW (serial data) to pin 3 of your Arduino E (serial clock) to pin 4 of your Arduino
Then use: U8GLIB_ST7920_128X64 u8g(4, 3, 2, U8G_PIN_NONE )
Of course you could use any other Arduino pins also.
Oliver
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 30
|
 |
« Reply #5 on: December 07, 2012, 11:17:59 am » |
Hi sorry for the long reply been busy.
Im having some problems trying to find the pin out in the g8lib im using a atmega 328
So far i have it connected like this: PSB to GND RS (chip select) to pin 2(D2 i assume ? RW (serial data) to pin d3 E (serial clock) to pin d4
Where does the following go to on the atmega 328 ? db0-db7 NC RST VOUT
Im using the following as a constructor in the hello world example from u8glib_arduino_v1.08 btw. U8GLIB_ST7920_128X64 u8g(4, 3, 2, U8G_PIN_NONE )
Thanks
|
|
|
|
|
Logged
|
|
|
|
|
Germany
Offline
God Member
Karma: 69
Posts: 798
If you believe something is right, you won't see what's wrong (David Straker).
|
 |
« Reply #6 on: December 07, 2012, 02:39:20 pm » |
NC: I assume this means "not connected" RST: probably reset. U8glib can control this: If you connect RST to pin 5, then use this: U8GLIB_ST7920_128X64 u8g(4, 3, 2, U8G_PIN_NONE, 5 ) See the datasheet for details. dbX pins are only used for parallel mode VOUT is part of the external variable resistor. Recently there was a thread about this here in the forum
Oliver
|
|
|
|
|
Logged
|
|
|
|
|
Germany
Offline
God Member
Karma: 69
Posts: 798
If you believe something is right, you won't see what's wrong (David Straker).
|
 |
« Reply #7 on: December 07, 2012, 02:58:29 pm » |
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 30
|
 |
« Reply #8 on: December 07, 2012, 04:37:29 pm » |
It would seem the lcd module I have is slightly different to the example you posted.There is no V0 pin just VOUT.How do I wire up the contrast control pot with these pins ?
This is the current pinout of the lcd to atmega 328. gnd->0v vcc->+5v 0v->0v jp2->(haven't gotta clue so left unconnected) rs->pin 2 rw->pin3 e->pin4 db0-db7 (not connected) psb->ov nc->not connected rst->pin5 vout->where does this go ? a->470 ohm->+5v k->0v
thx again
|
|
|
|
|
Logged
|
|
|
|
|
Germany
Offline
God Member
Karma: 69
Posts: 798
If you believe something is right, you won't see what's wrong (David Straker).
|
 |
« Reply #9 on: December 07, 2012, 05:39:52 pm » |
There is no V0 pin just VOUT Well, you did not provide much of information, but what i see from http://wenku.baidu.com/view/ebf9d797daef5ef7ba0d3c0b.html, i would say that there IS a "V0". 0v->0v maybe this should be V0->var. pot  Oliver
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 30
|
 |
« Reply #10 on: December 08, 2012, 04:40:34 am » |
Ok
The problem is im not getting anything on the screen despite changing the contrast control.Im using the "hello world example" with the constructor you mentioned in your previous post.
gnd->0v vcc->+5v v0->wiper of pot jp2->(haven't gotta clue so left unconnected) rs->pin 2 rw->pin3 e->pin4 db0-db7 (not connected) psb->ov nc->not connected rst->pin5 vout->one end of pot a->470 ohm->+5v k->0v
I didn't have any 10k pots so used a 20k pot instead. contrast control pot is wired like the following: wiper to pin3 on the lcd(v0) one end of pot to gnd other end to VOUT of lcd
Any ideas ?
|
|
|
|
|
Logged
|
|
|
|
|
Germany
Offline
God Member
Karma: 69
Posts: 798
If you believe something is right, you won't see what's wrong (David Straker).
|
 |
« Reply #11 on: December 08, 2012, 05:14:00 am » |
Try to connect "rst" to +5V, will this work?
Maybe you can send a picture of your setup. Still, you have not posted a proper datasheet, but from the information I have, all looks fine.
Oliver
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 30
|
 |
« Reply #12 on: December 08, 2012, 06:19:11 am » |
It works now after connecting rst to +5v. Thanks very much.
|
|
|
|
|
Logged
|
|
|
|
|
|