When TPM start count? - mc9s08ac16

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

When TPM start count? - mc9s08ac16

1,828 Views
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
Labels (1)
0 Kudos
Reply
4 Replies

581 Views
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 Kudos
Reply

581 Views
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 Kudos
Reply

580 Views
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 Kudos
Reply

581 Views
bluehacker
Contributor III
thanks for peg and bigmac!!!
0 Kudos
Reply