User`s guide
AN0821
Rev. 0.1 25
3. Use a breakpoint to halt the CPU just prior to executing the statement to read the ADC sample and update
the PWM duty cycle:
a. Open Interrupts.c in the editor. If Interrupts.c is not shown in the tabbed list of files, then quickly
switch to the Development perspective and use the Project Explorer to open the Interrupts.c file.
Next, switch back to the Debug perspective. The debug session is still active when switching
perspectives. Files shown in the editor will be visible in both the Development and Debug
perspectives.
b. Scroll down to the following line in Interrupts.c:
PCA0CPH0 = (U8)(ADC0 >> 2);
c. Move the mouse cursor to the left-hand margin of the editor in the highlighted blue region. Double-click
the margin to add or remove a breakpoint at the corresponding source code line.
d. The core will halt on the breakpoint. Clicking the Resume button will run the CPU until the ADC
conversion complete interrupt fires again. Then the CPU will halt and all of the debug windows will
update to reflect the new CPU state.
3d
3b
3a
3c