Setting of ICG and TPM mode in MC9S08AC128 and MC9S08GT60

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

Setting of ICG and TPM mode in MC9S08AC128 and MC9S08GT60

718 次查看
preetuabraham
Contributor III

Hi,

I am setting the ICG and TPM Timer registers with an external oscillator of 27MHz

 

For MC9S08GT60: FBE Bypassed external mode

/* Using an external 27Mhz crystal

_ICGC1.ICGC1Data = 0x54;

_ICGC2.ICGC2Data = 0x01;

 

 

/* Set the status and control register for the TPM. */

_TPM1SC.TPM1SCData = 0x4f;  /*prescaler is 128*/

_TPM1MODH.Data = 0xff;

_TPM1MODL.Data = 0xff;

We were getting a timer interrupt every 5 ms.

 

But with MC9S08AC128  with all the same register bit setting  ,we are not getting 5 ms interrupt instead 1.2s interrupt.

 

But when I changed the Modulus value to 0x106 ,it gets the interrupt at 5ms .I am not sure why there is a difference since the registers are all same and external frequency .Do you have any clue about it.

0 项奖励
0 回复数