4.3 Using the In-Circuit Debugger with the EasyPIC7 Development Board
We shall be using the EasyPIC7 development board in some of our projects in later chapters. It is therefore worthwhile to look at an example and see how we can use the in-circuit debugger on this board.
In this example we will count up in binary and send the results to PORT C of the microcontroller, where we will see the LEDs connected to the port counting up in binary. The required program code is shown in Figure 4.15. The steps to use the in-circuit debugger are given below:
- Create a project, as described in Chapter 3 and write the program given in Figure 4.15. Select the microcontroller type as PIC18F45K22, and the clock frequency as 8 MHz.
- Compile the program, making sure that the Build Type is set to ICD Debug and the Debugger is set to mikroICD in the Project Settings window before the compilation (see Figure 4.16).
- Connect the EasyPIC7 board to the PC using the USB cable, making sure that the power supply jumper is set to 5 V. You should see the green power LED and the orange Link LED turning ON.
- Download your program to the program memory of the microcontroller. Click Tools -> mE Programmer (or press function key F11) from the drop-down menu. During the loading you will see the red Active LED turn ON, and the Blue Data LED will flash to indicate that the loading is in progress.
- Start the in-circuit debugger by clicking Run -> Start Debugger (or press function key F9). When the debugging is started, the ...
Get Using LEDs, LCDs and GLCDs in Microcontroller Projects 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.