How to Debug ...about timer interrupt......

cancel
Showing results for 
Search instead for 
Did you mean: 

How to Debug ...about timer interrupt......

4,563 Views
Contributor I
HI,
 
I use 9s12DT128B  for elevator.  Debuged by CodeWarrior 3.1 Professional Edition. But now meet a question : 
 
During my program, 1ms interrupt is necessary . So when I debug  with step by step,  the program keep to trace within the interrupt servie program. Because the timer is keeping to count, never stop. even the whole program have been stopped. The timer is going on running.
How can I do? how to stop the timer, the program halt? 
 
 
Labels (1)
Tags (1)
0 Kudos
5 Replies

92 Views
Specialist III

Hello

Which connection are you using to connect to your board (Multilink, Cyclone Pro, ...)?

With some connections it is possible to disable maskable interrupts while stepping, when checking the  "Disable maskable ISR's when stepping" checkbox in "Communication"|"Special Setup" dialog.

Availability of that box depends on the version of the tools you are using and on the connection you are using.

I hope this helps.

CrasyCat

0 Kudos

92 Views
Contributor I

Hi  thanks for your anwswer,

I use MultilinkBDM to connect to my target board.

Besides, I want to know.

Does the timer of CPU stop counting when MCU halt during the debug? For example:  current TCNT: 0x1000, then I press "Single step". ->maybe TCNT become to 0x10FF, and than I press "Single step" again-> myabe TCNT become to 0x11FE. when I don't press any instruction, the TCNT dont change.   But Freescale MCU timer can not stop when MCU halt ?  Have any method to overcome this problem?

 

0 Kudos

92 Views
Specialist III

Hello

The debugger will not stop the timer counter. So you would have to modify the appropriate registers if you want to do so.  

CrasyCat

0 Kudos

92 Views
Contributor III
Harlen,
 
Setting the TSFRZ bit in the TSCR1 register to 1 should disable the timer and modulus counter when you are in the debugger with the target stopped.
 
See the ECT_16B8C Block User Guide. 
 
"Freeze Mode" or "Active BDM mode" is the state that the target is in when it is not executing instructions and connected to a BDM debugger. 
 
Stop and Wait are other possible modes when the target is not executing instructions, but BDM communication is not possible in these modes.
0 Kudos

92 Views
Contributor I
Hello Harlen.
It sounds like you're trying to single-step with interrupts enabled. If you find the status register in the debug screen and double-click the I-flag it should disable the interrupts and then you can single-step your code.
ron
0 Kudos