When TPM start count? - mc9s08ac16

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

When TPM start count? - mc9s08ac16

1,831 次查看
bluehacker
Contributor III

I am newbie for s08, and develop one low-cost(<30$) study kit for hcs08/rs08 now. I read mc9s08ac16 datasheet, but I am confused with the tpm module. my question is when the tpm timer start work? I set TPM' mode(free running counter, or input capture or pwm etc), set prescaler, set TPM COuter register,set counter modulo register...., but when the tpm module start work? I means when the TPM counter begin count?

 

 

 

 

 

 

 

Added p/n to subject.

Message Edited by NLFSJ on 2009-04-07 10:07 AM
标签 (1)
0 项奖励
回复
4 回复数

584 次查看
bigmac
Specialist III

Hello,

 

Immediately after POR (or any other reset), no clock source is selected for the TPM module.  To start the TPM counter you will need to select one of the available clock sources by writing an appropriate value to the TPMSC register.

 

Regards,

Mac

 

0 项奖励
回复

584 次查看
bluehacker
Contributor III

hi, bigmac,thanks for your reply!

if I am not misunderstand you, you means whenever I set TPMSC register, the timer begin count? and if I want stop TPM, I only set CLKSB:CLKSA=00 in the TPMSC register?

 

0 项奖励
回复

583 次查看
peg
Senior Contributor IV

Hi bluehacker,

 

Yes I think you have it!

This contrasts with the older TIM modules that always run from the BUSCLK and had a stop bit to stop/start the timer. The newer TPM modules have clock source select bits and the power up default state of 0:0 selects no clock - no clock, no count. As soon as you select a valid clock with CLKSB:CLKSA it will count that clock. The only way to stop it is to set CLKSB:CLKSA to 0:0 or stop the selected source clock.

 

0 项奖励
回复

584 次查看
bluehacker
Contributor III
thanks for peg and bigmac!!!
0 项奖励
回复