Academic Program

PWM4 Setup

PWM4 - Setup

Step 1 - The next step is to setup the PWM4 module. Click on PWM4 under Project Resources.

The PWM4 setup will appear in the center of the MPLAB X screen. This requires a few setup selections.

  1. Check the Enable PWM box
  2. Select Timer2 from the Select a Timer drop-down menu.
  3. Set the Duty Cycle to 50%.

The result should look like this:

 
 

 

Step 2 - Open the Pin Manager: Grid View tab and then click on the PWM4 Output pin row in the RA4 column to select the blue lock. It should turn green. This will output the PWM signal to the RA4 pin connected to the D2 LED. It should look like the picture when completed: