Jump to content
Sign in to follow this  

Testing a Nokia pcd8544-based LCD

Recommended Posts

Hi, I've got an old Nokia phone that I don't need any more and I've salvaged its LCD. The problem is that I haven't been able to find any reasonable way to deal with the LCD's pins, so I've decided to take the original header off and use the metal parts of a female break-away header as connectors. The glass is as wide as a male connector, so they fit well, but I fear that some pins may not contact the lcd that well. I've checked the connections to the LCD and they are ok, but I don't know whether I can check if my home-made connector contacts the strips over the glass. The LCD itself was working connected to the phone.


For a while the LCD would flash its top half after reset, but now I've lost that too. My circuit uses 10uF capacitor on Vout.


Here's the code I'm using, it's been taken from another project posted here:



#define SEND_CMD                   0
#define SEND_CHR                   1

#define LCD_X_RES                  84
#define LCD_Y_RES                  48

#define COUNTDOWN				   1

#define DCPORT P1OUT

// 0
#define RES  BIT1

// 3
#define SCE  BIT2

// 4
#define DC   BIT3

// 5
#define SDIN BIT4

// 6
#define SCK  BIT5

short second, minute, hour, day, subsec = 0;

unsigned char displayString[14] = {

const unsigned char ofYouth[][41]={

const unsigned char nums[][2][10] ={
{// 0
{// 1
{// 2
{// 3
{// 4
{// 5
{// 6
{// 7
{// 8
{// 9

void updateTime( void)
second = (second -1);
if ( second == -1 ) { // new minute
	second = 59;
	minute = (minute - 1);
		if ( minute == -1) { // new hour
			minute = 59;
			hour = (hour -1);
			if ( hour == -1) { // new day
				hour = 23;
				day = (day -1);
				displayString[0] = day / 10;
				displayString[1] = day % 10;
			displayString[3] = hour   / 10;
			displayString[4] = hour   % 10;
	displayString[6] = minute / 10;
	displayString[7] = minute % 10; 
displayString[9] = second / 10;
displayString[10] = second % 10;

void LCDSend(unsigned char data, unsigned char cd) {

volatile unsigned char bits;
unsigned short cnt=8;
// assume clk is hi
// Enable display controller (active low).

// command or data
if(cd == SEND_CHR) {
	DCPORT |= DC;  //set to send data
else {  // reset to send command

///// SEND SPI /////
bits=0x80; // bits is mask to select bit to send. select bit msb first

//send data
while (0	{
	// put bit on line
	// cycle clock
	if ((data & bits)>0) {
	} else {

	// SHIFT BIT MASK 1 right
	bits >>= 1;

// Disable display controller.

void LCDClear(void) {
 int i,j;

 LCDSend(0x80, SEND_CMD );
 LCDSend(0x40, SEND_CMD );

 for (i=0;i<6;i++)  // number of rows
   for (j=0;j      LCDSend(0x00, SEND_CHR);

void LCDString(unsigned char *character, unsigned int start, unsigned int layer, unsigned int stop) {
int i;
for(i=start;i<(stop+1);i++) {
	int j;
	for (j = 0; j < 10; j++) {
		LCDSend(nums[character[i]][layer][j], SEND_CHR);

void LCDInit(void) { 
// assume ports set up and initialized to output

// Reset LCD
SCEPORT &= ~SCE;          // RESET SCE to enable 
// toggle RES
// 	RESPORT |= RES;           // Set RES
char l;
RESPORT &= ~RES;          // reset RES

for(l=0;l<100;l++) {
RESPORT |= RES;           // Set RES

// Cycle Clock

// Disable display controller.
SCEPORT |= SCE;           // bring high to disable 


// Send sequence of command
LCDSend( 0x21, SEND_CMD );  // LCD Extended Commands.
LCDSend( 0xBf, SEND_CMD );  // Set LCD Vop (Contrast).
LCDSend( 0x06, SEND_CMD );  // Set Temp coefficent to 2.
LCDSend( 0x13, SEND_CMD );  // LCD bias mode 1:100.
LCDSend( 0x20, SEND_CMD );  // LCD Standard Commands, Horizontal addressing mode.
LCDSend( 0x08, SEND_CMD );  // LCD blank
LCDSend( 0x0C, SEND_CMD );  // LCD in inverse mode.


int main(void) {
// Stop watchdog

P1DIR = 0xFF;

BCSCTL1 = CALBC1_1MHZ;                   // Set range
DCOCTL = CALDCO_1MHZ;                    // Set DCO step + modulation

BCSCTL2 = 0xF8;

second = 0x05;
minute = 0x00;
hour = 0x16;
day = 0x03;
TACCR0 = 0;
TACCR0 = 0x3FF;
TACTL = 0x0211;

P1OUT |= BIT0 + BIT6;

P1OUT ^= BIT0;
P1OUT ^= BIT6;

// Silly return to make gcc happy
return 0;

interrupt(TIMERA1_VECTOR) ta1_isr(void) {
subsec = (subsec + 1) % 32;
P1OUT ^= BIT0;
if (subsec == 0) { // New second


Can someone help me troubleshoot this, please?

Share this post

Link to post
Share on other sites

First, you should take some photos of that connection and post them up.


We have to make sure that isn't a problem.

Share this post

Link to post
Share on other sites


Are those fork connectors on your lcd glass contacts like those in the example site? I also have this same lcd out of a nokia 3310. The fork idea is interesting but I suspect that it will scratch the conductive material off the glass if the forks move around too much. The way I made this work was I kept the nokia pcb that I salvaged the lcd from. The pcb was attached to the lcd via a metal frame that snapped into groves cut into the pcb which sandwiched a conductive strip between the glass contacts and copper traces on the pcb. I soldered thin wires to the copper pads below the contact point of the conductive strip making sure that the wires did not interfere with the conductive strip and the metal frame. The pcb also contains a keypad (it was a phone after all) so if your project requires user input then this could kill two birds with one stone or if not then you could score the pcb with an utility knife or similar on top and bottom of the lcd's metal frame/pcb holder.


I will have to dig the lcd out of a box in the shop to take pics so you can get a visual of my jabbering above if you like but I think you get the general idea.

Share this post

Link to post
Share on other sites

The forks are the same.


Another interesting effect. If I unplug the lcd from the circuit, wait a second, plug it back and reset the launchpad, it flashes for a brief moment with a kind of a gradient (darkest on top). It does this every time.

Share this post

Link to post
Share on other sites

PCD8544 chip on glass could be dead. Have you tried a smaller test code or bit-banging the spi port with junk data? The one I have shows junk data at start up if I do not clear the registers at start up similar to how you described so I am unsure if it is dead.


Let me ask how you have the lcd connected to the msp430? Are you running at 3v6 ,3v3 or what? The lcd needs 3v3, over voltage may effect it or kill it. the msp430 can go up to 3.6 which may cause the chip on glass to not work (over volt protection mode?)

try adding a 10uF cap between vcc and ground on the pcd8544

I will find my 3310 and take pics for you and try to get my example code published also.

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Create New...