Other Parts Discussed in Thread: SYSCONFIG
Hello,
I would like to have an RTI module that has an up counter that ticks every micro-second. (1us)
The up counter then uses a compare interrupt to increment the free-running counter once every second. (1s)
This needs to function as a long continuous timer.
Using the RTI LED Blink example in the SDK(08_05_00_24), it seems the sysconfig settings are what I would want.
Unless I'm mistaken, this would mean that, if using counter block 0, I should have the micro-second(us) count in the up count register (baseAddr + CSL_RTI_RTIUC0)
and the second(s) counter in the free-running register (baseAddr + CSL_RTI_RTIFRC0)
In this case, the up-counter will be the amount of micro-seconds(us) but scaled to fit the 32bit register
and I would assume the free-running counter will not need a conversion as the compare interrupt triggers every second.
after 5s [ HW_RD_REG32(baseAddr + CSL_RTI_RTIFRC0) = 5 ]
In `rti_led_blink.c` I added a do loop to print out the counter register values and the clock ticks & led blink count for reference.
If the timers are setup the way I think, the low count(up-counter/RTIUC0) would be micro-seconds
and the high count(free-running/RTIFRC0) would be seconds but both seem to be scaled numbers of some sort.
In this example, the LED state switches every second which would be every time the compare interrupt is triggered; which I expected to be the same number as the high/free-running counter.
Questions:
- Does the up counter tick every micro-second? (1MHz)
- Does the free-running counter tick every second? (1,000,000us period)
- How would I convert the register value to seconds or micro-seconds respectively?
- If my analysis is wrong, where does my logic breakdown?
Thanks in advance,
Chris