Stopping system clocks in debug mode with Code Warrior

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

Stopping system clocks in debug mode with Code Warrior

跳至解决方案
1,970 次查看
Eqqman
Contributor I

Hello-

 

I've been trying to debug some code on the MCF52233 that makes use of an interrupt for PIT0.  With other architectures I've used the internal clocks are usually strictly controlled so that timer counters only increment as you advance opcode by opcode through your code.

 

With CW though we're finding that the clocks never stop running even though you would expect the device to be 'paused' when program execution halts due to a breakpoint or using the 'break' feature.  This is making it very difficult to debug code because we keep branching back to the ISR even before we've left the ISR to begin with.  To try and prevent this we push clearing the interrupt flag right down to before the RTE statement, but if 'too much' time has been spent looking at the code, we'll branch back to the start of the ISR before we can even execute the RTE.  Is there a way to get the PIT timers to only update their counters when instructions are actually being executed? 

标签 (1)
0 项奖励
回复
1 解答
1,125 次查看
mjbcswitzerland
Specialist V

Hi

 

Set the DBG bit (bit 5) in the PIT Control and Status register to cause it to stop when in debug mode.

 

Regards

 

Mark

 

www.uTasker.com

- OS, TCP/IP stack, USB, device drivers and simulator for M521X, M521XX, M5221X, M5222X, M5223X, M5225X. One package does them all - "Embedding it better..."

在原帖中查看解决方案

0 项奖励
回复
2 回复数
1,125 次查看
Eqqman
Contributor I

Works like a charm, thanks!

 

I'm not used to having devices support that feature in hardware and I'd overlooked that bit.

0 项奖励
回复
1,126 次查看
mjbcswitzerland
Specialist V

Hi

 

Set the DBG bit (bit 5) in the PIT Control and Status register to cause it to stop when in debug mode.

 

Regards

 

Mark

 

www.uTasker.com

- OS, TCP/IP stack, USB, device drivers and simulator for M521X, M521XX, M5221X, M5222X, M5223X, M5225X. One package does them all - "Embedding it better..."

0 项奖励
回复