Hi Friends,
I have been using the MC9S08DZ60. I need to know if there's a Gated Time Accumulator as in HC11 controllers.
The intention is : If a GPIO line goes high, a timer starts running and when the Pulse Accumulator Register overflows, the controller is driven into an interrupt service routine.
Your inputs please,.
Thanks,
Pawan
Solved! Go to Solution.
Hi Pawan,
Please see section 16.4.1.2 "Counter Overflow and Modulo Reset", an interrupt flag and enable are associated with the 16-bit main counter. The flag (TOF) is a software-accessible indication that the timer counter has overflowed. When the timer counter overflowed, if TOIE is set, then, the contoroller is driven into an interrupt service routine and TOF is set.Hope it helps!
Hi Yong Li,
I need to start or stop the Timer based on The state of Capture pin TPM1Channel1.
Please check this thread : S08 Capture Mode and Timer Queries.
Request you to help me with this.
Mods : Sorry for creating a new thread.
Thanks,
Pawan
Pawan,
what you are asking for is available in every S12 and S12X device. This feature is not available in S08D.
If you could use external clock, then you could gate that external clock using external '(n)and' gate device and set up TPM to use this gated external clock. Another TPM unit could be setup to produce this external clock (one of channels in PWM mode).
Edward
Thanks Edward,
I am afraid. The controller is now finalized and the custom PCB is on the way. I can not insert an external component into it.
I understand your approach, but have a question here.
On selecting the "External Source" for this timer TPM Clock Source Selection, would it not take in clock from the External Crystal?
If yes, I have a constraint. This crystal clock is the source for all other modules viz. UART, SPI, etc.
Did I mis-interpret your statement?
Please advice.
Pawan
I meant clocking only TPM from external clock. See Fig 16-2. TPM Block diagram. TPM counter may be clocked from bus clock, from fixed system clock, or from external clock fed to TPMxCLK pin. So if you could apply externally gated external clock to TPMxCLK, this would function similar to gated pulse accumulator on HC11/S12.
Hi Edward,
I feel they refer to the Crystal Clock derived through EXTAL&XTAL pins in the image above.
Please correct me if I am wrong.
Pawan
Yes, you are wrong.
So, which pin is it?
TPMxCLK
Oh... Okay Edward,
Thanks :smileyhappy:
Fortunately, the IIC module isn't used.
Pawan.