Silicon Laboratories F321DC manual Setting and Running to Breakpoints

Models: F321DC

1 16
Download 16 pages 61.78 Kb
Page 10
Image 10

ToolStick-F321DC

6.6. Setting and Running to Breakpoints

The Silicon Laboratories microcontroller devices support up to four hardware breakpoints. A breakpoint is associated with a specific line of code. When the processor reaches a hardware breakpoint, the code execution stops, and the IDE refreshes all debug and watch windows. The on-chip debug hardware allows for breakpoints to be placed on any line of executable code, including code in Interrupt Service Routines. This section provides steps to set a breakpoint on the line of source code that increments the Num_LED_Flashes variable.

1.If the device is running, stop execution using the "Stop" button or use the DebugStop menu option.

2.Scroll to the ADC0_ISR function and right-click on the variable "Num_LED_Flashes". In the context menu that appears, select "Insert/Remove Breakpoint." On the left side of the line in the editor window, a red circle is added to indicate a breakpoint is placed on the source line.

3.Click the "Go" button or select the DebugGo menu option.

4.After a short time, the IDE will show that the device is halted. A blue line will be placed in the editor window to indicate where the code execution has stopped.

5.Start and stop the processor a few more times. Notice that the LED blinks once for every time the processor is started and the Num_LED_Flashes variable also increments by one.

10

Rev. 0.1

Page 10
Image 10
Silicon Laboratories F321DC manual Setting and Running to Breakpoints