본문 바로가기

[MSP430]/MSP430_FRAM

MSP430FR5739 EVM - 2.8" TFT LCD 테스트

 MSP430FR5739 EVM - 2.8" TFT LCD 테스트

 

 

 

MSP430FR5739를 이용하여 좀더 큰 2.8" TFT LCD 제어를 테스트 해보았다.

SM-Type, M-Type에서 간단히 TFT LCD를 연결할 수 있는 [LCD_IF_P EVM] 을 이용하여 테스트 했다.

 

 

 

 

MSP430FR5739 TFT LCD제어 핀맵

 

 

 

 

 

MSP430FR5739 TFT LCD 제어 드라이버 코드

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

#define LCD_LAT_BIT      BIT2
#define LCD_LAT_PORT     PJOUT
#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      BIT0
#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      BIT1
#define LCD_RS_PORT      P4OUT
#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      BIT0
#define LCD_WR_PORT      P4OUT
#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      BIT1
#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&0xFF);

 

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

반응형