Nokia 3310 lcd - cannot clear screen

General discussion on mikroC PRO for PIC.
Post Reply
Author
Message
Cyberzim
Posts: 104
Joined: 12 Jun 2008 00:09
Location: Denmark

Nokia 3310 lcd - cannot clear screen

#1 Post by Cyberzim » 25 Apr 2010 01:05

Hello,
I have successfully initialized a nokia 3310 lcd.
But after the initialization, the display only shows a filled screen, and I cannot make it blank.
It is a newer lcd, just so you know.
Here is the code for the initialization:

Code: Select all


void set_xy_3310(unsigned short x, unsigned short y) { //Set cursor

send_3310(0x80 | (x&0x7F), 0);
send_3310(0x40 |((y+1)&0x7F), 0);

}

void clear_lcd_3310() { //Clear DDRAM

int i;
set_xy_3310(0,0);
for (i=0;i<504;i++)
send_3310(0x00, 1); //the first part is the data and the last part defines if it's data or command (1 = data, 0 = command)

}

void init_3310() {

CS = 1;
RES = 1;
delay_ms(200);
RES = 0;        //Reset lcd
delay_ms(200);
RES = 1;

send_3310(0x21, 0); //Extended intruction set
send_3310(0xE4, 0); //A large VOP for new display
send_3310(0x45, 0); //New LCD Correction (Y offset +5)
send_3310(0x06, 0); //Temp. coefficient
send_3310(0x13, 0); //Vbias
send_3310(0x20, 0); //Normal instruction set
send_3310(0x09, 0); //all on (display nlack)
clear_lcd_3310();   //Clear DDRAM
send_3310(0x08, 0); //Display blank
send_3310(0x0C, 0); //Normal mode
set_xy_3310(0,0);   //Set cursor to 0,0

}
Regards,

Simon H.A.
Name: Simon H.A.
Age: 17

Post Reply

Return to “mikroC PRO for PIC General”