Hi Frnds,
I am using Cypress CY7C68013A EZ-USB micro controller, I have used BULKLOOP example given by cypress, where they have given a loop back transaction between EP2 to EP6, But I have changed the code for transmission of 64bytes of data as bulk on EP1, below code which i have written for bulk write operation, when i run this code it is transferring 64bytes of data ,but as a JUNK data, what is the mistake in this code, if there is any mistake please through some light on it.
if(!(EP01STAT & bmEP1INBSY)) { //Source is Internal RAM Buffer memset(UsbBuffer,'\0',64); APTR1H = MSB(&UsbBuffer); APTR1L = LSB(*UsbBuffer); // Destination is External RAM at 0x2800 AUTOPTRH2 = MSB(0x28); AUTOPTRL2 = LSB(0x00); EP1INBC = 0x40; //64KB count = EP1INBC;// (EP2BCH << 8) + EP2BCL; SYNCDELAY; for( i = 0x0000; i < count; i++ ) { EXTAUTODAT2 = EXTAUTODAT1; } SYNCDELAY; // EP1INBC = 0x40; //64KB // Destination is External RAM at 0x2800 APTR1H = MSB(0x28); APTR1L = LSB(0x00); AUTOPTRH2 = MSB(&EP1INBUF); AUTOPTRL2 = LSB(&EP1INBUF); // EP1INBC = 0x40; //64KB count = EP1INBC;// (EP2BCH << 8) + EP2BCL; SYNCDELAY; for( i = 0x0000; i < count; i++ ) { EXTAUTODAT2 = EXTAUTODAT1; } SYNCDELAY; EP2BCL = 0x40; // re(arm) EP2OUT u8TransmitFlag =1; } }
Rajesh
View all questions in Keil forum