This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

EPP timing (ARM LPC2138)

Dear All The computer output 8 bits data of P1.24~P1.31, and I save the data on the buffer(EPP_Data); then the data was input to LCD driver IC via the P0.0~P0.7.

Problem:
My computer output 0x11 via P1.24~P1.31 and use scope to check computer output data is correctly show 0x11, but the data (0x11) via P0.0~P0.7 into LCD driver IC, the data somehow becomes inaccurate(and it shows 0x61).
I wrote my program as follows,and I wonder if any mistake?

//Pin Define//
#define CS P1_16
#define WR P1_17
#define RD P1_18
#define RS P1_19

#define EPP_WR P1_20
#define EPP_AS P1_21
#define EPP_DS P1_22
#define EPP_WAIT P1_23

#define EPP_Data0 P1_24
#define EPP_Data1 P1_25
#define EPP_Data2 P1_26
#define EPP_Data3 P1_27
#define EPP_Data4 P1_28
#define EPP_Data5 P1_29
#define EPP_Data6 P1_30
#define EPP_Data7 P1_31

void main(void)
{ uint32 EPP_Data;

PINSEL0 = 0x00000000; PINSEL1 = 0x00000000; PINSEL2 = 0x00000000;

IO0DIR = 0xFFFFFFFF; IO1DIR = 0x008FFFFF;

while(1) { IO1CLR = EPP_WAIT; if((IO1PIN & EPP_WR ) == 0) { if((IO1PIN & EPP_AS) == 0) { EPP_Data = IO1PIN & 0xFF000000; EPP_Data = (EPP_Data >> 24);

IO0CLR = 0x000000FF; IO1CLR = CS; IO1CLR = RS; IO1SET = RD; IO1CLR = WR; IO0SET = EPP_Data; IO1SET = WR; IO1SET = CS; IO1SET = EPP_WAIT; } } }
}

0