Program Debugging

The program can be run by pressing the Play button in the control console. If the program is correct, the specified output is seen. The bar graph displays a binary count when the Input button on the schematic is “pressed” using the mouse pointer. It should take 2.56 sec to cycle through all the output codes with a loop delay of 10 ms. This can be checked using the simulation clock at the bottom of the screen.

If the program does not work as required, it needs debugging. The screenshot in Figure C.2 shows some of the debugging features. The principal technique is single stepping—the program sequence is checked by executing one statement at a time. This requires the source code to be displayed; pause the program and select the ...

Get Programming 8-bit PIC Microcontrollers in C now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.