Gated Time Accumulator in S08 controller

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Gated Time Accumulator in S08 controller

Jump to solution
1,489 Views
pawankumar
Contributor III

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

Labels (1)
Tags (2)
1 Solution
1,327 Views
kef2
Senior Contributor IV
10 Replies
1,327 Views
Rick_Li
NXP Employee
NXP Employee

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!

1,327 Views
pawankumar
Contributor III

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

0 Kudos
1,327 Views
kef2
Senior Contributor IV

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

1,327 Views
pawankumar
Contributor III

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

0 Kudos
1,327 Views
kef2
Senior Contributor IV

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.

0 Kudos
1,327 Views
pawankumar
Contributor III

s08.JPG

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

0 Kudos
1,327 Views
kef2
Senior Contributor IV

Yes, you are wrong.

1,327 Views
pawankumar
Contributor III

So, which pin is it?

0 Kudos
1,328 Views
kef2
Senior Contributor IV

TPMxCLK

1,327 Views
pawankumar
Contributor III

Oh... Okay Edward,

Thanks :smileyhappy:

Fortunately, the IIC module isn't used.

Pawan.

0 Kudos