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.
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
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?
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.