hi.peg, I use mc9s08 to drive 122*32 LCD,The following program
#define A0 PTAD_PTAD0 /*_command or data*/
#define CS1 PTAD_PTAD1
#define CS2 PTAD_PTAD2
#define _WR PTAD_PTAD3
#define lcd_data PTBD
#define ENABLE PTCD_PTCD0
#define set_CS1() (CS1=1)
#define set_CS2() (CS2=1)
#define set_A0() (A0=1)
#define set_WR() (_WR=1)
#define set_ENABLE() (ENABLE=1)
#define clr_CS1() (CS1=0)
#define clr_CS2() (CS2=0)
#define clr_A0() (A0=0)
#define clr_WR() (_WR=0)
#define clr_ENABLE() (ENABLE=0)
void wait_ready(void)
{
//setReg8(PTBPE, 0x00);
setReg8(PTBDD, 0x00);
do{
clr_ENABLE();
clr_A0();
set_WR();
NOP();
}while(lcd_data & status_busy); //mask it dubug
setReg8(PTBDD, 0xFF);
}
i use 68-type microcontroller connect to LCD,thank you!