Newhaven Display Forum
Newhaven Products => TFTs => Topic started by: dfansler on October 16, 2015, 09:43:10 AM
-
I have the above system attached to an Atmel AT32UC processor. I can not get it to initialize or to display data. The software is based on the example given for the SSD1963 by New Haven Displays.
I used to use the same display with the SSD1963 built in and had it running before NHD came out with the controller separate.
I hope someone can tell me what I am doing wrong
David
Here is the code
void TFT_7_Write_Data (unsigned char data1) //no joy with delays
{
gpio_set_pin_high(LCD_RS);
AVR32_GPIO.port[3].ovr = data1; //send data to LCD
gpio_set_pin_low(LCD_WR);
gpio_set_pin_high(LCD_WR);
}
void TFT_7_Write_Command (unsigned char command)
{
int x;
AVR32_GPIO.port[3].ovr = command;
gpio_set_pin_low(LCD_RS);
gpio_set_pin_low(LCD_WR);
gpio_set_pin_high(LCD_WR);
delay_us(10); //was 1200
}
void TFT_7_Command_Write(unsigned char REG, unsigned char VALUE)
{
int temp_1;
AVR32_GPIO.port[3].ovr = REG; //send data to LCD
gpio_set_pin_low(LCD_RS);
gpio_set_pin_low(LCD_WR);
gpio_set_pin_high(LCD_WR);
gpio_set_pin_high(LCD_RS);
AVR32_GPIO.port[3].ovr = VALUE; //send data to LCD
return;
}
void TFT_7_Init(void)
{
//new setup as of 09-25-2015
gpio_set_pin_low(LCD0_CS); //enable both LCD Displays
gpio_set_pin_low(LCD1_CS);
gpio_set_pin_low(LCD_WR);
gpio_set_pin_low(LCD_RESET);
delay_ms(120);
gpio_set_pin_high(LCD_RESET);
delay_ms(120);
gpio_set_pin_high(LCD_BL);
TFT_7_Write_Command(0x01); //software reset
delay_ms(120);
TFT_7_Write_Command(0xe2); //set multiplier and divider for PLL
gpio_set_pin_high(LCD_RS); //raise RS
TFT_7_Write_Data(0x1d); //18bit,Disable FRC,TFT FRC Disable, TFT Mode
TFT_7_Write_Data(0x02); //18bit,Disable FRC,TFT FRC Disable, TFT Mode
TFT_7_Write_Data(0x04); //18bit,Disable FRC,TFT FRC Disable, TFT Mode
TFT_7_Command_Write(0xe0,0x01); //start pll
delay_ms(1);
TFT_7_Command_Write(0xe0,0x03); //lock pll
TFT_7_Write_Command(0x01); //software reset
delay_ms(120);
TFT_7_Write_Command(0xb0); //set lcd mode set tft 18 bits mode
gpio_set_pin_high(LCD_RS);
TFT_7_Write_Data(0x0c); //18bit,Disable FRC,TFT FRC Disable, TFT Mode
TFT_7_Write_Data(0x80); //was 80 now TFT Mode
TFT_7_Write_Data(0x03); //high byte of horz panel size
TFT_7_Write_Data(0x1f); //low byte of horz panal size
TFT_7_Write_Data(0x01); //high byte of vert panel size
TFT_7_Write_Data(0xdf); //low byte of vert panel size
TFT_7_Write_Data(0x00); //rgb sequence
TFT_7_Command_Write(0xf0,0x00); //set pixel data interface to 8 bit
TFT_7_Command_Write(0x36,0x09); //set address mode - top to bot from sp to ep was 09
TFT_7_Write_Command(0xe6); //set lshift freq
gpio_set_pin_high(LCD_RS); //raise RS
TFT_7_Write_Data(0x02);
TFT_7_Write_Data(0xff);
TFT_7_Write_Data(0xff);
TFT_7_Write_Command(0xb4); //set horiz period
gpio_set_pin_high(LCD_RS);
TFT_7_Write_Data(0x02);//?0x03
TFT_7_Write_Data(0xf8);//?0xef
TFT_7_Write_Data(0x00);//0x00
TFT_7_Write_Data(0x44);//0xa3
TFT_7_Write_Data(0x0f);//0x07
TFT_7_Write_Data(0x00);//0x00
TFT_7_Write_Data(0x00);//0x00
TFT_7_Write_Data(0x00);//0x00
TFT_7_Write_Command(0xb6); //set vert period
gpio_set_pin_high(LCD_RS);
TFT_7_Write_Data(0x01);//0x01
TFT_7_Write_Data(0xf8);//0xef
TFT_7_Write_Data(0x00);//0x00
TFT_7_Write_Data(0x13);//0x04
TFT_7_Write_Data(0x07);//0x01
TFT_7_Write_Data(0x00);//0x00
TFT_7_Write_Data(0x00);//0x00
TFT_7_Write_Command(0x13); //enter normal mode
TFT_7_Write_Command(0x38); //exit idle mode
TFT_7_Write_Command(0x29); //set display on
delay_ms(10);
}