Question: Is it possible to check the count down of a PIT

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

Question: Is it possible to check the count down of a PIT

跳至解决方案
1,332 次查看
nijo
Contributor II

Hey,

 

I am trying to debug some code in Code Warrior. I have setup my PIT 0 to use the bus clock and count to 65:

 

SIM_SCGC6 = 0x800000;

 

PIT_TCTRL0 = 0x3UL;
PIT_LDVAL0 = 0x41UL;

 

Is there a way I can check so it is actually started and counting ?

 

In debug mode I can inspect the registers of the PIT, eg, 

 

PIT_MCR0x0 0x40037000
PIT_LDVAL00x1964 0x40037100
PIT_CVAL00xb60 0x40037104
PIT_TCTRL00x3 0x40037108
PIT_TFLG00x1 0x4003710c
PIT_LDVAL10x0 0x40037110
PIT_CVAL10x0 0x40037114
PIT_TCTRL10x0 0x40037118
PIT_TFLG10x0 0x4003711c
PIT_LDVAL20x0 0x40037120
PIT_CVAL20x0 0x40037124
PIT_TCTRL2 0x0 0x40037128
PIT_TFLG2 0x0 0x4003712c
PIT_LDVAL3 0x0 0x40037130
PIT_CVAL3 0x0 0x40037134
PIT_TCTRL3 0x0 0x40037138
PIT_TFLG30x00x4003713c

 

Best regards,

 

0 项奖励
回复
1 解答
1,136 次查看
nijo
Contributor II

PIT_LDVAL holds the value we compare against while PIT_CVAL contains the current value that is being counted.

在原帖中查看解决方案

0 项奖励
回复
1 回复
1,137 次查看
nijo
Contributor II

PIT_LDVAL holds the value we compare against while PIT_CVAL contains the current value that is being counted.

0 项奖励
回复