Pages: 1 ... 5 6 [7]   Go Down
Author Topic: A fast PCD8544 library (Nokia 5110)  (Read 13980 times)
0 Members and 1 Guest are viewing this topic.
Israel
Offline Offline
Sr. Member
****
Karma: 4
Posts: 278
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You don't have to remove it, SPI works with the LED onboard, and it blinks while transferring data. Since the data is transferred quite quickly, though, you usually won't really notice anything more than a little flash.
Logged


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

Pinout is ok...

I´ve tried:
Code:
lcd.begin(true, 0xB2, 0x04,0x12);
lcd.clear();
lcd.gotoXY(1,1);
lcd.print("TEST");
lcd.renderAll();
delay(3000);

I can see that the LCD is alive... When I use lcd.begin(false, 0xB2, 0x04,0x12);, it iverts the colors as it should do...
It flickers very fast and i can see the "shadow" of the "TEST" written... It seams that the LCD is reseting by itself. After the lcd.begin(false....) it doesn´t mantain the inverted state, just for a few mili-seconds and then came back clear.

Maybe my LCD was dead on arrival... Any clues? I´ve tried to change contrast and the other stuff as you mentioned on page 4...
Logged

Costa Rica
Offline Offline
Newbie
*
Karma: 0
Posts: 1
Mechatronics student
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks so much! This is just what I needed! Very nice and clean library...  smiley-cool
Logged

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

Is it possible to map CS, RST or CE pin to Arduino Uno 12?

If I change this:
Code:
#define PIN_DC 0x01 // D8
#define PIN_RESET 0x02 // D9
#define PIN_CE 0x04 // D10
To this:
Code:
#define PIN_DC 0x10 // D12
#define PIN_RESET 0x02 // D9
#define PIN_CE 0x04 // D10

Or did I misunderstood the hex pin mapping? Is not pin 12 = 0x10?

Thanks, seems very nice library though. Too bad that most other libraries didn't use the hardware SPI, so I'm having some problems with remapping my project with this library.
Logged

Israel
Offline Offline
Sr. Member
****
Karma: 4
Posts: 278
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

D12 is the MISO pin of the ATmega328's hardware SPI. I don't think it's a good idea to use it as a CS pin.
Although I have to say that I haven't really tested it in this configuration.
Logged


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

Isn't MISO unused for this PCD8544(for some reason)? If it isn't used as MISO, why shouldn't I map it to some other use? None of the pins seem to work in MISO pin anyway though.
Logged

Israel
Offline Offline
Sr. Member
****
Karma: 4
Posts: 278
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

As always, the answer can be found in the datasheet.

So it seems D12 cannot be used as an output when SPI is enabled as master.
Logged


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

good work!
works fine, but i would like to have function more to scroll the display content up an down or move a bitmap on the screen.
would that be possible in fb mode?
I wrote the function to invert the diplay. Is it possilbe not to invert the whole screen? i would like to have the possibility to toggle invert mode before i print on the screen, so that only the new written area is inverted.

has someone a recommendation of a menu library for this library?
Logged

Global Moderator
Netherlands
Online Online
Shannon Member
*****
Karma: 169
Posts: 12447
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

works fine, but i would like to have function more to scroll the display content up an down or move a bitmap on the screen.
would that be possible in fb mode?
Yes, possible. Question is detailed behaviour.
 What would you do if the bitmap crosses the end of the screen?
- wrap
- fall off the edge
- how about the "incoming pixels" if you move the whole screen? white/black?  replicate the pixels that where there?

Quote
I wrote the function to invert the diplay.
Please share!

[/quote]
 Is it possilbe not to invert the whole screen? i would like to have the possibility to toggle invert mode before i print on the screen, so that only the new written area is inverted.
[/quote]
Yes, especially in FB mode you could invert an area. (if I recall the code correctly smiley

Have no time to dive into the code for a definitive answer, but yes think so.
Drawback might be that code becomes complexer/slower.

Quote
has someone a recommendation of a menu library for this library?
no idea sorry.

Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Global Moderator
Netherlands
Online Online
Shannon Member
*****
Karma: 169
Posts: 12447
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@theCoolest
you might need to add a header in the cpp/h file

I use this template, helps users to track the version of the library.
Code:
//
//    FILE: .ino
//  AUTHOR: Rob Tillaart
// VERSION: 0.1.00
// PURPOSE:
//    DATE:
//     URL:
//
// Released to the public domain
//
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Israel
Offline Offline
Sr. Member
****
Karma: 4
Posts: 278
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Sadly I don't really have the time to play with this anymore, as I have some other ongoing projects right now.
Feel free to modify the library as you see fit.
Rob has already covered the scroll question, I'll try answering the inversion question.
Thee PCD8544 supports an invert command where you can invert the whole screen without changing anything in memory.
Although you could probably run a 'NOT' loop on the content of the memory section you want to invert.
The library doesn't support it, but it shouldn't be too difficult to implement.
Logged


Pages: 1 ... 5 6 [7]   Go Up
Jump to: