Reply to topic  [ 6 posts ] 
Nokia 5110 Graphic LCD Module (HCMODU0037) 
Author Message
Site Admin

Joined: Sun Aug 05, 2012 4:02 pm
Posts: 633
Post Nokia 5110 Graphic LCD Module (HCMODU0037)
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:
/* 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

Attachment:
Nokia5110.pdf


You do not have the required permissions to view the files attached to this post.


Sat Sep 07, 2013 5:12 pm
Profile

Joined: Thu Nov 21, 2013 12:57 am
Posts: 3
Post Re: Nokia 5110 Graphic LCD Module (HCMODU0037)
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:
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:
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?


Sat Jan 18, 2014 3:38 am
Profile
Site Admin

Joined: Sun Aug 05, 2012 4:15 pm
Posts: 627
Post Re: Nokia 5110 Graphic LCD Module (HCMODU0037)
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.


Tue Jan 21, 2014 4:39 pm
Profile

Joined: Thu Nov 21, 2013 12:57 am
Posts: 3
Post Re: Nokia 5110 Graphic LCD Module (HCMODU0037)
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?


Tue Jan 21, 2014 9:07 pm
Profile
Site Admin

Joined: Sun Aug 05, 2012 4:15 pm
Posts: 627
Post Re: Nokia 5110 Graphic LCD Module (HCMODU0037)
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.


Wed Jan 22, 2014 11:47 am
Profile

Joined: Thu Nov 21, 2013 12:57 am
Posts: 3
Post Re: Nokia 5110 Graphic LCD Module (HCMODU0037)
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


Mon Jan 27, 2014 6:27 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 6 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Thank you to phpBB.com & phpBB.ro.
Design created by Florea Cosmin Ionut.
© 2011 All contents of this site are © Hobby Components LTD