Rainbow Electronics AT89C5122 User Manual

Page 101

Advertising
background image

101

AT8xC5122/23

4202E–SCR–06/06

Endpoint FIFO reset

Before using an endpoint, its FIFO should be reset. This action resets the FIFO pointer
to its original value, resets the byte counter of the endpoint (UBYCTX register), and
resets the data toggle bit (DTGL bit in UEPCONX).

The reset of an endpoint FIFO is performed by setting to 1 and resetting to 0 the corre-
sponding bit in the UEPRST register.

For example, in order to reset the Endpoint number 2 FIFO, write 0000 0100b then 0000
0000b in the UEPRST register.

Advertising