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.

MSPM0G3507: TIMH0 Capture MODE PULSE WIDTH incorrect

Part Number: MSPM0G3507
Other Parts Discussed in Thread: SYSCONFIG

Hi Team,

I am suffering from the capture interrupt.

I just want to capture the pulse width. The timing of the interrupt and the captured pulse width are both incorrect.

I think maybe it was because of my config that cause the problem. Then I use the SDK:‘timh_timer_mode_capture_edge_capture’ , and capture is wrong either.

I changed the TIMH0 to TIMA1. It failed. Is there any bug in MSPM0? Or is there any bug in those encapsulation function"DL_Timer_XXXXXXX" ?

So I went to see the reg . Refer to the TRM.

I found the IMASK is different from my debug.

And I try to change it by myself and failed.

 It doesn't work.

I really really don't know what to do. It cost me a lot of time and I haven't made any progress.

I wish someone could help me to solve the problem.

Other reg is shown in the following figure.

  • Now I can capture the Fall edge but still have some problems.

    If there's no Fall edge , why will the capture interrupt execute.

    The first line is my capture interrupt. The second is the signal which I want to capture.

  • Hi Shi,

    In Sysconfig can you verify that the interrupt is enabled.

    Also in code you will need the "NVIC_EnableIRQ(CAPTURE_0_INST_INT_IRQN);" to enable the interrupt for CPU handling. From these 2 steps you should see the Interrupt Mask properly set. 

    Comparing your registers to the Pulse Width's suggestions you need to properly set the interrupts and enable the counter.

    Regards,

    Luke