Gated Time Accumulator in S08 controller

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Gated Time Accumulator in S08 controller

跳至解决方案
2,553 次查看
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

标签 (1)
标记 (2)
1 解答
2,391 次查看
kef2
Senior Contributor V
10 回复数
2,391 次查看
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!

2,391 次查看
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 项奖励
回复
2,391 次查看
kef2
Senior Contributor V

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

2,391 次查看
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 项奖励
回复
2,391 次查看
kef2
Senior Contributor V

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 项奖励
回复
2,391 次查看
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 项奖励
回复
2,391 次查看
kef2
Senior Contributor V

Yes, you are wrong.

2,391 次查看
pawankumar
Contributor III

So, which pin is it?

0 项奖励
回复
2,392 次查看
kef2
Senior Contributor V

TPMxCLK

2,391 次查看
pawankumar
Contributor III

Oh... Okay Edward,

Thanks :smileyhappy:

Fortunately, the IIC module isn't used.

Pawan.

0 项奖励
回复