Stopping system clocks in debug mode with Code Warrior

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Stopping system clocks in debug mode with Code Warrior

ソリューションへジャンプ
1,979件の閲覧回数
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,134件の閲覧回数
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,134件の閲覧回数
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,135件の閲覧回数
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 件の賞賛
返信