Using a Digital Output With MPLAB® Code Configurator Classic
Last modified by Microchip on 2024/06/24 06:33
Using the MPLAB® Code Configurator (MCC) simplifies the setup for the various registers within the device to create a digital output. In this example, you used MPLAB X IDE, MCC Classic, and MPLAB XC8 to demonstrate how to toggle a digital port pin using the MPLAB IDE simulator. The technique extends beyond the PIC16F1769, as it can be applied uniformly across various Microchip Technology MCU devices, including both PIC® and AVR® architectures.
MCC Content Manager Wizard now gives a list of Required Content and Optional Content list. In this case, no additional content is required for this project. Click Finish.
Open the Pin Manager: Grid View tab in the output window and then click on the PORTA pin 2 (RA2) Output blue lock symbol, it will turn green. It should look like the accompanying image when completed:
Click on the Pin Module selection in the Project Resources section. The center screen should show RA2 listed on the I/O chart. Click on the Output box to make the pin an output (if not checked) and make sure Analog and WPU are not checked (click on them to uncheck them).
Click on the Debug and Run icon to compile and run the code; you should see a BUILD SUCCESSFUL message in the output window under the Digital-out (Build,Load,...) tab.
Each time you click on Continue the program will run until it hits the breakpoint on the IO_RA2_Toggle()O_RA2 command. You will see the RA2 bit of PORTA change state.
The project can be closed in MPLAB X IDE. The project is saved automatically when it is built, but any changes to files or configuration may ask to be saved before the project is closed.
Close the project under File Menu > Close Project.
If you need to work with Microchip Support staff directly, you can submit a technical support case. Keep in mind that many questions can be answered through our self-help resources, so this may not be your speediest option.