Nokia 5110/3310 LCD...?

Bit of an update, tried again tonight just now and its come up with this:

'Adafruit_PCD8544' does not name a type

pcdtest:30: error: 'Adafruit_PCD8544' does not name a type
pcdtest.pde: In function 'void setup()':
pcdtest:62: error: 'display' was not declared in this scope
pcdtest:74: error: 'BLACK' was not declared in this scope
pcdtest:136: error: 'WHITE' was not declared in this scope
pcdtest.pde: In function 'void testdrawbitmap(const uint8_t*, uint8_t, uint8_t)':
pcdtest:171: error: 'display' was not declared in this scope
pcdtest:186: error: 'display' was not declared in this scope
pcdtest:186: error: 'BLACK' was not declared in this scope
pcdtest:188: error: 'display' was not declared in this scope
pcdtest:193: error: 'WHITE' was not declared in this scope
pcdtest.pde: In function 'void testdrawchar()':
pcdtest:208: error: 'display' was not declared in this scope
pcdtest:209: error: 'BLACK' was not declared in this scope
pcdtest.pde: In function 'void testdrawcircle()':
pcdtest:222: error: 'display' was not declared in this scope
pcdtest:223: error: 'BLACK' was not declared in this scope
pcdtest.pde: In function 'void testfillrect()':
pcdtest:230: error: 'display' was not declared in this scope
pcdtest.pde: In function 'void testdrawtriangle()':
pcdtest:239: error: 'display' was not declared in this scope
pcdtest:242: error: 'BLACK' was not declared in this scope
pcdtest.pde: In function 'void testfilltriangle()':
pcdtest:248: error: 'BLACK' was not declared in this scope
pcdtest:249: error: 'display' was not declared in this scope
pcdtest:253: error: 'WHITE' was not declared in this scope
pcdtest.pde: In function 'void testdrawroundrect()':
pcdtest:260: error: 'display' was not declared in this scope
pcdtest:261: error: 'BLACK' was not declared in this scope
pcdtest.pde: In function 'void testfillroundrect()':
pcdtest:267: error: 'BLACK' was not declared in this scope
pcdtest:268: error: 'display' was not declared in this scope
pcdtest:270: error: 'WHITE' was not declared in this scope
pcdtest.pde: In function 'void testdrawrect()':
pcdtest:277: error: 'display' was not declared in this scope
pcdtest:278: error: 'BLACK' was not declared in this scope
pcdtest.pde: In function 'void testdrawline()':
pcdtest:284: error: 'display' was not declared in this scope
pcdtest:285: error: 'BLACK' was not declared in this scope
pcdtest:288: error: 'display' was not declared in this scope
pcdtest:289: error: 'BLACK' was not declared in this scope
pcdtest:294: error: 'display' was not declared in this scope
pcdtest:296: error: 'BLACK' was not declared in this scope
pcdtest:300: error: 'BLACK' was not declared in this scope
pcdtest:307: error: 'BLACK' was not declared in this scope
pcdtest:311: error: 'BLACK' was not declared in this scope
pcdtest:318: error: 'BLACK' was not declared in this scope
pcdtest:322: error: 'BLACK' was not declared in this scope

Try out my library, read the post for connection details.
http://forum.arduino.cc/index.php?topic=176794.0

Also if you would like to try some 5110 code without any libraries this guy has a really good tutorial and a couple of interesting pieces of code. Nice guy too
Pedro XD

http://ianlangelectronic.webeden.co.uk/#/lcd-module-0/4569058582

Bugsy_malone_666:
Being a noob, I dont really know where to start with this one, whats the best way to test the display? what sort of issues could there be with uploading the code?

I suspect you got the display and library from different sources, and you have to be seriously lucky to get it right first time with the 5110 if you do that.

The fundamental problem is that, while all 5110s look more or less the same, they aren't. They use different pins. Even the wiring for the light can be different. The matter is only made worse by having the pin call in the library rather than in the Arduino sketch.

This is probably the time to get a breadboard to help sort things out and none of this is easy, particularly if you are a noob. But it's worth it.

I had a hard time but found the best start for this is

http://blog.stuartlewis.com/2011/02/12/scrolling-text-with-an-arduino-and-nokia-5110-screen/

It is a limited application but gives a result and no library is involved.

More information is here

http://ianlangelectronic.webeden.co.uk/#/lcd-module-0/4569058582

Ultimately, it makes more sense to use a library. Here is the standard one from Philips. It may be the same as the one you have.

http://code.google.com/p/pcd8544/

I had to edit it for my display. The 1-8 pin order on mine is

RST
CE
DC
DIN
CLK
VCC
LIGHT
GND

If yours is the same, I guess you can use my library and SPI pin arrangement on Arduino.

Nick_Pyner:

Bugsy_malone_666:
Being a noob, I dont really know where to start with this one, whats the best way to test the display? what sort of issues could there be with uploading the code?

I suspect you got the display and library from different sources, and you have to be seriously lucky to get it right first time with the 5110 if you do that.

The fundamental problem is that, while all 5110s look more or less the same, they aren't. They use different pins. Even the wiring for the light can be different. The matter is only made worse by having the pin call in the library rather than in the Arduino sketch.

This is probably the time to get a breadboard to help sort things out and none of this is easy, particularly if you are a noob. But it's worth it.

I had a hard time but found the best start for this is

http://blog.stuartlewis.com/2011/02/12/scrolling-text-with-an-arduino-and-nokia-5110-screen/

It is a limited application but gives a result and no library is involved.

More information is here

http://ianlangelectronic.webeden.co.uk/#/lcd-module-0/4569058582

Ultimately, it makes more sense to use a library. Here is the standard one from Philips. It may be the same as the one you have.

Google Code Archive - Long-term storage for Google Code Project Hosting.

I had to edit it for my display. The 1-8 pin order on mine is

RST
CE
DC
DIN
CLK
VCC
LIGHT
GND

If yours is the same, I guess you can use my library and SPI pin arrangement on Arduino.

True , I was using the Adafruit stuff but sourced my 5110 display from ebay.

I was thinking however, what impact would the pin numbers actually have if I wire it appropriately? I think if I remember my pinout is the same as what you list above, but I pinned from a 4050 level shifter so that the output of 'CS' for example went to CE (I think thats the same thing right?) and that Din went to Din, so even though the order may have been marginally different the end result should have it wired correctly?

Arduino.cc was down lastnight till I went to bed pretty much so havent had time to test it but maybe I can sort something tonight, ultimately my goal is to get the display to work then maybe code an OBDuino and also a small weather station project, but the first step is all about getting a component to actually work!

I sourced my display from ebay as well. But it shouldn't matter where it is from, the controller is the same on all of them.
All that may be different is the pin outs on the breakout board. If you take a look at my library, (and the explanation in the H file about pinouts) you'll see that it isn't very difficult.
Simply wire it up correctly and you're good to go.

Bugsy_malone_666:
True , I was using the Adafruit stuff but sourced my 5110 display from ebay.

I was thinking however, what impact would the pin numbers actually have if I wire it appropriately?

If you are aware of the differences, that's OK and all you need to do is know how to fix the problem which, in the case of the Philips PCD8544 library, means that is what you have to edit - the PCD8544 library. This means swallowing deeply and going into uncharted territory, but I guess it's not too bad once you've done it. Things could get messy if you want to change your mind later.

In my case the pin call in the library is:

class PCD8544: public Print {
public:
// All the pins can be changed from the default values...
PCD8544(unsigned char sclk = 13, /* clock (display pin 5) /
unsigned char sdin = 11, /
data-in (display pin 4) /
unsigned char dc = 5, /
data select (display pin 3) /
unsigned char reset = 6, /
reset (display pin 1) /
unsigned char sce = 7); /
enable (display pin 2) */

I think if I remember my pinout is the same as what you list above, but I pinned from a 4050 level shifter so that the output of 'CS' for example went to CE (I think thats the same thing right?) and that Din went to Din, so even though the order may have been marginally different the end result should have it wired correctly?

No comment, I don't use a level shifter. Power is from Arduino 3v3 pin, LED display pin 7 is to gnd via 330r and display pin 8 direct to gnd. One of my displays has a blue LED which I find utterly useless and is left disconnected.

Ok well really weird but i plugged it in today to try redoing things and it just started working and displaying the sample script!

Confused!

Unplugged it, plugged it back in, not working again, now I am really confused!

You can't randomly plug in/unplug the LCD power pin for example. This can damage the display.
I did that once with mine, and after resetting the Arduino (to reinitialize the display) it took it several hours to get back to normal.

Bugsy_malone_666:
it just started working and displaying the sample script!

OK. I guess that might end the discussion on pins and libraries....

Your display could be suss.

I understand these are manufacturer's surplus and not necessarily 100% kosher. All of mine are on a shield. One of them never fails to start, or reset, but might die after a few hours - or days. I have never been able to fix this and now I don't know if it's the display or the shield. There is only so much re-soldering one can do. The other 5110s are just fine.

The reply #10 above reads like nonsense but may not be, for the same reason.

Bugsy_malone_666:
Unplugged it, plugged it back in, not working again, now I am really confused!

You been watching The IT Crowd?

But seriously, why would the bold below be the case?

TheCoolest:
You can't randomly plug in/unplug the LCD power pin for example. This can damage the display.
I did that once with mine, and after resetting the Arduino (to reinitialize the display) it took it several hours to get back to normal.

I bought 2 of these LCDs, didn't get much chance to play before going out of town on business, but hope to get some time this weekend.

Ok well I decided to do my typical thing today and take the screen apart (I do this with many things!) I was surprised to find that once you take the metal retainer off the screen that the PCB underneath contains only the LEDs and a couple of resistors and everything that runs the screen is in the screen.

I decided that there wasnt much you can service, but I wiped the Silicone contact that goes between the board and the screen and hey presto, it now works every time! I have plugged and unplugged multiple times and it has booted and run consistently, so looks like it might have been just dirty contacts when it was made!

Very interesting. Maybe my troublesome one has a similar problem.

Thanks

Ok, I didn't go about this too scientifically, didn't record the combinations I tried, but I tried to get this damned thing going with 2 or 3 libraries, to no avail. Then I spotted this link to Stuart Lewis earlier in this thread and tried it. Still no luck. It's the one with no libraries: I thought I'd try that, reducing the number of places for errors.

So then I tried the sketch his code linked to and was based on, namely the Hello World sketch in the Playground and Voila! it worked.

I thought, ok, let's go back a step and try Stuart's again and trouble shoot a bit... no trouble to shoot, it worked all of a sudden.

So are these displays a bit temperamental? Did I have persistent loose breadboard pins which a bump set right? I have no idea... At least I know the display works.

But now I'm going to switch to a library-based method, since that's a better way innit? One thing I will do though, is use the breadboard / LCD setup that I currently have, not going to change the hardware at all, and just set the pins in the sketch. Try and disrupt things as little as possible.

Jings, this is frustrating, butSaturday arvie not totally wasted.....

I found the Stuart Lewis the best way to get things going but I'm sure it makes a lot more sense to use a library in the end. Although I didn't like digging into it to set the pins up, the standard Philips PCD8544 library is an obvious choice. I don't think I had to make any bias adjustments in order to get the text as clear as Stuart Lewis's.

The Philips library enables you to set the cursor by pixel. You can also use their on-line glyph editor. The two together enable you to tart-up the display and often get an extra character on a line.

But now I'm going to switch to a library-based method, since that's a better way innit?

Since then I tried Henning Karlesen's library, which I know I had tried unsuccessfully before, and it worked.

Then powered down, went out for an hour, powered up and zilch.

This is really weird..... that said, I'm putting 5v straight in everywhere except for 3.3v to the power pin, so I'm wondering if that has anything to do with it? A previous post spoke of the LCD taking an hour to recover. So tomorrow I'll cobble some voltage dividers together and see if that makes for reliability.

I run all mine off the 3v3 with no dividers or shifters. Only one gives trouble.

I think Buggsy's reply #13 is noteworthy. It implies a mechanical problem. It occurred to me that heat from the four LEDs may be getting into the act. I have already tested connections and ensure there is no shock while under test.

While I reckon this random shutdown stuff is arrant nonsense, recovering after an hour may also imply heat stress. That seems a hell of a long time but, when dealing with such low voltage and current in the norm, maybe that can happen..

At the risk of flogging a dead horse....

This morning I hooked the LCD up with series resistors as suggested in the second Fritzing here, and all is good. I can switch it off and straight back on or off and leave it, it comes on ok whatever.

Of course, in fitting the resistors I completely re-did the breadboard, so I'm not 100% convinced it wasn't a connection problem all along.....