Pages: [1]   Go Down
Author Topic: Newbie help ?  (Read 1900 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 34
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 Offline
Faraday Member
**
Karma: 69
Posts: 2557
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 Offline
Edison Member
*
Karma: 136
Posts: 1491
If you believe something is right, you won't see what's wrong (David Straker).
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 Offline
Newbie
*
Karma: 0
Posts: 34
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 Offline
Edison Member
*
Karma: 136
Posts: 1491
If you believe something is right, you won't see what's wrong (David Straker).
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 Offline
Newbie
*
Karma: 0
Posts: 34
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 Offline
Edison Member
*
Karma: 136
Posts: 1491
If you believe something is right, you won't see what's wrong (David Straker).
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 Offline
Edison Member
*
Karma: 136
Posts: 1491
If you believe something is right, you won't see what's wrong (David Straker).
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

about the variable resistor, see this thread: http://arduino.cc/forum/index.php/topic,133736.0.html
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 34
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 Offline
Edison Member
*
Karma: 136
Posts: 1491
If you believe something is right, you won't see what's wrong (David Straker).
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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".

Quote
0v->0v
maybe this should be
V0->var. pot  smiley-wink

Oliver
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 34
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 Offline
Edison Member
*
Karma: 136
Posts: 1491
If you believe something is right, you won't see what's wrong (David Straker).
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 Offline
Newbie
*
Karma: 0
Posts: 34
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It works now after connecting rst to +5v.
Thanks very much.
Logged

Pages: [1]   Go Up
Jump to: