how to recieve an external interrupt in fx3s?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
gean_3054931
Level 5
Level 5
10 likes given 5 likes given First like received

The pin from an external device is connected to fx3s pin.How to call an ISR ?specific to this pin?

or

fx3 supports an external interrupt pin?

let me know

thank you

0 Likes
1 Solution
abhinavg_21
Moderator
Moderator
Moderator
50 likes received 25 likes received 10 likes received

Yes FX3 supports external interrupt pin. Please refer to the following firmware example code:

C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3\firmware\serialif_examples\cyfxgpioapp

In this Firmware refer to the CyFxGpioInit() :

apiRetStatus = CyU3PGpioInit(&gpioClock, CyFxGpioIntrCb); // Here you have to register the callback function. In this case CyFxGpioIntrCb

    if (apiRetStatus != 0)

    {

        /* Error Handling */

        CyU3PDebugPrint (4, "CyU3PGpioInit failed, error code = %d\n", apiRetStatus);

        CyFxAppErrorHandler(apiRetStatus);

    }

    /* Configure GPIO 45 as input with interrupt enabled for both edges */

    gpioConfig.outValue = CyTrue;

    gpioConfig.inputEn = CyTrue;

    gpioConfig.driveLowEn = CyFalse;

    gpioConfig.driveHighEn = CyFalse;

    gpioConfig.intrMode = CY_U3P_GPIO_INTR_BOTH_EDGE;  // Here you can select type of Interrupt (Level , Edge Triggered)

    apiRetStatus = CyU3PGpioSetSimpleConfig(45, &gpioConfig); // Here GPIO 45 is configured to receive external interrupt

    if (apiRetStatus != CY_U3P_SUCCESS)

    {

        /* Error handling */

        CyU3PDebugPrint (4, "CyU3PGpioSetSimpleConfig failed, error code = %d\n",

                apiRetStatus);

        CyFxAppErrorHandler(apiRetStatus);

Please refer to the comments that I have mentioned above.

View solution in original post

1 Reply
abhinavg_21
Moderator
Moderator
Moderator
50 likes received 25 likes received 10 likes received

Yes FX3 supports external interrupt pin. Please refer to the following firmware example code:

C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3\firmware\serialif_examples\cyfxgpioapp

In this Firmware refer to the CyFxGpioInit() :

apiRetStatus = CyU3PGpioInit(&gpioClock, CyFxGpioIntrCb); // Here you have to register the callback function. In this case CyFxGpioIntrCb

    if (apiRetStatus != 0)

    {

        /* Error Handling */

        CyU3PDebugPrint (4, "CyU3PGpioInit failed, error code = %d\n", apiRetStatus);

        CyFxAppErrorHandler(apiRetStatus);

    }

    /* Configure GPIO 45 as input with interrupt enabled for both edges */

    gpioConfig.outValue = CyTrue;

    gpioConfig.inputEn = CyTrue;

    gpioConfig.driveLowEn = CyFalse;

    gpioConfig.driveHighEn = CyFalse;

    gpioConfig.intrMode = CY_U3P_GPIO_INTR_BOTH_EDGE;  // Here you can select type of Interrupt (Level , Edge Triggered)

    apiRetStatus = CyU3PGpioSetSimpleConfig(45, &gpioConfig); // Here GPIO 45 is configured to receive external interrupt

    if (apiRetStatus != CY_U3P_SUCCESS)

    {

        /* Error handling */

        CyU3PDebugPrint (4, "CyU3PGpioSetSimpleConfig failed, error code = %d\n",

                apiRetStatus);

        CyFxAppErrorHandler(apiRetStatus);

Please refer to the comments that I have mentioned above.