Setting and running to breakpoints, Toolstick-f321dc – Silicon Laboratories F321DC User Manual

Page 10

Advertising
background image

ToolStick-F321DC

10

Rev. 0.1

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 Debug

Stop 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 Debug

Go 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.

Advertising