Pages: [1]   Go Down
Author Topic: Help interfacing PCD8544 with Mega 256  (Read 1610 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 21
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi everyone,

I have just bought the LCD screen PCD8544 (http://www.sgbotic.com/index.php?dispatch=products.view&product_id=805) and I'm trying to make it working with an arduino mega 256. I'm a beginner in electronic and in the case of an arduino mega 256 I haven't found an example with the PCD8544.
I'm looking for some help in order to make the right connection for the PIN 3 SCE, 4 RST, 5 D/C, 6 DN (MOSI), 7 SCLK.
I took a look on the datasheet but it's not very clear at all for me yet. I'm here to learn so if someone wants to help me ... Thank you.


Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 39
Posts: 4394
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Did you follow the manufacturer's link to the 'Arduino Example'?  Be aware that you may have to change some pin numbers to use the example program with your Mega.

Don
Logged

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

I took a look on the arduino example, but it doesn't work on the fly, so i think i have to change the pin because if i'm not wrong, the lcd use SPI and SPI on mega is
50 : MISO
51 : MOSI
52 : SCLK
53 : SS

So I think in my case I should I have this :
LCD | Arduino
SCE ?
RST ?
D/C 53
DN (MOSI) 51
SCLK 52

But I dont really understand the meaning of SCE, is it corresponding to something in SPI, is it the MISO? And where should i link the RST ? Can you also confirm than SS and D/C are the same thing?
Thank for your help.
Logged

Germany
Online Online
Edison Member
*
Karma: 137
Posts: 1518
If you believe something is right, you won't see what's wrong (David Straker).
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi

RST: The reset pin. This must be hold low for some time during power up. This could be done by some external logic, but it could be controlled by the Arduino also.

D/C: This is the Data / Command selection line, also known as A0 address line. Please do not confuse this with the Slave Select signal

SCE: The enable line, which is the one which should be connected to the Slave Select pin.

I am currently working on a new graphics library, which also supports your display. You could download u8glib from here: http://code.google.com/p/u8glib/
Unzip the latest beta into the libraries folder and (re)start the Arduino IDE. You should be able to see the examples.

In the examples, uncomment the following line:

U8GLIB_PCD8544 u8g(13, 11, 10, 9, 8 );        // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9, Reset = 8

This constructor will setup software SPI, so you could connect your display to any available pins. Just provide your pin numbers to the constructor. The pin numbers need to be in the following order:
   U8GLIB_PCD8544(sclk, dn, sce, d_c , rst)
where sclk, dn, sce, d_c , rst must be replaced by the actual pin numbers.

Oliver


« Last Edit: February 03, 2012, 12:07:35 am by olikraus » Logged

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

Thank a lot for your explanation, I'll try this tonight and let you know.
Logged

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

Finally It works8)

This the pin I used :
SCK 52
MOSI 51
CS 53
AO 9
Reset 8

It worked well with your library but the Hello World is too big with your font to be displayed in my screen but anyway it works.
The example on the arduino webpage doesn't work I don't know why.
I also try this lib > http://code.google.com/p/pcd8544/ and it works.

Thanks again for your help.
Logged

Germany
Online Online
Edison Member
*
Karma: 137
Posts: 1518
If you believe something is right, you won't see what's wrong (David Straker).
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

U8glib has a huge number of fonts included. Just use a smaller font, e.g. u8g_font_6x10.
Or use another small one from here: http://code.google.com/p/u8glib/wiki/fontsize

Oliver
Logged

Pages: [1]   Go Up
Jump to: