Welcome in the forum, Jacob.
You have got the advantage (opposed to me) of no language barrier. So my question is: Did you find the counter's datasheet (click right) because all the functioning is explained in deep.
The counter is free running and decreases (it is a down counter) with every "count" pulse, aligned to the clock signal. The hall sensor, after passing the LUT generates a signal for every revolution. This signal is used to capture the current counter value. The difference to the previous value gives the time needed for a revolution. All that is handled within the interrupt handler.
"on terminal count" is the point where the counter is zero and another pulse comes
"on capture/compare" is
a) The signal "capture" goes high which will save the current counter value in an internal register
b) signals that the counter value compares with a pre-set comparison value.
Thanks for the reply. I am now a little bit confused on the timing aspect of the counter timer. For the speed measurement the hall sensor will create a couple counts during one period of the timer. The period of the timer is set at 65535 and counts down to zero based on the 200kHz timer input. So each timer interval is 0.65 seconds. What happens in the code when the period goes to 0. The timer might clock in 500 and the next value 65000. This previous timer value is going to give a negative speed. What am I missing.
Use the windows calculator, set to "Programming" and width to "Dword".
Enter 500 - 65000 =
Convert the result to a word by selecting now "Word" (The calculator cannot do that better) and you get 1036. This is what C will calculate for you.