[FX2 EVM] Ez-USB CY7C68013 TFT LCD 테스트
[FX2 EVM] 보드는 M-Type의 핀맵으로 [EXP-LCD]보드에 연결하여 TFT-LCD 를 테스트 할 수 있다.
FX2 EVM 핀맵
EXP-LCD 핀맵
[FX2 EVM] TFT LCD 드라이버 코드
원래 8051의 페리 속도가 느리고, 특히나 PORTE는 비트제어 명령이 지원되지 않기 때문에 Address로 접근해야 해서 속도가 더 느려지는것 같다.
//-----------------------------------------------------------------------------
// TFT LCD Driver
#define TFT_DRV_HD66791 0
#define TFT_DRV_COM44 1
#define LCD_LAT_BIT BIT8
#define LCD_LAT_PORT
#define LCD_LAT_ON()
#define LCD_LAT_OFF()
#define LCD_DATA_LATCH() LCD_LAT_ON();LCD_LAT_OFF();
#define LCD_EN_BIT BIT5
#define LCD_EN_PORT
#define LCD_ENABLE() Cbi(IOE, LCD_EN_BIT)
#define LCD_DISABLE() Sbi(IOE, LCD_EN_BIT)
#define LCD_RST_BIT BIT2
#define LCD_RST_PORT
#define LCD_RST_ON() PE2 = 1
#define LCD_RST_OFF() PE2 = 0
#define LCD_RS_BIT BIT3
#define LCD_RS_PORT
#define LCD_RS_OFF() Cbi(IOE, LCD_RS_BIT)
#define LCD_RS_ON() Sbi(IOE, LCD_RS_BIT)
#define LCD_WR_BIT BIT5
#define LCD_WR_PORT
#define LCD_WR_OFF() PA5 = 0
#define LCD_WR_ON() PA5 = 1
#define LCD_RD_BIT BIT4
#define LCD_RD_PORT
#define LCD_RD_OFF() PA4 = 0
#define LCD_RD_ON() PA4 = 1
#define LCD_BL_BIT BIT4
#define LCD_BL_PORT
#define LCD_BL_OFF() Cbi(IOE, LCD_BL_BIT)
#define LCD_BL_ON() Sbi(IOE, LCD_BL_BIT)
#define _LCD_DAT_OUT(Data) IOB=Data&0xFF;IOD=(Data>>8);
#define TFTGpioInit() OEB=0xFF;OED=0xFF;\
PORTECFG = 0;OEE=0xFF;PORTACFG = 0;OEA=0xFF;
//-----------------------------------------------------------------------------
// TFT LCD Driver
#define TFT_DRV_HD66791 0
#define TFT_DRV_COM44 1
#define LCD_LAT_BIT BIT8
#define LCD_LAT_PORT
#define LCD_LAT_ON()
#define LCD_LAT_OFF()
#define LCD_DATA_LATCH() LCD_LAT_ON();LCD_LAT_OFF();
#define LCD_EN_BIT BIT5
#define LCD_EN_PORT
#define LCD_ENABLE() Cbi(IOE, LCD_EN_BIT)
#define LCD_DISABLE() Sbi(IOE, LCD_EN_BIT)
#define LCD_RST_BIT BIT2
#define LCD_RST_PORT
#define LCD_RST_ON() PE2 = 1
#define LCD_RST_OFF() PE2 = 0
#define LCD_RS_BIT BIT3
#define LCD_RS_PORT
#define LCD_RS_OFF() Cbi(IOE, LCD_RS_BIT)
#define LCD_RS_ON() Sbi(IOE, LCD_RS_BIT)
#define LCD_WR_BIT BIT5
#define LCD_WR_PORT
#define LCD_WR_OFF() PA5 = 0
#define LCD_WR_ON() PA5 = 1
#define LCD_RD_BIT BIT4
#define LCD_RD_PORT
#define LCD_RD_OFF() PA4 = 0
#define LCD_RD_ON() PA4 = 1
#define LCD_BL_BIT BIT4
#define LCD_BL_PORT
#define LCD_BL_OFF() Cbi(IOE, LCD_BL_BIT)
#define LCD_BL_ON() Sbi(IOE, LCD_BL_BIT)
#define _LCD_DAT_OUT(Data) IOB=Data&0xFF;IOD=(Data>>8);
#define TFTGpioInit() OEB=0xFF;OED=0xFF;\
PORTECFG = 0;OEE=0xFF;PORTACFG = 0;OEA=0xFF;
//-----------------------------------------------------------------------------
[FX2 EVM] TFT LCD테스트 동영상
한프레임 출력하는데 220ms정도 걸린다.. 너무 느리다. GPIF모드나 BUS모드로 테스트 해 봐야 할것 같다. FPGA를 이용해 FX2는 USB데이터를 받아서 버퍼에 저장하고 LCD제어는 다른 MCU에서 처리하도록 해야 할것 같다.
반응형