Hello everyone,
I have a question regarding how to properly read from and set up a timer -- a 16 bit timer base, that is -- when using the prescaler to extend it.
So I'm using Timer A in its edge time count mode, counting upwards. I'm using the tivaware driver library for timer's. I know that if I just use TimerLoadSet and timerValueGet, I just put in and get back out a 16 bit value.
I'm a bit confused as to implementing the prescaler -- I assume that, when setting up the timer, I use TimerLoadSet to put in the 16 lSB's and then use TimerPrescalerSet (or whatever it's called) to put in the 8 MSB's, so that the timer will then count up the full 24 bit load before resetting.
In that case, how do I then read correctly what the timer value is when I receive an edge and record what the clocked value was? If I try using TimerValueGet to get the first 16 bits of the value the timer had when the edge was received, do I use TimerPrescalerGet to get the last 8 bits of the time the timer had when the edge was received? Or will calling TimerPrescalerGet just get me back the load value, and not the timer captured value? In that case, how am I to properly read the 24 bit time for when the edge was captured?
Thanks