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.

TM4C123GH6PZ: TM4C123GH6 : TimerMatchSet() behaviour issue

Part Number: TM4C123GH6PZ

Hello,

I'm using a 32 bits timer to count up pulses received on a input GPIO.

When a count of pulses are received, I want an interrupt handler is called. And I want to do that for different count values (100, 150, 180,etc).

The TM4C123 calls my interrupt handler as wished. When I read the counter value with TimerValueGet() the first time, I read a good value, before calling TimerMatchSet() for the next count. When my interrupt handler is called for the second time, the value read with TimerValueGet() is 0. I do not have the pulses count from the begining. The counter seems to be reset to 0.

Is it a normal behavior? Because I should like to have the total pulses count from the TimerLoadSet(0).

Have you an idea?

Thank you for your help.

  • TimerLoadSet(0) will set the Load register (LR) to 0, so the timer will effectively not count (count to 0 repeatedly). 

    If you're using Edge-Count mode, the counter will be reset automatically after the match event [Ref datasheet (SPMS376E) Sec 11.3.2.3].

    Can you post the sequence you're actually using?