Hello,
I am trying to get a free running timer going on the FRDM KL25Z board. I have included the component FreeCntr32 and attached it to TPM1. I have been unsuccessful in getting it to run as a free running counter. No matter how I configure things, it stops after the counter rolls back to 0. In addition, the OnCounterReset event gets fired everytime I call GetTimeMS() so using that as a trigger to reset and restart the counter won't work. The third issue I have is that the counter seems to be counting at a 1ms rate when I have configured it for 10ms (it rolls back to zero after about a minute- or 65535 msecs). What am I missing??? I have attached the KDS project that exhibits this behavior- thanks for any help.
Tom
Original Attachment has been moved to: TimerTest.zip
Tom
With the KL25 you can use the SYSTICK, TPM, LPTRM or PITs as free running timers.
See http://www.utasker.com/docs/uTasker/uTaskerHWTimers.PDF
I had a quick look at your project but don't think that you have a problems with the TPM but instead have errors in the loop that you use because it is based on a 16 bit counter that looks to fail once it overfows.
I don't know the code used but, although named as FreeCntr32, it doesn't look to support more than 16 bit counting.
You can take a look at µTasker Kinetis FRDM-KL25Z support which will also work out-of-the-box with KDS but includes more powerful methods that those generated by PE and also allows you to simulate the KL25 (and its timers).
It is completely free for non-commerical work and there is fast-track support in the Kinetis forum.
Regards
Mark
Kinetis: µTasker Kinetis support
KL25: µTasker Kinetis FRDM-KL25Z support / µTasker Kinetis TWR-KL25Z48M support
For the complete "out-of-the-box" Kinetis experience and faster time to market