Jump to content

Recommended Posts

Hello. Sorry for my bad english...

 

Iam using MSP430 Launchpad with msp430g2553 chip. I want to connect lcd from Nokia 1100. But i don't initialization this display( I need help.

This is my code:

 

 

 

 

 

 

#define sclk   P2_1#define sda    P2_0#define cs     P1_5#define rst    P1_4#define CMD    0#define DATA   1// clear LCDvoid Lcd_Clear(void){unsigned int i;Lcd_Write(CMD,0x40); // Y = 0Lcd_Write(CMD,0xb0);Lcd_Write(CMD,0x10); // X = 0Lcd_Write(CMD,0x0);Lcd_Write(CMD,0xae); // disable display;for(i=0;i<255;i++)Lcd_Write(DATA,0x00);for(i=0;i<255;i++)Lcd_Write(DATA,0x00);for(i=0;i<255;i++)Lcd_Write(DATA,0x00);for(i=0;i<99;i++)Lcd_Write(DATA,0x00);Lcd_Write(CMD,0xaf); // enable display;}// Initialize the LCD.void Lcd_Init(){  digitalWrite(cs, LOW);  digitalWrite(rst, LOW);  delay(5);  digitalWrite(rst, HIGH);  Lcd_Write(CMD,0x20); // write VOP register  Lcd_Write(CMD,0x90);  Lcd_Write(CMD,0xA4); // all on/normal display  Lcd_Write(CMD,0x2F); // Power control set(charge pump on/off)  Lcd_Write(CMD,0x40); // set start row address = 0  Lcd_Write(CMD,0xb0); // set Y-address = 0  Lcd_Write(CMD,0x10); // set X-address, upper 3 bits  Lcd_Write(CMD,0x0);  // set X-address, lower 4 bits  Lcd_Write(CMD,0xC8); // mirror Y axis (about X axis)  Lcd_Write(CMD,0xa1); // Invert screen in horizontal axis  Lcd_Write(CMD,0xac); // set initial row (R0) of the display  Lcd_Write(CMD,0x07);  //Lcd_Write(CMD,0xF9); //  Lcd_Write(CMD,0xaf); // display ON/OFF  Lcd_Clear(); // clear LCD  Lcd_Write(CMD,0xa7); // invert display  delay(100);     Lcd_Write(CMD,0xa6); // normal display (non inverted)  delay(100);        }// Write a byte of data to lcd// Inputs:     c 

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.

Guest
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.


×
×
  • Create New...