cancel
Showing results for 
Search instead for 
Did you mean: 

USB Low-Full-High Speed Peripherals

FrZa_2625781
New Contributor II

Hi,

I have an Bulk IN endpoint with Auto-IN enabled that is constantly filled with data from the external master.

After a pause in data transfer I might want to discard the presumably old content of the endpoint buffers before I continue with the new transfer.

What do I have to write in which registers to declare the input buffers empty so that they can accept new data from the external master?

I assume this is an easy and silly question, but I have worked overnight on my previous problem and my brains feel like two soaked loafs of old bread.

Many thanks for any help!

0 Likes
1 Solution
SrinathS_16
Moderator
Moderator

Hello Frank,

To discard the data that has already been committed to the host, the FX2LP has to be switched to MANUAL mode. Implement the below piece of code to discard the data and re-enable the endpoint buffer to be filled by external master.

FIFORESET = 0x80; // activate NAK-ALL to avoid race conditions

SYNCDELAY;

EP6FIFOCFG = 0x00; //switching to manual mode

SYNCDELAY;

FIFORESET = 0x06; // Reset FIFO 6

SYNCDELAY;

EP6FIFOCFG = 0x0C; //switching to auto mode

SYNCDELAY;

FIFORESET = 0x00; //Release NAKALL

SYNCDELAY;

Best regards,

Srinath S

View solution in original post

0 Likes
1 Reply
SrinathS_16
Moderator
Moderator

Hello Frank,

To discard the data that has already been committed to the host, the FX2LP has to be switched to MANUAL mode. Implement the below piece of code to discard the data and re-enable the endpoint buffer to be filled by external master.

FIFORESET = 0x80; // activate NAK-ALL to avoid race conditions

SYNCDELAY;

EP6FIFOCFG = 0x00; //switching to manual mode

SYNCDELAY;

FIFORESET = 0x06; // Reset FIFO 6

SYNCDELAY;

EP6FIFOCFG = 0x0C; //switching to auto mode

SYNCDELAY;

FIFORESET = 0x00; //Release NAKALL

SYNCDELAY;

Best regards,

Srinath S

View solution in original post

0 Likes