Academic Program

Pin Module Setup

Pin Module Setup

Step 4 - Open the Pin Manager and then click on the PORTA pin 4 (RA4) blue lock symbol in the Output row to make it locked and green. This adds this RA4 I/O pin to the project to drive the LED.

Click on the PORTA pin 0 blue lock in the ANx row to make it green. This adds the RA0/AN0 input to the project. Vref+ and Vref- should be left to their default values.

proj3io2.png

 

Step 5 - Close the Pin Manager and then click on the Pin Module in Project Resources to open the center section. It will show RA4 and RA0 listed on the I/O chart.

gpio.png
 
 
  1. The RA4 pin will be made an output and control the LED. Click on the Output box to make the pin an output and uncheck the WPU and Analog boxes.
  2. Change the RA4 pin name to "D2_LED".
  3. The RA0 pin is the potentiometer input, so check the Analog box and uncheck the Output and WPU boxes if checked.
  4. Change the RA0 pin name to "Pot_A0".
proj3ioset.png