MC9S12C32 - Debugging interrupts and some other questions

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MC9S12C32 - Debugging interrupts and some other questions

1,233 Views
LisaJ
Contributor I
Hi, I have several questions:

1. is there anyway with the codewarrior or some other tool to watch how the interrupts work? Or at least run the program for a while on the board and then stop and get the data from it?

2. When using a timer interrupt I define a function using it to be an interrupt 16.
What does this "16" mean and where can I find it in the vector table?

3. Any tutorial on writing/reading data from the board while it's running??


Thank you
Labels (1)
0 Kudos
1 Reply

309 Views
CrasyCat
Specialist III
Hello
 
>1. is there anyway with the codewarrior or some other tool to watch how the interrupts work?
>    Or at least run the program for a while on the board and then stop and get the data from it?
Well you should be able to start execution of the application, stop it after a while and look at any variable, memory area in the debugger. I am not sure I understand the problem or question here.

>2. When using a timer interrupt I define a function using it to be an interrupt 16.
>    What does this "16" mean and where can I find it in the vector table?
interrupt 16 means entry 16 in the vector table.
  Entry 0 is the reset vector (located at 0xFFFE)
  Entry 1 is the clock monitor fail interrupt (located at 0xFFFC)
  and so on.
 interrupt 16 is the interrupt located at address 0xFFDE and it the standard timer overflow interrupt.
 Please look at the MC9s12C Family reference manual that you can download from following URL:
Section 1.6 there is describing the vector table entries.

>3. Any tutorial on writing/reading data from the board while it's running??
You can look at data while the application is running using the periodical refresh mode.
Be careful, depending on the number of variables you want to look at this may be intrusive (i.e. change the real time behavior of the system).
1.      Use Data window
        - In your debugger is you are using the default layout, you have a window called Data:1 showing 
          "Global" on the right hand side of the information bar (on top of the window).
       -  Click with the right mouse button in the Data:1 window
       -  Select "Open Module" in the drop down menu. a Modules dialog is opened.
       -  Select the source file where the variable is defined.
       -  You will see the current value of the variable in the Data window.
2.      Use an expression in a Data Window
       -  In your debugger is you are using the default layout, you have a window called Data:1 showing
           "Global" on the right hand side of the information bar (on top of the window).
       - Drag the variable name from the Source Window to the Data window.
       - You should be able to see the variable value in the Expression window. 
3.      Use visualization window
       -  Select "Component" -> "Open". The "Open Window Component" dialog is opened.
       -  Double click on "Visualization Tool" component. A new window is opened called "Visualization tool" 
       -  Click with the right mouse button in the visualization tool component and select "Add new
           Instruments" -> "Value as Text
       -  Place the instrument somewhere in the window (just click inside of the window).
       -  Click with the right mouse button on the instrument and select "Properties"
       -  Set "Kind of Port" to Variable, specify the variable name in "Port to Display" and adjust text you want
           to see in front of the value in "Field description".
If you are using V3.1 tools or earlier, option 2 and 3 will not allow you to browse (or navigate) within a structure or pointer.
If you upgrade to V4.5 or higher, you will be able to browse within data structure or a pointer in option 2 too.
Also upgrading to V4.5 or higher will allow you to just drag and drop a variable from the data window to the visualization tool window. Visualization tool is not suited to browse or navigate within a data structure or a pointer.
To activate periodical refresh on Data window: click right within the data window and select "Mode" -> "Periodical". You can adjust refresh period there.
To activate periodical refresh on the visualizationtool, Click right within the visualization tool window and set Refresh Mode to Periodical. You can also adjust refresh period in et dialog.
 
I hope this helps.
CrasyCat
0 Kudos