I was hoping that I could use the Periodic Timers PIT0 (with interrupts) and PIT1 as my system timers.
I tried using the example PIT code for the K20, but for some reason, I experience a LOCKUP reset, whenever I write to the periodic timer MCR (PIT_MCR). Setting it to 0 or FRZ will cause a LOCKUP reset, whenever I step into the next statement
Any Ideas as to why this will happen?
Solved! Go to Solution.
Hi
Do you power up the PIT module before using it?
POWER_UP(6, SIM_SCGC6_PIT);
i.e.
SIM_SCGC6 |= SIM_SCGC6_PIT;
or SIM_SCGC6 |= 0x00800000;
Regards
Mark
Hi
Do you power up the PIT module before using it?
POWER_UP(6, SIM_SCGC6_PIT);
i.e.
SIM_SCGC6 |= SIM_SCGC6_PIT;
or SIM_SCGC6 |= 0x00800000;
Regards
Mark
Thanks Mark. It's good to know that there is a power enable bit for the PIT peripheral ... I was going off the PIT example in K20P144M100SF2V2RM which didn't seem to indicate the use of this bit.
Hi
For your reference I have a link to HW timer support in the uTasker project which support the K and KL devices:
- PITs (K and KL) - single-shot and periodic interrupts
- FlexTimers (K) - single-shot and periodic interrupts or PWM
- TPM (KL) - single-shot and periodic interrups or PWM
The modules are powered up automatically when used and automatically powered down (when possible) when none of their channels are required further.
http://www.utasker.com/docs/uTasker/uTaskerHWTimers.PDF
All timers are simulated in the uTasker simulator.
Regards
Mark