This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

f2806x_VBusIntInit() USB lib example uses GPIO39 for XINT3 (VBus) but only GPIO0-GPIO31 interrupt capable?

Other Parts Discussed in Thread: CONTROLSUITE

In the C:\ti\controlSUITE\device_support\f2806x\v136\MWare\usblib\f2806x_usbWrapper.c module (supplied as part of the Mware F2806x USB library in C2000 ControlSuite), it would seem that the f2806x_VBusIntInit() example code wants to use GPIO39 as an interrupt input associated with XINT3!  I thought that only GPIO0 - GPIO31 are interrupt-capable pins and could be mapped for XINT1, XINT2 or XINT3? 

Here is the source code in question...

How is a value of 7 for the GPIOXINT3SEL register used to indicate that GPIO39 is used for XINT3 for the VBus interrupt?

Can anyone perhaps help me here - or is there something I have overlooked?

Thanks,

Gord

  • Hi Gord,

    Here's where it comes from:

    Please g othrough this doc for more info: http://www.ti.com/lit/ug/spruh18d/spruh18d.pdf

    Regards,

    Gautam

  • Hi Gautam,

    I have already read the TRM (spruh18d.pdf) about the GPIOXINTnSEL registers. The point of my original question is to find out why the TI sample code assigns a value of 7 to GPIOXINT3SEL to assign the GPIO7 pin as the interrupt source? I.E..  GpioIntRegs.GPIOXINT3SEL.all = 7;   The code does not use GPIO7 but rather uses GPIO39 as the input. The range of values for GPIOXINTxSEL is 0-31 which corresponds to the range GPIO0 to GPIO31 respectively.  It would seem that GPIO39 is not interrupt-capable.

    Regards,

    Gord

  • Hi Gautam,

    I would very much appreciate it if you could please comment on my last reply.  I read the TRM (spruh18d.pdf) about the GPIOXINTnSEL registers. The point of my original question is to find out why the TI sample code assigns a value of 7 to GPIOXINT3SEL to assign the GPIO7 pin as the XINT3 interrupt source.  I.E..  GpioIntRegs.GPIOXINT3SEL.all = 7;   The code does not use GPIO7 but rather intends on using  GPIO39 as the Vbus interrupt input - mapped to XINT3. The range of values for the GPIOXINTxSEL registers is 0-31 which corresponds to the range GPIO0 to GPIO31 respectively.  It would seem that it is not legal to specify GPIO39 for the XINT3 source - as GPIO39 is not interrupt-capable. Can you please verify this?

    Regards,

    Gord

  • Just to clarify my comment surrounding the fact that GPIO39 is not interrupt-capable and my confusion about the example code.
    From the F2806x data sheet:

    The TI sample code wants to use GPIO39 as the external interrupt pin for XINT3 -- strange.

  • Hello Gordon!

    If you look at the file F2806x_Gpio.h then you will find many interesting things which are not presented at data sheet:

    struct GPIO_INT_REGS {
    union GPIOXINT_REG GPIOXINT1SEL; // XINT1 GPIO Input Select Register (GPIO0 to 31)
    union GPIOXINT_REG GPIOXINT2SEL; // GPTRIP2 (TZ2n) Input Select Register (GPIO0 to 63)
    union GPIOXINT_REG GPIOXINT3SEL; // GPTRIP3 (TZ3n) Input Select Register (GPIO0 to 63)
    Uint16 rsvd1[5]; // Reserved
    union GPADAT_REG GPIOLPMSEL; // GPTRIP5 (XINT2) Input Select Register (GPIO0 to 63)
    Uint16 rsvd2[22]; // Reserved
    };

    It seems it's called the undeclared capabilities :-)

    Regards,

    Igor

  • Gordon,

    This is a bug in the code. External interrupts are not supported on GPIO39. I've sent a bug report to our software team so they can fix the file.

    In the meantime, please feel free to choose your own GPIO for VBus detection. (The intent of the file is allow this.)

    Apologies for the confusion.