Codewarrior V4.6 build 6345 TrueTime Simulator/RealTime Debugger for MC9S12GC32CPB16

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

Codewarrior V4.6 build 6345 TrueTime Simulator/RealTime Debugger for MC9S12GC32CPB16

Jump to solution
3,922 Views
SSK
Contributor I
Hello Forum members,
 
I am using Codewarrior V4.6 build 6345 for MC9S12GC32CPB16. I have configured a project using ProcessorExpert feature wherein I have used a timer and a bitio bin. I have configured the timer for 2 sec interrupt. The timer ISR toggles the portM i/o (SPI SS pin) PM3_SS. The project builds successfully. I am using True Time Simulator / RealTime debugger to simulate the code. I am not able to view the status of the i/o pin used in the code. What settings I need to do for simulator? I also want to change the i/o pin value and check whether timer ISR is working properly. How to view/edit an i/o pin in simulator?
 
Your earliest help in this regard will help me to speed up my project. Thanks in advance.
Labels (1)
Tags (1)
0 Kudos
Reply
1 Solution
1,400 Views
CrasyCat
Specialist III
Hello
 
Here I would recommend you to use the visualization tool component.
 
- From the Debugger menu, select: Component > Open. A window opens with a list of components,
- Select 'Visualization'
- Click OK. A Visualization tool window opens in 'Edit' mode.

- Right-click in the Visualization tool window and select Add New Instrument > LED.
  The cursor is now dragging a box that you can drop in the data visualization window (click).
- Resize the box to a visible LED.
- A right click on this LED opens a window to set the properties of the LED. Set the following parameters:
 - Rounding box: No Box
 - Kind of Port: Memory
 - Port to display: <Address of I/O port>
 - Bit number to display: <Bit inside of I/O port>
- Close the property box.
You need the LED to refresh periodically to indicate changes when they happen.

- Right-click in the Data Visualization window. A pop up menu show up.
- Select Properties.
- Select Periodical and enter a Refresh Rate of 1.
- Close the window.
 
Now switch to Display mode
- Right-click in the Data Visualization window
- Select "Edit Mode". The entry Edit mode should be unchecked in the pop up menu after that.
 
From now on, you should see how the port is changing in the Visualization tool window
Clicking on the LED in the Visualization tool window will toggle the bit.
 
CrasyCat

View solution in original post

0 Kudos
Reply
8 Replies
1,401 Views
CrasyCat
Specialist III
Hello
 
Here I would recommend you to use the visualization tool component.
 
- From the Debugger menu, select: Component > Open. A window opens with a list of components,
- Select 'Visualization'
- Click OK. A Visualization tool window opens in 'Edit' mode.

- Right-click in the Visualization tool window and select Add New Instrument > LED.
  The cursor is now dragging a box that you can drop in the data visualization window (click).
- Resize the box to a visible LED.
- A right click on this LED opens a window to set the properties of the LED. Set the following parameters:
 - Rounding box: No Box
 - Kind of Port: Memory
 - Port to display: <Address of I/O port>
 - Bit number to display: <Bit inside of I/O port>
- Close the property box.
You need the LED to refresh periodically to indicate changes when they happen.

- Right-click in the Data Visualization window. A pop up menu show up.
- Select Properties.
- Select Periodical and enter a Refresh Rate of 1.
- Close the window.
 
Now switch to Display mode
- Right-click in the Data Visualization window
- Select "Edit Mode". The entry Edit mode should be unchecked in the pop up menu after that.
 
From now on, you should see how the port is changing in the Visualization tool window
Clicking on the LED in the Visualization tool window will toggle the bit.
 
CrasyCat
0 Kudos
Reply
1,400 Views
SSK
Contributor I
Hello CrasyCat,
 
Thanks for your earlier reply. I have two more queries - first is related to my earlier one.
 
1. It is working now but I am not getting the LED work as per my timer interrupt time set. I have configured timer1 for 2 secs and the timer ISR toggles the LED port pin. In simulator it is happening very fast - 2 times in a second. I tried all refresh modes - periodical, each access, CPU cycles and automatic but alas !! How can I get exact timer interrupt output in simulator?
 
2. In above case, I want to test the PORT A pin 0 in simulator. I used same LED and assigned PTA with bit 0. But it is not working. How to use PORT A in simulator? Is it similar to usage of other ports - PTM or PTT etc? Please clarify as this will help me progress in my project.
 
Thanks in advance
0 Kudos
Reply
1,400 Views
CrasyCat
Specialist III
Hello
 
You need to keep in mind that the simulator is not running in real time.
So even if you configure your interrupt for 2 seconds, it might not arise exactly after 2 seconds in the simulator.
 
To get exact real time behavior you need to run the application on the real hardware.
 
According to the hardware manual you need to set up the DDRA register accordingly if you intend to use PORTA register.
 
Did you initialize DDRA?
 
CrasyCat
0 Kudos
Reply
1,400 Views
SSK
Contributor I
Hello CrasyCat,
 
Thanks again for your kind reply. To what extent the simulator will try to generate the output - if my interrupt is set to 2 secs?
 
I am using PORT A pin 0 as output. I have set DDRA = 0x01 but still I am not able to simulate this pin? May be I am not able to assign this pin properly to LED component in simulator? How to assign port A pins to a component in simulator?
 
Thanks in advance.
0 Kudos
Reply
1,400 Views
CrasyCat
Specialist III
Hello
 
You use the same process I indicated below for PORTA or PORTM:
- Right-click in the Visualization tool window and select Add New Instrument > LED.
  The cursor is now dragging a box that you can drop in the data visualization window (click).
- Resize the box to a visible LED.
- A right click on this LED opens a window to set the properties of the LED. Set the following parameters:
 - Rounding box: No Box
 - Kind of Port: Memory
 - Port to display: <Address of I/O port>
 - Bit number to display: <Bit inside of I/O port>
- Close the property box.
 
Where in memory did you write 0x1 to initialize DDRA?
 
CrasyCat
0 Kudos
Reply
1,400 Views
SSK
Contributor I
Hello CrasyCat,
 
Thanks for your kind reply.
 
I have used the same procedure as you mentioned to configure the port pin in the Visualization tool window. I am able to simulate PORT M pin but failing to simulate PORT A pin. I have set Address of I/O port A = 0x0 but still I am unable to simulate PORT A pin. Please clarify the problem.
 
I am using Processor Expert which generates the initialisation code for port I/O used.
 
Thanks in advance.
0 Kudos
Reply
1,400 Views
CrasyCat
Specialist III
Hello
 
I would recommend you to submit a service request for that.

Click here to submit a service request.

Make sure to attach a reproducible project and installed product information to the service request.
To generate the required information:
- Start CodeWarrior
- Open the project
- Select "Help" -> "Pack and Go" and follow instructions on the screen.

Attach the generated .zip file to the SR.
CrasyCat
0 Kudos
Reply
1,400 Views
SSK
Contributor I
Thanks dear. It is working now but I am not getting the LED work as per my timer interrupt time set. I have configured timer1 for 2 secs and the timer ISR toggles the LED port pin. In simulator it is happening very fast - 2 times in a second. I tried all refresh modes - periodical, each access, CPU cycles and automatic but alas !! How can I get exact timer interrupt output in simulator?
0 Kudos
Reply