Running Nokia 5110 with 3 pins

attinylcd

I recently received a Nokia 5110 LCD screen and have hooked it up to my Uno and got it displaying stuff.

I'd like to try using it in a project with an ATtiny85 and found some resources to that effect, however, I'd like to be able to run it from fewer pins than the 5 I've started off with.

I found a few things online which suggested I can tie the RST to VCC and the CE pin to ground.

I connected RST to VCC and that seems to work ok.

Connecting CE to ground doesn't work properly – it either displays half inverted with a bit of garbage or more usually just displays nothing at all. From looking at the datasheet, CE needs to see a falling edge in order to enable.

I reconnected it to a pin and modified my code so that it simply writes it HIGH and then LOW in the setup() function and leaves it alone after that and the screen seems to work happily after that.

Feels like a waste of a pin though! Is there any way I can simulate the falling edge without it needing to be connected to a pin?

Best Answer

What you want to do (one falling edge on SCE, keep it low ever after) is allowed according to the PCF8544 datasheet, but it has a lurking problem: you no longer use the SCE edges to indicate the byte boundaries, so after one clock missed (for example due to noise), you will be forever out of sync with the LCD.

An IMO better approach would be to use a SPI extender (a simple HC595 will do) to supply all the signals in your system that need to change only rarely (for the LCD: res). This approach takes the same number of pins as driving all LCD pins directly, but gives you 7 'slow pins'.