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

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

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

Jump to solution
1,226 Views
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

Labels (1)
1 Solution
848 Views
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

View solution in original post

3 Replies
849 Views
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

848 Views
marmor
Contributor III

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

0 Kudos
Reply
848 Views
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 Kudos
Reply