请教诸位大侠,手中有一块3.5寸tftlcd屏,这个屏是16位8080并口驱动的,我想用8位的51单片机驱动它可以吗?
比如把程序写成这样 , P2接高8位 ,P0接低8位
#define DataH P2
#define DataL P0
void LCD_Write_DATA(unsigned int dat)
{
LCD_RS=1; //data
LCD_RD=1; //write
LCD_WR=1;
LCD_CS=0;
DataH = (dat>>8);
DataL = (dat);
LCD_WR=0;
LCD_WR=1;
LCD_CS=1;
}
void LCD_Write_CMD(unsigned int cmd)
{
LCD_RS=0; //cmd
LCD_RD=1; //write
LCD_WR=1;
LCD_CS=0;
DataH = (unsigned char)(cmd>>8);
DataL = (unsigned char)(cmd);
LCD_WR=0;
LCD_WR=1;
LCD_CS=1;
}
|