PCD8544 code & Sparkfun LCD


I’m trying to get the PCD8544 code
device pcd8544
agent pcd8544
to work work with the Sparkfun version of the Nokia 5110 display.

The display lights up and even flashes when it receives a message, but nothing is displayed.

I found this image on the electric imp blog. Is the resistor between GND and CLK the solution?



You actually need two resistors (which we’ll add to the code):

  1. A pulldown on the clock pin (100KΩ clock -> GND)
  2. A pullup on the reset pin (100KΩ reset -> Vcc)

Also, it might be config settings for Operating Voltage… take a look at line 161 (I think, github isn’t working for me right now, so that’s from my local file)

`// Configuration string: Extended instruction mode, Operating voltage (contrast),
// temperature coefficient, bias voltage, normal instruction mode, normal display mode

// Good values for op voltage (second byte) are around 0xB0. Go higher if the image is washed out, lower if too dark
static DEFAULT_CONFIG = “\x21\xB6\x04\x13\x20\x0C”;`

Try adding the pullup + pulldown resistor, and see if it fixes it. If it doesn’t, try increase the operating voltage (second byte of the DEFAULT_CONFIG blob).

Thanks. The resistors did the trick.

Which one is the clock pin? SPI?

Just found SClck of course, however, there are some naming differences between teh adafruit and sparkfun component. Do we have a wiring diagram anywhere? I have tried thsi from my side, included the pulldown up resistors, but i dont kno what the 257SPI should be wired to on the screen end. I have DN(MOSI) free and the clock only has the resistor on it, but is the 5 or 7 on the IMP going to the MOSI?

Here’s a pic of my wiring (used a sparkfun screen). Don’t have it at hand to check which pin is which.

I did a testrun and been testing the clk and mosi pin on the screen as 257 spi connection.
one setup makes teh screen flicker a bit the other truns it all black (i guesss thats the testing part) but none ever loads the BMP or rather displays it on screen.


Awesome I will check that.

I tried this and I think my wiring was ok. Issue is that it blackens everything. When I freshly plug in the power, the BMP shortly shows up then is ‘covered’ by an all black screen. So the image either arrives or comes from cache, but displays. It seems to be followed by an all black screen. If I can kill that step, I should be there.

Okay working now. I think it was a loose connection on one of the nokia pins, if I tilt and press it into the breadboard, it starts working. Bit weird so. Hope it will be perfect once its soldered up

Is there a particular way to store the images?

When I put the bmp on my server it says:

Getting image http://www.resonancedesign.co.uk/area51/imp84.bmp

2014-01-08 11:28:20 UTC+0: [Agent] the index ‘540’ does not exist

2014-01-08 11:28:20 UTC+0: [Agent] at getImage:70

2014-01-08 11:28:20 UTC+0: [Agent] from sendFrame:79

Could this be the case:

You don’t have permission to access /area51/imp84.bmp on this server.

Got one soldered up neatly, however the screen is very pale in terms of black pixels, anyone any idea why?

I don’t know how to do this with the imp, but with an Arduino, using the library Adafruit_PCD8544.h, you can set the contrast like this:


hope this helps a bit


to quote beardedinventor :

// Good values for op voltage (second byte) are around 0xB0. Go higher if the image is washed out, lower if too dark static DEFAULT_CONFIG = "\\x21\\xB6\\x04\\x13\\x20\\x0C";

File access error… fixed.

Screen displays fien at : xC6

Thank you guys.

Hello guys, have it all working now, I thought I finish this with a neat photo, including pin overview, etc.

I am also using the Sparkfun version of the Nokia 5110 display but I am having trouble getting text to display consistently on the display. Most times it displays the text correctly but other times it displays the text in the wrong place or the text is scrambled or the display is blank.

Is this a timing problem? Does anyone know how to correct this?

I suspect this is due to your wiring; possibly stray capacitance. What frequency do you have the SPI set to?

(if you’re using the original code, try reducing it from 4MHz, ie 4000 in the spi.configure line, to 1MHz, ie 1000)

Thanks Hugo, I will try different wiring and/or change info the SPI frequency.