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.

TM4C123GH6PM: Datasheet - Figure 11.3 Input Edge-count mode example, wrong count value ?

Part Number: TM4C123GH6PM

Hello, 

While checking the general-purpose Timers section in the TM4C123GH6PM datasheet, I reached the end of 11.3.2.3 Input Edge-Count Mode which shows an example which initializes the timer with 0x000A  (GPTMTnILR) and the match value with 0x0006 (GPTMTnMATCHR) in a count-down configuration where both edges are to be detected.

The example shows Figure 11-3. Input Edge-Count Mode Example, Counting Down

When the first rising edge of the signal occurs, the count is shown as 0x000A, but it should be 0x0009

Walking through the input signal edges::

1. rising edge ==> counter decremened to 0x0009 (do we have a match ? no, then continue)
2. falling edge ==> counter decremented to 0x0008 (do we have a match ? no, then continue)
3. rising edge ==> counter decremented to 0x0007 (do we have a match ? no, then continue)
4. falling edge ==> counter decremented to 0x0006 (timer value matches the value in GPTMTnMATCHR, as we're in the down-count mode, the GPTM reloads the timer value with 0x000A (as programmed in GPTMTnILR), then clears TnEN, i.e. stops. Consequently, the below signal edges will be ignored)
5. rising edge ==> ignored
6. falling edge ==> ignored


If this is all correct, then the first value in figure 11-3 should be 0x0009, unless it shows the value before being decremented (before the event occurs).
Please advise,

Best Regards,
Roger

  • Hello Roger,

    It is showing the value before being decremented. The GPTMTnILR register was loaded with 0x0A. Therefore the figure is showing that the register keeps the value of 0x0A that it was initially loaded with until a rising or falling edge occurs. At that point, it decrements correctly to 0x09. That is what is being illustrated.
  • Dear Ralph,

    Thank you for the clarification.

    I will mark this question as resolved, as you've clarified what TI intended to say in the figure, although it was, obviously, at first confusing to me.