Configuration of a Port I/O pin for EZ-USB FX device CY7C646xx

Question: How can I configure GPIO as Port I/O functionality for EZ-USB FX device CY7C646xx?



In order to configure any Port pin for I/O functionality you need to do the following:

(1) Set the PORTxCFG (where x is the desired port) to its I/O function. For example to select Port A for I/O: PORTACFG =0x00;

(2) Set the Output Enable register, OEx, (where x is the desired port), set to 0 for input and set to 1 for output

(3) If set for input, use the PINSx (where x is the desired port) register for reading the contents of the I/O Port pin. If set for Output write to the OUTx (where x is the desired port) register. Please see the EZ-USB FX TRM, chapter 4 for further information.