NOKIA 3310 LCD (LPH7779):

Various routines.

Projects Home

 

 

The NOKIA LCD has 84x48 pixels. We devide this in 6 rows of 14 characters. Each character is 6 pixels wide and 8 pixels high.

1) Command routine, "bytefornokia" is sent as command byte.

2) Data routine, "bytefornokia" is sent as data byte.

3) Main routine to send data or commands (d or c) to the LCD.

4) Nokia LCD Position cursor.

Example: nokia_gotoxy(54,4);

 this moves the cursor to x (pixelcolumn) 54 and y (characterrow) 4.

5) Write message to LCD (C string type)

Example: nokia_printmessage("Seize the day");

this will print the text "Seize the day"

6) Write 1 character to LCD.

Example: nokia_printchar('@');

this will print the character "@"

 

 

Graphic LCD module type LPH7779 (NOKIA 3310 LCD)

Also see the PCD8544 datasheet.

 

 

 

 

  

Hi-Tech PICC:

1) void nokia_write_command(void)
{
nok_dc=0;                          // byte is a command it is read with the eight SCLK pulse
nok_cs=0;                          // chip enabled
nokia_write_dorc();
nok_cs=1;                          // chip disabled
}

2) void nokia_write_data(void)
{
nok_dc=1;
nok_cs=0;                          // chip enabled
nokia_write_dorc();
nok_cs=1;                          // chip disabled
}

3) void nokia_write_dorc(void)        // serial write data or command subroutine
{
for (c=8;c>0;c--) {
nok_sclk=0;
if ((bytefornokia&0x80)==0){
nok_sda=0;
}
else {
nok_sda=1;
}
nok_sclk=1;
bytefornokia=bytefornokia<<1;
}
}

4) void nokia_gotoxy (byte xnokia, byte ynokia)          // Nokia LCD Position cursor
{
bytefornokia=(0x40|(ynokia&0x07));                           // Y axe initialisation: 0100 0yyy
nokia_write_command();

bytefornokia=(0x80|(xnokia&0x7f));                            // X axe initialisation: 1xxx xxxx
nokia_write_command();
}

5) void nokia_printmessage(const char* message)     // Write message to LCD (C string type)
{
while (*message)                                                           // Look for end of string
nokia_printchar(*message++);
}

6) void nokia_printchar(byte c)                                       // Write 1 character to LCD
{
charsel=c;
ext_eeprom_to_nokialcd();
}