[Microchip]/PIC322011. 9. 11. 11:58

[PIC32-SM EVM] TFT LCD [LCD-IF MODULE] 보드 테스트

[PIC32-SM EVM] TFT LCD  [LCD-IF MODULE] 보드 테스트



PIC32로  SM-Type 형태의 모듈에서  최소 핀으로 TFT LCD를 제어 할 수 있는 [LCD-IF MODULE] 보드를 테스트 했다.






PIC32-SM EVM TFT LCD  [LCD-IF MODULE] 드라이버 코드
//-----------------------------------------------------------------------------
//TFT LCD
#define TFT_DRV_HD66791                 0
#define TFT_DRV_COM44                   1

#define LCD_LAT_BIT      BIT5
#define LCD_LAT_PORT     LATF
#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      BIT5
#define LCD_EN_PORT      LATD
#define LCD_ENABLE()     Cbi(LCD_EN_PORT, LCD_EN_BIT)
#define LCD_DISABLE()     Sbi(LCD_EN_PORT, LCD_EN_BIT)

#define LCD_RST_BIT      //BIT8
#define LCD_RST_PORT     //PORTB
#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      BIT6
#define LCD_RS_PORT      LATD
#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      BIT7
#define LCD_WR_PORT      LATD
#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      BIT4
#define LCD_BL_PORT      LATD
#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)    LATE = (LATE&0xFF00) | (Data>>8);\
                                     LCD_DATA_LATCH();\
                                     LATE = (LATE&0xFF00) | (Data&0xFF);

#define TFTGpioInit()     TRISE=0;TRISD=0;TRISF=0;
//-----------------------------------------------------------------------------



Posted by nexp

댓글을 달아 주세요