TM4C123 EVM - TFT-LCD 테스트
TM4C123 보드를 이용하여 TFT-LCD를 적은 핀수로 테스트 할 수 있는 [LCD-CONV] 보드의 TFT-LCD 테스트를 진행 했다. TFT-LCD출력 속도는 18ms로 빠른데 SD Card 읽어들이는 속도가 상대적으로 느려 고속출력은 무리가 있어 보인다.
TI 제공 ROM 함수 사용시
320x240 한프레임 출력 시간이 100ms 정도 출력된다.
상당히 느리다..
#define _LCD_DAT_OUT(Data) ROM_GPIOPinWrite(GPIO_PORTC_BASE, 0xFF, Data>>8);\
LCD_DATA_LATCH();\
ROM_GPIOPinWrite(GPIO_PORTC_BASE, 0xFF, Data&0xFF)
레지스터 직접 제어시
18ms 로 상당히 빨라졌다.
#define _LCD_DAT_OUT(Data) PORTC = (Data>>8);\
LCD_DATA_LATCH();\
PORTC = Data
TM4C123 TFT-LCD 테스트 동영상
TM4C123 TFT-LCD 드라이버 코드
//-----------------------------------------------------------------------------
// TFT LCD Driver
#define TFT_DRV_HD66791 0
#define TFT_DRV_COM44 1
#define LCD_LAT_BIT BIT6
#define LCD_LAT_PORT GPIO2
#define LCD_LAT_ON() PD6 = BIT6;
#define LCD_LAT_OFF() PD6 = 0;
#define LCD_DATA_LATCH() LCD_LAT_ON();LCD_LAT_OFF();
#define LCD_RST_BIT BIT6
#define LCD_RST_PORT GPIOA
#define LCD_RST_ON()
#define LCD_RST_OFF()
#define LCD_WR_BIT BIT0
#define LCD_WR_PORT GPIO2
#define LCD_WR_OFF() (PD0 = 0);
#define LCD_WR_ON() (PD0 = BIT0);
#define LCD_RS_BIT BIT1
#define LCD_RS_PORT GPIO2
#define LCD_RS_OFF() (PD1 = 0);
#define LCD_RS_ON() (PD1 = BIT1);
#define LCD_EN_BIT BIT2
#define LCD_EN_PORT GPIO2
#define LCD_ENABLE() (PD2 = 0);
#define LCD_DISABLE() (PD2 = BIT2);
#define LCD_BL_BIT BIT3
#define LCD_BL_PORT GPIO2
#define LCD_BL_OFF() (PD3 = 0);
#define LCD_BL_ON() (PD3 = BIT3);
/*
#define _LCD_DAT_OUT(Data) ROM_GPIOPinWrite(GPIO_PORTC_BASE, 0xFF, Data>>8);\
LCD_DATA_LATCH();\
ROM_GPIOPinWrite(GPIO_PORTC_BASE, 0xFF, Data&0xFF)
*/
#define _LCD_DAT_OUT(Data) PORTC = (Data>>8);\
LCD_DATA_LATCH();\
PORTC = Data
#define TFTGpioInit() ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOC);\
ROM_GPIOPinTypeGPIOOutput(GPIO_PORTC_BASE, 0xFF);\
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOD);\
ROM_GPIOPinTypeGPIOOutput(GPIO_PORTD_BASE, 0xFF);
//-----------------------------------------------------------------------------
TM4C123 SD Card 드라이버 코드
//-----------------------------------------------------------------------------
// SD Card HAL
#define _DEBUG_FAT_FILE 1
#define MMC_CS_PORT GPIOA
#define MMC_CS_BIT BIT3
#define MMC_CS_INIT() ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);\
ROM_GPIOPinTypeGPIOOutput(GPIO_PORTA_BASE, MMC_CS_BIT);
#define MMC_CS_HIGH() PA3 = BIT3
#define MMC_CS_LOW() PA3 = 0;
#define MMC_SpiInit() SPI0_Init()
#define MMC_SendByte SPI0_WriteReadByte
#define MMC_Send(Data) SPI0_WriteReadByte(Data)
#define MMC_Recv() SPI0_WriteReadByte(0xFF)
#define MMC_SPISpeed SPI0_SetSpeed
#define SPI_Mode3()
#define FAT_MAX_NUM_FILE 50
#define FCLK_SLOW() MMC_SPISpeed(SPI_SPEED_1MHZ)
#define FCLK_FAST() MMC_SPISpeed(SPI_SPEED_10MHZ)
//-----------------------------------------------------------------------------