본문 바로가기

[MSP430]/MSP430_FRAM

MSP430FR5739 EVM - 1.5" I1511 TFT LCD 테스트

 MSP430FR5739 EVM - 1.5" I1511 TFT LCD 테스트

 

 

MSP430FR5739 를 이용하여 1.5" TFT LCD 테스트를 했다.

확장 테스트 보드는 XMega32 EVM 보드를 이용하였다.

 

 

 

 

 

 I1511 TFT LCD  제어 드라이버 코드

SD CARD의 BMP파읽을 읽어 TFT LCD에 출력하는 예제이다.

 

//-----------------------------------------------------------------------------
//TFT LCD
#define TFT_DRV_HD66791                 0
#define TFT_DRV_COM44                   0
#define TFT_DRV_ST7735                  1

#define LCD_LAT_BIT      BIT0
#define LCD_LAT_PORT     PORT1
#define LCD_LAT_ON()     Sbi(LCD_LAT_PORT, LCD_LAT_BIT)
#define LCD_LAT_OFF()     Cbi(LCD_LAT_PORT, LCD_LAT_BIT)
#define LCD_DATA_LATCH()    LCD_LAT_ON();LCD_LAT_OFF();

#define LCD_EN_BIT      BIT1
#define LCD_EN_PORT      PJOUT
#define LCD_ENABLE()     Cbi(LCD_EN_PORT, LCD_EN_BIT)
#define LCD_DISABLE()     Sbi(LCD_EN_PORT, LCD_EN_BIT)

#define LCD_RST_BIT      BIT2
#define LCD_RST_PORT     //PORT7
#define LCD_RST_ON()     //Sbi(LCD_RST_PORT, LCD_RST_BIT)
#define LCD_RST_OFF()     //Cbi(LCD_RST_PORT, LCD_RST_BIT)

#define LCD_RS_BIT      BIT2
#define LCD_RS_PORT      PJOUT
#define LCD_RS_OFF()     Cbi(LCD_RS_PORT, LCD_RS_BIT)
#define LCD_RS_ON()      Sbi(LCD_RS_PORT, LCD_RS_BIT)

#define LCD_WR_BIT      BIT3
#define LCD_WR_PORT      PJOUT
#define LCD_WR_OFF()     Cbi(LCD_WR_PORT, LCD_WR_BIT)
#define LCD_WR_ON()      Sbi(LCD_WR_PORT, LCD_WR_BIT)

#define LCD_RD_BIT      //BIT5
#define LCD_RD_PORT      //LATD
#define LCD_RD_OFF()     //Cbi(LCD_RD_PORT, LCD_RD_BIT)
#define LCD_RD_ON()      //Sbi(LCD_RD_PORT, LCD_RD_BIT)

#define LCD_BL_BIT      BIT0
#define LCD_BL_PORT      PJOUT
#define LCD_BL_OFF()     Cbi(LCD_BL_PORT, LCD_BL_BIT)
#define LCD_BL_ON()      Sbi(LCD_BL_PORT, LCD_BL_BIT)

 

#define _LCD_DAT_OUT(Data)    PORT1 = (Data>>8);\
                                     LCD_DATA_LATCH();\
                                     PORT1 = Data;

 

#define TFTGpioInit()     P1DIR=0xFF;\
                                        Sbi(P4DIR, BIT0|BIT1);\
                                        Sbi(PJDIR, BIT0|BIT1|BIT2|BIT3)   
//-----------------------------------------------------------------------------

반응형