1
|
2
|
3
|
In the Workspace window, select the project level node and choose Project>Options.
|
|
Defining a C-SPY setup file which will open the file InputData.txt and define the Access macro function
|
|
Setting the breakpoint and associating the Access macro function to it.
|
1
|
2
|
Use the Use macro file browse button to specify the macro file to be used:
|
3
|
The C-SPY interrupt system requires some interrupt definitions, provided by the device description files. With the Device description file option you can specify the appropriate file. See the Interrupt.c file in the cpuname\tutor directory for information about which device description file to be used in this tutorial.
|
4
|
Select Run to main and click OK. This will ensure that the debug session will start by running to the main function.
|
1
|
1
|
2
|
Examine the Log window. Note that the macro file has been loaded and that the execUserSetup function has been called.
|
1
|
Choose Simulator>Interrupt Setup to display the Interrupt Setup dialog box. Click New to display the Edit Interrupt dialog box:
|
The interrupt definition that the simulator uses to be able to simulate the interrupt correctly.
|
||
Specifies the first activation moment for the interrupt. The interrupt is activated when the cycle counter has passed this value.
|
||
Repeat interval
|
Specifies the repeat interval for the interrupt, measured in clock cycles.
|
|
Probability (%)
|
Specifies probability. 100% specifies that the interrupt will occur at the given frequency. Another percentage might be used for simulating a more random interrupt behavior.
|
|
Variance (%)
|
2
|
When you have specified the settings, click OK to close the Edit Interrupt dialog box, and then click OK to close the Interrupt Setup dialog box.
|
1
|
Choose View>Breakpoints to open the Breakpoints window, right-click to open the context menu, choose New Breakpoint>Immediate to open the Immediate tab.
|
RBUF
|
||
3
|
Click OK to close the breakpoints dialog box.
|
1
|
In the Interrupt.c source window, step through the application and stop when it reaches the while loop, where the application waits for input.
|
2
|
In the Interrupt.c source window, locate the function UartReceiveHandler.
|
3
|
Place the insertion point on the ++callCount; statement in this function and set a breakpoint by choosing Edit>Toggle Breakpoint, or click the Toggle Breakpoint button on the toolbar. Alternatively, use the context menu.
|
4
|
Open the Terminal I/O window and run your application by choosing Debug>Go or clicking the Go button on the toolbar.
|
5
|
Click Go again to see the next number being printed in the Terminal I/O window.
|