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.

Compiler/TMS320F2812: Sample code for falling edge capture

Part Number: TMS320F2812


Tool/software: TI C/C++ Compiler

Hi how to capture the falling edge of input pulse, CAP2/QEP2. anybodies help me with example code.

Jeyapaul K

  • Jeyapaul,

    I don't have any example code for this however these modules are relatively simple, here is the setup procedure for a capture module.

    "

    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.

    "

    CAPFIFOA and CAPCONA have all of the control bits for CAP2. A full description of these registers can be found in the Event Manager Reference Guide. I would also recommend reading the section 3 "Capture Units" it is a quick read and will likely answer any questions you have when you start to use the Capture module.

    Regards,
    Cody

  • Jeyapaul,
    are you still struggling with this or have you found some resolution?

    Regards,
    Cody