Setting OUT Endpoint in Auto Mode for FX2LP

Question: I have set the AUTOOUT bit in the EPxFIFOCFG  register but the external peripheral wired  to the FX2LP device cannot access the FIFOs.  Is the endpoint actually operating in Auto mode?

 

Answer:

The default setting of the AUTOIN/AUTOOUT bit in the EPxFIFOCFG register is 0: manual mode. When you set this bit 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 ofcourse you power cycle the device when the default is set to 0 and firmware sets it to 1, there by 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 Technical Reference Manual for further information on this bit. 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) bysetting 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 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 is as follows
(a) Set the part to operate in slave FIFO/GPIF mode (whichever you are using) bysetting 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).