sed 1330 problem
2004-06-22 by sacoche1111
Hi,All
I connected Powertips' 320x240 LCD with sed 1330 onboard in the
following way:
p19..p26 = d0..d7
p27 = #wr
p28 = #rd
p29 = a0
p31 = #cs
I used the following code to communicate with the module:
void WriteLCD(unsigned char op)
{
unsigned long port;
port=op;
port<<=19;
IOCLR=0x7F80000; //D0-D7
IOSET=port;
wait_us(1);
IOCLR=1<<27; //#WR
wait_us(1);
IOSET=1<<27;
wait_us(1);
}
void WriteCommand(unsigned char op)
{
IOSET=1<<29; //A0
WriteLCD(op);
wait_ms(1);
}
void WriteData(unsigned char op)
{
IOCLR=1<<29; //A0
WriteLCD(op);
wait_ms(1);
}
void LCDInitialize()
{
IODIR|=0x3FF80000;
IODIR|=(unsigned long)1<<31;
IOSET=1<<27; //#WR
IOSET=1<<28; //#RD
IOCLR=(unsigned long)1<<31; //#CS
WriteCommand(0x40);
WriteData(0x31);
WriteData(0x87);
WriteData(0x07);
WriteData(0x27);
WriteData(0x39);
WriteData(0xEF);
WriteData(0x28);
WriteData(0x00);
}
then goes mode select etc
not the case 'cause it is from the same project
based on AVR which works perfectly
I tried even the slowest timings but still no reply from lcd,
it only flashes
is there something wrong with bus emulation?
thanks in advance