microcontroller MC9S08QG8: bus frequency of the MTIM module and TPM module

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

microcontroller MC9S08QG8: bus frequency of the MTIM module and TPM module

跳至解决方案
869 次查看
marmor
Contributor III

In the microcontroller MC9S08QG8 there are a timer module (MTIM) and a timer / PWM module (TPM). In both modules, you can select the clock source you want to use. I selected the bus clock.

When I opened processor expert to initialize both modules,I configured the clock source of both modules were the bus clock, so both modules should have the same frequency and therefore the same period. Processor expert indicates the period and in both modules is different. TPM period is 256 times greater than the MTIM period. All this happens with the same configuration of the system clock.

My question is: ¿ why does this happen? Someone knows what happen?

  I attached some pictures which shows what I mean.

 

 

En el microcontrolador MC9S08QG8 hay un módulo timer(MTIM) y un módulo timer/PWM(TPM). En a,bos módulos se puede seleccionar ala fuente de reloj que quieras usar. Yo seleccioné el reloj del bus. Cuando abrí Processor Expert para inicializar ambos módulos los configuré para que su fuente de reloj fuese la del bus, por lo que ambos módulos deberían tener la misma frecuencia y por ende el mismo periodo. En el Processor Expert te indican el periodo del reloj del módulo cuando seleccionas una fuente y los periodos de ambos módulos eran diferentes. El periodo del módulo TPM era 256 veces mayor que el de MTIM y nose por qué. Todo esto ocurre con la misma configuración de reloj del sistema. ¿Alguien sabe que puede ocurrir?

 

Adjunto unas fotos para mayor aclaración

10465_10465.pngCPU.png10472_10472.pngMTIM.png10473_10473.pngTPM.png

标签 (1)
1 解答
491 次查看
weapon
Senior Contributor I

Hi Maria,

the modulo register of MTIM is 8-bit,  but TPM's is 16-bit.  Modulo register value =  0 is equat to modulo value = 65535.

in your setting, MTIM, 0.125 * 256 = 32us, TPM: 0.125*65536 = 8.192ms.

Hope I clarify clearly.

B.R

Weiping

在原帖中查看解决方案

3 回复数
492 次查看
weapon
Senior Contributor I

Hi Maria,

the modulo register of MTIM is 8-bit,  but TPM's is 16-bit.  Modulo register value =  0 is equat to modulo value = 65535.

in your setting, MTIM, 0.125 * 256 = 32us, TPM: 0.125*65536 = 8.192ms.

Hope I clarify clearly.

B.R

Weiping

491 次查看
marmor
Contributor III

thank you very much.
I thought the indicated period was the time it took to make an account.

0 项奖励
491 次查看
Wlodek_D_
Senior Contributor II

Hello,

Thank you for your post, however please consider moving it to the right community place (e.g. 8-bit Microcontrollers or CodeWarrior Development Tools ) to get it visible for active members.

For details please see general advice Where to post a Discussion?

Thank you for using Freescale Community.

0 项奖励