bitbang Nokia 5110 LCD with 14M2


Senior Member
bitbang Nokia 5110 LCD with 14M2 and 20M2 20X2

I modified (simplified) matherp's code for controlling the Nokia 5110 LCD module with HSPI to make it work with bitbanging on the 14M2 (and removed all his cool text formatting and bar graphing code).

I realized that if I rearranged the pin definitions in the program, the 5110 would directly plug into an 14M2 single-inline-pin PCB I had made.

Here's the SIP board and module plugged in. The 14sip pcb is entirely concealed by the LCD.


The code is attached. Module sold here ($2.26US):

Matherp's post is here:

My Eagle 14sip board design is here:

I didn't connect the "backlight" leds (which aren't backlighting, and don't help much to my mind). Note that the contrast setting is critical, and depends on the particular module you use. I soldered a right-angle header on the underside of the board to give access to C.0-C.3, and another for power. B.0 is available for sertxd and any other use.

This effectively makes for an 08M2 with display module. The same pin types and number of pins are available--B.0 as output, C.3 as input, C.0, C.1, and C.2 as input/output. More I/Os would be available with a 20M2.


Last edited:


Senior Member
I never got back to that 20sip_LCD1.brd 22 months ago. When I did, I wanted a DS3231 module as well as the LCD, and that didn't work with the LCD on port B, so I switched it to port C.



The add-on modules stack nicely, with the DS3231 fitting above the 20M2, and the Nokia 5110 LCD fitting on top of that (I had female headers with long legs to elevate the LCD--normal female headers wouldn't work.

I modified the code so that by setting or commenting out the "#define M2" line either a 20M2 or a 20X2 would work. The 20X2 would of course be faster if you used HSPI, but the pins conflict with I2C. As before, the code follows matherp, hippy, and srnet.


Senior Member
As before, I used Oshpark to have the boards made--$7.40 for 3.



The LCD is available here for $2.28 U.S.:

The red version with two sets of identical connectors will work, but you have to make sure you plug it in the right way. The backlight only works with the jumper next to the header for the LCD. The 180R, if it is installed, must go on the bottom and must be soldered first before the 20-pin socket covers the through holes. Note that unless things have changed, the "3V-5V" on the blue board is untrue--use 3V only--5V fried it in my experience two years ago.

The DS3231 for $1.25 U.S.:
Last edited:


Senior Member
The basic file is too big for a post. Here it is zipped.

The current time from the RTC is updated every minute on the first line of the LCD. The time power was applied is shown on the third line.

I have used the program for timing how long a UPS lasts with various things attached, and how long a 12V battery lasts. If B.2 is high when the program starts, the program monitors that for going low, and if it does, the time that occured is shown on the 5th line. I tried to put the battery voltage on the 6th line, but something I did causes the LCD to shut off when I call that, so I omitted it--a problem for future attention.

The LCD and the RTC are both powered from PICAXE pins--C.0 for 0V and C.1 for 3V. Not setting those upon initialization will cause the RTC to not work. Control of the sequence for applying power to the LCD is required upon startup, so it can't just be connected to the board power.

Downward pointing header pins on the B port would allow B.0, B.1, B.3, B.4, and B.6 to be used. C.6 is not brought out.

The resistors, 10K, 22K, 4K7, and 4K7 are 1/6 watt, and the 4K7 ones are vertically mounted.


Last edited: