Nokia 5110 Graphic LCD Module (HCMODU0037)

LCD, TFT, OLED, LED modules
Post Reply
admin
Site Admin
Posts: 866
Joined: Sun Aug 05, 2012 4:02 pm

Nokia 5110 Graphic LCD Module (HCMODU0037)

Post by admin » Sat Sep 07, 2013 5:12 pm

Image

Description:
The Nokia 5110 Graphic LCD module is a low cost LCD module based on the PCD8544 controller. It has a monochrome display resolution of 84x48 pixels with an integrated blue LED backlight. Interfacing to the display only requires 5 DIO lines which although the controller chip is not 5V tolerant, the display itself is. If you intend to use this module with an Arduino, we have an exclusive library available.


Specifications:

Controller: PCD8544
Supply: 2.7V to 3.3V
Interface levels: 2.7V to 5V
Backlight Colour: Blue
Backlight supply: 3.3V Max
Module size: W 43.6mm x H 43.1mm
Working current: < 200uA (Backlight off)


Example Arduino Sketch:

Code: Select all

/* FILE:    HC5110_Example
   DATE:    07/09/13
   VERSION: 0.1
   AUTHOR:  Andrew Davies

This is an example of how to use the functions within the HC5110 library written 
for the Nokia 5110 LCD module (HCMODU0037). This example will display example 
text, a graphic, and formatted decimal number.

You can specify which DIO pins on your Arduino connect to the module but if left
unchanged you will need to make the following connections:

MODULE   UNO
RST      D3
CE       D4
DC       D5
DIN      D6
CLK      D7
VCC      3.3V
BL       3.3V
GND      GND


WARNING: Do not power the module or its backlight via the Arduino's 5V pin. This
will distroy the module. Although the module is 3.3V only, the digital pins are 
5V tollarant, so it is safe to connect them directly to 5V DIO pins 


You may copy, alter and reuse this code in any way you like, but please leave
reference to HobbyComponents.com in your comments if you redistribute this code.
This software may not be used directly for the purpose of selling products that
directly compete with Hobby Components Ltd's own range of products.

THIS SOFTWARE IS PROVIDED "AS IS". HOBBY COMPONENTS MAKES NO WARRANTIES, WHETHER
EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ACCURACY OR LACK OF NEGLIGENCE.
HOBBY COMPONENTS SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR ANY DAMAGES,
INCLUDING, BUT NOT LIMITED TO, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY
REASON WHATSOEVER.
*/

/* Example bitmap */
const byte Tiny_Logo_Resistor [] = {
0x80, 0xC0, 0x60, 0x60, 0xE0, 0xC0, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00,
0x00, 0x00, 0x00, 0x00, 0xC0, 0x70, 0x1C, 0x0E, 0x3C, 0xF0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00,
0x80, 0xE0, 0x38, 0x0E, 0x1E, 0x78, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x78, 0x1E,
0x0E, 0x38, 0xE0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xF0, 0x3C, 0x0E, 0x1C, 0x70, 0xC0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xC0, 0xE0,
0x60, 0x60, 0xC0, 0x80, 0x01, 0x03, 0x06, 0x06, 0x07, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x07, 0x1E, 0x78, 0x70, 0x1C, 0x07, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x0F,
0x3C, 0x70, 0x38, 0x0E, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x07, 0x1C, 0x70, 0x70, 0x1C,
0x07, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x0E, 0x38, 0x70, 0x3C, 0x0F, 0x03, 0x00, 0x00,
0x00, 0x00, 0x00, 0x01, 0x07, 0x1C, 0x70, 0x78, 0x1E, 0x07, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x03, 0x07, 0x06, 0x06, 0x03, 0x01, 
};

/* Include the HC5110 library header */
#include <HC5110.h>

/* Create an instance of HC5110 library and define the DIO pins 
   used (RST,CD,DC,DIN,CLK) */
HC5110 HC5110(3,4,5,6,7);

/* Set the displays contrast. */
void setup() 
{
  HC5110.Contrast(0xB0);
}

/* Main program */
void loop() 
{
  /* Display some text */
  HC5110.Clear();
  HC5110.Home();
  HC5110.Cursor(20, 0);
  HC5110.Print("Hobby");
  HC5110.Cursor(0, 1);
  HC5110.Print("Components");
  
  /* Display a graphic */
  HC5110.Cursor(0, 3);
  HC5110.Bitmap(84, 2, Tiny_Logo_Resistor);  
  
  /* Wait a little then clear the screen */
  delay(2000);
  HC5110.Clear();
  
  /* Display some example numbers */
  HC5110.Print(12345678);
  HC5110.Cursor(0, 1); 
  HC5110.Print(-12345678);
  HC5110.Cursor(0, 2);
  HC5110.Print(12345678,2); 
  delay(2000);
}

Downloads:

The Arduino library can be found within the software section of this forum here
Nokia5110.pdf
You do not have the required permissions to view the files attached to this post.

pyrohaz
Posts: 3
Joined: Thu Nov 21, 2013 12:57 am

Re: Nokia 5110 Graphic LCD Module (HCMODU0037)

Post by pyrohaz » Sat Jan 18, 2014 3:38 am

Hi, I've purchased one of your LCD's from your eBay shop (eBay ID: pyrohaz) and I can't seem to get a "write pixel" function working correctly! I've written my own library and i'm using an STM32F0 Discovery board. The LCD is correctly initialised and displays data correctly. I currently have it in vertical writing mode as I'm hoping to use it for pixel based graphics instead of characters (I assume that the horizontal mode is easier for character writing...)

My code for writing a single pixel is:

Code: Select all

void WritePix(int16_t X, int16_t Y, uint8_t V){
	int32_t Index;
	uint8_t CPix;

	Index = X*(YPix>>3)+((Y)>>3);
	CPix = GBuf[Index];

	while(Y>7) Y-=8;

	if(V) CPix |= 1<<(Y);
	else CPix &= 1<<(Y);

	GBuf[Index] = CPix;
}
Where GBuf is a 504byte buffer to be written to the screen when a seperate function is called.

Using a simple for loop, YPix = 48:

Code: Select all

for(Cnt = 0; Cnt<YPix; Cnt++){
		SetPix(0, Cnt);
		SetPix(83, Cnt);
}
Then writing the data to the screen produces the output present in my image where you can see that the line on the right side should be straight but its jagged instead!

Image

Any help please?

andrew
Site Admin
Posts: 1374
Joined: Sun Aug 05, 2012 4:15 pm

Re: Nokia 5110 Graphic LCD Module (HCMODU0037)

Post by andrew » Tue Jan 21, 2014 4:39 pm

Is there any way you can output your buffer to a UART so that you can confirm the data is as expected before it is written to the module? This may help narrow down where the problem is.
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.

pyrohaz
Posts: 3
Joined: Thu Nov 21, 2013 12:57 am

Re: Nokia 5110 Graphic LCD Module (HCMODU0037)

Post by pyrohaz » Tue Jan 21, 2014 9:07 pm

Well i've got another two LCD modules from different suppliers and the same piece of code does seem to work! Could it be a faulty display?

andrew
Site Admin
Posts: 1374
Joined: Sun Aug 05, 2012 4:15 pm

Re: Nokia 5110 Graphic LCD Module (HCMODU0037)

Post by andrew » Wed Jan 22, 2014 11:47 am

If the module is faulty it would be a weird fault. It's almost as if there is some kind of clock skew or that the address counter isn't getting incremented for some reason, i.e missing a column somewhere between the first and last column on that last row. If we had the same development board we could have had a go at testing your code out but unfortunately as we don't it's difficult to quickly determine where the problem lies. Is it just that last column of 8 pixels or do any of the columns before it do this? Is it also easy in your code to directly address the last column and just write to this?

We have your details so if we can't get anywhere with it we can arrange for a return.
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.

pyrohaz
Posts: 3
Joined: Thu Nov 21, 2013 12:57 am

Re: Nokia 5110 Graphic LCD Module (HCMODU0037)

Post by pyrohaz » Mon Jan 27, 2014 6:27 pm

Its probably a fault of my own! I think I may have affected it with potential static discharge or such!

Thank you for the support

Post Reply

Return to “Display”