AnsweredAssumed Answered

ADSP21363-Parallel Port Write and Read Cycles

Question asked by vernon on Dec 8, 2010
Latest reply on Dec 17, 2010 by vernon

Hello, everybody!

I am a rookie. Now I have a troble in using of parallel port, witch is in the  8-bit mode.

When I write 1 byte to the extern device, I sometimes get 1 ALE cycle and 4 WR cycles, anoter times I just see 1 ALE cycle and 1 WR cycle by theoscillograph, Why?

When I read 1 byte frome the extern device , I capture 1 ALE cycle followed by 12 RD cycles. Why, again?

The follows is my code:

ERROR_CODE Parallel_WriteByte( unsigned int ulAddr, unsigned int Byte )

{

int sta = 0;

int nTimeOut = 10;

 

*pPPCTL = 0x00;

*pEIPP = ulAddr;

*pEMPP = 0;

*pICPP = 1;

*pECPP = 4;

*pPPCTL = PPEN | PPTRAN | PPDUR32; // | PPBHC | PPFLMD

*pTXPP = Byte;// | (Byte << 24) (Byte << 8) | (Byte << 16) | | staasm( "nop; nop; nop; nop;" );

do

{

sta = *pPPCTL & PPBS; //| PPS0 | PPS1) (PPBS | PPDS)

//if( nTimeOut -- < 0 )

//return POLL_TIMEOUT;

}

while( sta != 0x00 );

 

*pPPCTL = 0x00;

 

while( nTimeOut -- )

asm( "nop;" );

 

return NO_ERR;

}

Thanks!

Outcomes