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.

TMS320F280039C: Qualification Time for AIO Interrupts

Part Number: TMS320F280039C


Hi, 

I have 3 AIOs set up to trigger XINT1, XINT2, XINT3 respectively when the GPIO is low. I am seeing noise triggering these interrupts so I wanted to add some filtering time. I want to be sure I understand this correct. With a 120MHz clock if I set divider to 510 with 6 samples of qualification then that means I would have to then have 25.5us of the GPIO being low to trigger the interrupt. Is this correct? 

This is the setup code: 

    // AIO240 -> Leg C over current, 0 = over current
    GPIO_setPinConfig(GPIO_240_GPIO240);
    GPIO_setAnalogMode(AIO240_LEGCOC, GPIO_ANALOG_DISABLED);
    GPIO_setQualificationMode(AIO240_LEGCOC, GPIO_QUAL_6SAMPLE);
    GPIO_setQualificationPeriod(AIO240_LEGCOC, 510); // This means with 120MHz clock it will take 25.5us to trigger IOC - 6 samples at 4.25us a piece

    // AIO227 -> Leg B over current, 0 = over current
    GPIO_setPinConfig(GPIO_227_GPIO227);
    GPIO_setAnalogMode(AIO227_LEGBOC, GPIO_ANALOG_DISABLED);
    GPIO_setQualificationMode(AIO227_LEGBOC, GPIO_QUAL_6SAMPLE);
    GPIO_setQualificationPeriod(AIO227_LEGBOC, 510); // This means with 120MHz clock it will take 25.5us to trigger IOC - 6 samples at 4.25us a piece

    // AIO236 -> Leg A over current, 0 = over current
    GPIO_setPinConfig(GPIO_236_GPIO236);
    GPIO_setAnalogMode(AIO236_LEGAOC, GPIO_ANALOG_DISABLED);
    GPIO_setQualificationMode(AIO236_LEGAOC, GPIO_QUAL_6SAMPLE);
    GPIO_setQualificationPeriod(AIO236_LEGAOC, 510); // This means with 120MHz clock it will take 25.5us to trigger IOC - 6 samples at 4.25us a piece

    // Only setting up interrupts for LEG ABC for now - total of 5 interrupts we can use
    GPIO_setInterruptPin(AIO236_LEGAOC, GPIO_INT_XINT1);
    GPIO_setInterruptPin(AIO227_LEGBOC, GPIO_INT_XINT2);
    GPIO_setInterruptPin(AIO240_LEGCOC, GPIO_INT_XINT3);

    GPIO_setInterruptType(GPIO_INT_XINT1, GPIO_INT_TYPE_FALLING_EDGE);
    GPIO_setInterruptType(GPIO_INT_XINT2, GPIO_INT_TYPE_FALLING_EDGE);
    GPIO_setInterruptType(GPIO_INT_XINT3, GPIO_INT_TYPE_FALLING_EDGE);

    GPIO_enableInterrupt(GPIO_INT_XINT1);
    GPIO_enableInterrupt(GPIO_INT_XINT2);
    GPIO_enableInterrupt(GPIO_INT_XINT3);

Thanks for the help!

  • I think it's a minimum of 21.25us rather than 25.5us.

    You will have read in the manual the following:

    So the GPIO needs to be stable for a minimum of 5 x 510 x (1/120e6) = 21.25us.

  • To set an AIO as a DI is this all you need to do? 

        GPIO_setPinConfig(GPIO_236_GPIO236);

        GPIO_setAnalogMode(AIO236_LEGAOC, GPIO_ANALOG_DISABLED);

        GPIO_setQualificationMode(AIO236_LEGAOC, GPIO_QUAL_SYNC);

    Then you can read input like: 

    GPIO_readPin(AIO236_LEGAOC);

    Just trying to figure out why this GPIO seems to trigger due when it is not really triggering. 

  • I think I figured this out - I still need to declare the GPIO as an input: 

    // AIO236 -> Leg A over current, 0 = over current
    GPIO_setPinConfig(GPIO_236_GPIO236);
    GPIO_setAnalogMode(AIO236_LEGAOC, GPIO_ANALOG_DISABLED);
    GPIO_setDirectionMode(AIO236_LEGAOC, GPIO_DIR_MODE_IN);
    GPIO_setPadConfig(AIO236_LEGAOC, GPIO_PIN_TYPE_STD);
    GPIO_setMasterCore(AIO236_LEGAOC, GPIO_CORE_CPU1);
    GPIO_setQualificationMode(AIO236_LEGAOC, GPIO_QUAL_SYNC);