Strictly necessary cookies are on by default and cannot be turned off. Functional, Performance and Tracking/targeting/sharing cookies can be turned on below based on your preferences (this banner will remain available for you to accept cookies). You may change your cookie settings by deleting cookies from your browser. Then this banner will appear again. You can learn more details about cookies HERE.
Strictly necessary (always on)
Functional, Performance and Tracking/targeting/sharing (default off)
What do the EPXFIFOBCH and EPXFIFOBCL registers contain and how can they be used?
The EPXFIFOBCH and EPXFIFOBCL registers contain the number of bytes received from the interface domain. One way of using it is to commit a short packet, which is sent from the external master at the end of a long transfer. To do this, use the following code snippet in TD_Poll of the slave firmware:
if( (( EPXFIFOBCH<<8) | (EPXFIFOBCL)) < 0x200) //if the packet is short(here x is the IN endpoint which //receives data from external master)
EPXFIFOCFG = 0x00; //change from Auto mode to Manual mode
INPKTEND = 0x0X; //commit the short packet
EPXFIFOCFG = 0x0C; //back to Auto mode
Here, to commit the short packet the FIFO configuration is changed from Auto to Manual mode. Then, it is converted back to Auto mode if the master continues the long transfer.