본문 바로가기

[DSP]/DSP280x-M

[TMS320F2808 EVM] TFT LCD Test - LCD-PLD-IF 보드 이용

[TMS320F2808 EVM] TFT LCD Test - LCD-PLD-IF 보드 이용



[TMS320F2808 EVM] 보드를 이용하여 TFT LCD테스트를 했다. PICCOLO 시리즈인 TMS320F28069 테스트때 SPI속도가 늦어 SD Card 읽어 오는 속도가 느렸는데 TMS320F2808이 조금 더 빠른것 같다.


TMS320F2808 TFT LCD테스트 동영상



TMS320F2808 TFT LCD 드라이버 코드
//-----------------------------------------------------------------------------
// TFT LCD Driver
#define TFT_DRV_HD66791     0
#define TFT_DRV_COM44     1

#define LCD_LAT_BIT      BIT2 //-> GPIO34
#define LCD_LAT_PORT     PORTB

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

#define LCD_EN_BIT      BIT20
#define LCD_EN_PORT      PORTA
#define LCD_ENABLE()     Cbi(LCD_EN_PORT, LCD_EN_BIT);NOP();
#define LCD_DISABLE()     Sbi(LCD_EN_PORT, LCD_EN_BIT);NOP();

#define LCD_RST_BIT      BIT6
#define LCD_RST_PORT     PORTA
#define LCD_RST_ON()     
#define LCD_RST_OFF()     

#define LCD_RS_BIT      BIT21
#define LCD_RS_PORT      PORTA
#define LCD_RS_OFF()     Cbi(LCD_RS_PORT, LCD_RS_BIT);NOP();
#define LCD_RS_ON()      Sbi(LCD_RS_PORT, LCD_RS_BIT);NOP();

#define LCD_WR_BIT      BIT23
#define LCD_WR_PORT      PORTA
#define LCD_WR_OFF()     Cbi(LCD_WR_PORT, LCD_WR_BIT);NOP();
#define LCD_WR_ON()      Sbi(LCD_WR_PORT, LCD_WR_BIT);NOP();

#define LCD_RD_BIT      //BIT7
#define LCD_RD_PORT      //
#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      BIT15
#define LCD_BL_PORT      PORTA
#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)    GpioDataRegs.GPADAT.all = (GpioDataRegs.GPADAT.all&(~0xFF)) | (Data>>8)&0xFF;NOP();\
          LCD_DATA_LATCH();\
          GpioDataRegs.GPADAT.all = (GpioDataRegs.GPADAT.all&(~0xFF)) | (Data&0xFF)&0xFF;NOP();
          

#define TFTGpioInit()     EALLOW;\
          Sbi(GpioCtrlRegs.GPADIR.all, 0xFF);\
          Cbi(GpioCtrlRegs.GPAMUX1.all, 0xFF);\
          GpioCtrlRegs.GPBMUX1.bit.GPIO34 = 0;\
          GpioCtrlRegs.GPBDIR.bit.GPIO34 = 1;\
          GpioCtrlRegs.GPAMUX2.bit.GPIO21 = 0;\
          GpioCtrlRegs.GPADIR.bit.GPIO21 = 1;\
          GpioCtrlRegs.GPAMUX2.bit.GPIO20 = 0;\
          GpioCtrlRegs.GPADIR.bit.GPIO20 = 1;\
          GpioCtrlRegs.GPAMUX2.bit.GPIO23 = 0;\
          GpioCtrlRegs.GPADIR.bit.GPIO23 = 1;\
          GpioCtrlRegs.GPAMUX1.bit.GPIO15 = 0;\
          GpioCtrlRegs.GPADIR.bit.GPIO15 = 1;\
          EDIS;
//-----------------------------------------------------------------------------
반응형