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
已解决! 转到解答。
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
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
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.