GPIF Pin Polarity – KBA224208

Version 4

    Author : HemanthR_06          Version: **

     

    Translation - Japanese: GPIFピンの極性 - KBA224208 - Community Translated (JA)

     

    How do you interpret the polarity of GPIF pins based on the pin configuration chosen in GPIF Designer?

     

    GPIF interface pins of FX3 can be configured as input or output when used as GPIO. The polarity of Input /Output pins can be configured in GPIF II Designer. This article discusses the following three cases:

    1. How to interpret a state transition equation where an input pin is involved, whose polarity is chosen in GPIF II Designer
    2. The state of a state machine in which the pin will be driven and the voltage level if an output pin is configured for a specific polarity
    3. The drive value of the pin when a DMARDY flag with a configured polarity indicates full/ empty status

     

    1. Output pins(when used as GPIO)

      An unused GPIF interface pin configured as an output pin can be driven to the desired value using the DR_GPIO action in GPIF II Designer. Output GPIO can be configured to have the polarity as follows:
    • Active LOW GPIO will be driven HIGH (1) by default and will be driven LOW (0) in the state with the DR_GPIO action. It will be driven HIGH (1) in all states without the DR_GPIO action.
    • Active HIGH: GPIO will be driven LOW (0) by default and will be driven HIGH (1) in the state with the DR_GPIO action. It will be driven LOW (0) in all states without the DR_GPIO action.

      For example, consider the following state machine:

     

    Figure 1. Output GPIO Active HIGH Polarity

    In this configuration (see Figure 1), GPIO_17 (with Active HIGH polarity) will be driven HIGH (3.3 V) when it enters the state (READDATA) where DR_GPIO is called. In other states, the GPIO is driven LOW (0 V). See Figure 2 for the state machine.

     

    Figure 2. Output GPIO Example State Machine

    b. Output pins (when used as DMA Flags):

    A GPIF interface pin can also be configured as a DMA flag and can be configured to have the polarity as Active LOW or HIGH. The drive values will depend on whether it is indicative of a socket taking data into FX3 or out of FX3.

    - If the DMARDY flag for a socket which takes data into FX3 is configured as:

        • Active LOW: the flag is asserted (driven LOW) when the socket is full.
        • Active HIGH: the flag is asserted (driven HIGH) when the socket is full.

    -If the DMARDY flag for a socket where data is read out by an external device is configured as:

        • Active LOW: the flag is asserted (driven LOW) when no buffer is available to be read.
        • Active HIGH: the flag is asserted (driven HIGH) when no buffer is available to be read.

     

    For example, consider the following flag configuration for FLAGA and FLAGC, taken from application note AN65974 – Designing with the EZ-USB FX3 Slave FIFO Interface:

    Case A: Writing data from an external master to FX3

    FLAGA is Thread_0_DMA_Ready, which is associated with the socket that takes data from the external master. When the Thread_0_DMA_Ready flag is configured as Active LOW, the flag is driven LOW (0 V) when no buffer is available for the external master to write into PIB_SOCKET_0. When the flag is configured as Active HIGH, it is vice-versa.

    Case B: Reading data from FX3 GPIF socket to external master

    FLAGC is Thread_3_DMA_Ready, which is associated with the socket that provides data to the external master. When the Thread_3_DMA_Ready flag is configured as Active LOW, the flag is driven LOW (0 V) when no buffer is available for the external master to read from PIB_SOCKET_3. When the flag is configured as Active HIGH, it is vice versa.

    However, if the DMA_RDY flag is internally used in the state transition (as shown below), then it should be interpreted as follows:

    The DMA_RDY_TH0 variable in the transition from DMAWAIT to READDATA state indicates that the buffer is available for writing. The variable ‘!DMA_RDY_TH0’ indicates that the buffer is not available.

    c. Input Pins:

    An unused GPIF interface pin configured as input pin. The choice of polarity does not matter for Input pins.

    Consider an input ‘VALID’ that is configured as follows:

    This input has the following state transition:

    Irrespective of the polarity of ‘VALID’ chosen in GPIF II Designer, the above state transition is interpreted as follows:

        • Transit from DMAWAIT to READDATA state when GPIO_17 is driven with 3.3 V.
        • Transit from READDATA to DMAWAIT when the pin is driven with 0 V.