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.

320f2812 Capture interrupt flag

Hi!

Capture interrupt flag set before interrupt capture interrupt happens. Flag set when i set capture edges and flag reset when capture edges i turn to 0. Although flag set to 1, interrupts occur.  If i just try to clear this flag, nothing happens.Why so? And may be someone can  suggest correct way to enable and disable capture interupts?

  • Roman said:

    Hi!

    Capture interrupt flag set before interrupt capture interrupt happens. Flag set when i set capture edges and flag reset when capture edges i turn to 0. Although flag set to 1, interrupts occur.  If i just try to clear this flag, nothing happens.Why so? And may be someone can  suggest correct way to enable and disable capture interupts?

    Roman,

    Have you followed the flow from the reference guide?

    For a capture unit to function properly, the following register setup must be performed:
    1) Initialize the CAPFIFOx and clear the appropriate status bits.
    2) Set the selected GP timer in one of its operating modes.
    3) Set the associated GP timer compare register or GP timer period register,
    if necessary.
    4) Set up CAPCONA or CAPCONB as appropriate.

    Regards,

    Lori

  • Lori,

    All of these items done, can't find appropriate algoritm to enable disable capture units.When capture  always enable there is no problem.When i start disable or enamble capture by seting appropriate cap edge, some problem in  capture interrupts happen.