About REVCTL

Question: What is the REVCTL operation in EZ-USB FX2 and its use in general in the slave FIFO application, when the endpoint is set to auto mode?

 

Answer:

The default setting of the AUTOIN/AUTOOUT bit in the EPxFIFOCFG register is 0 in the manual mode. When this bit is set to reflect auto mode, the FIFO will be set to auto mode. In order to set this bit it has to transition from a 0 to 1. This is a requirement. If you do not do this, then reloading the firmware will not set the FIFO in Auto mode as there is no transition the second time around, when the firmware is downloaded. Unless, of course you power cycle the device, when the default is set to 0 and firmware sets it to 1, thereby a transition of 0 to 1 taking place.

If you set the REVCTL.1 bit, then you do not need to do this transition sequence. With regards to programming the endpoint to auto mode, there is a specific sequence that needs to be followed while configuring an OUT endpoint in auto mode when REVCTL.1=1. Please refer to section 15.5.9 (Chip Revision Control) of the EZ-USB FX2 Technical Reference Manual (TRM) which can be download from the CY3681 - EZ-USB FX2 Development Kit, for further information on this bit. You can access the TRM from the link provided below

http://www.cypress.com/?rID=14319

When REVCTL.1=1, core blocks auto arming of OUT endpoints and the sequence of events need to be implemented for setting the auto bit (after having configured the EPxCFG register) in the EPxFIFOCFG register is as follows:

(a) Set the part to operate in slave FIFO/GPIF mode (whichever you are using) by setting IFCONFIG register accordingly
(b) Set REVCTL.1=1
(c) Set FIFORESET //reset the FIFO
(d) Arm endpoint using either EPxBCL or OUTPKTEND (NOTE: OUTPKTEND can only be used if REVCTL.0 is set. This register has no effect if REVCTL.0=0. See section 15.6.8 of the TRM (Force OUT Packet End.)
(e) Set AUTOOUT=1
(f) Set all the programmable flags if needed to be set in your application (PINFLAGSAB and PINFLAGSCD)

When REVCTL.1 is 0. You could do the following as follows:
(a) Set the part to operate in slave FIFO/GPIF mode (whichever you are using) by setting IFCONFIG register accordingly
(b) Reset FIFOs using the FIFORESET register
(c) Set all the programmable flags if needed to be set in your application (PINFLAGSAB and PINFLAGSCD)
(d) Set AUTOOUT bit in EPxFIFOCFG register to 0
(e) Set AUTOOUT bit in EPxFIFOCFG register to 1// allow core to see zero to one transition of auto out bit 0

NOTE: You do not need to arm the endpoint as the endpoint is armed automatically when it is set to auto mode (bit transitions from 0 --> 1).