8-bit PIC® MCU Enhanced Mid-Range Programming Digital Output Example

Last modified by Microchip on 2024/01/18 19:24

Required Hardware/Software

This example program turns on LED1 by outputting a logical 1 to RD1 (i.e., PORT D, bit 1). 

To run the demonstration programs you will need to have MPLAB® X IDE and MPLAB XC8 C Compiler installed on your computer. The projects can be run on the F1 Evaluation Board with the PICkit™ 3 or by using MPLAB X IDE's software simulator.

Digital output

C and Assembly code


To install the lab files, unzip the downloaded file into any directory on your computer.

The "Getting Started" document in the downloaded project files shows how to install the compiler and MPLAB X IDE.

The files for the labs can be downloaded in the project and source files GitHub repository.

Configuring the Demonstration Program

When installed, the lab files contain MPLAB X projects for each demonstration.

The demo projects have all been configured to use MPLAB X IDE's internal simulator as the hardware tool. You have the option of selecting the F1 Evaluation Kit as the simulation tool. Changing the default settings can be done from the Project Properties window for each of the projects.

Project properties window

Running the Demonstration Program

You can run the demonstration project using MPLAB X IDE. You will need to open the project and run it in Debug mode. If you are using the F1 Evaluation Kit with a PICkit 3 you have the option of pushing the Program Target Project button to see the project run on the target hardware.