1.20 MCPWM Channels

This example demonstrates how to use the MCPWM peripheral to generate PWM signals.

Description

This example shows how to configure the MCPWM to generate PWM signals whose duty and period can be configured independently.

Downloading and Building the Application

To clone or download this application from Github, go to the main page of this repository and then click Clone button to clone this repository or download as zip file. This content can also be downloaded using content manager by following these instructions.

Path of the application within the repository is apps/mcpwm/mcpwm_channels/firmware .

To build the application, refer to the following table and open the project using its IDE.

Project NameDescription
pic32mk_mcj_curiosity_pro.XMPLABX project for PIC32MK MCJ Curiosity Pro Board
pic32mk_mca_curiosity_pro.XMPLABX project for PIC32MK MCA Curiosity Pro Board

Setting Up PIC32MK MCJ Curiosity Pro Board

  • Connect the Debug USB port on the board to the computer using a micro USB cable

Setting Up PIC32MK MCA Curiosity Pro Board

  • Connect the Debug USB port on the board to the computer using a micro USB cable

Running the Application

  1. Build and program the application project using its IDE
  2. Observe the high-side and low-side PWM waveforms on the oscilloscope
  3. Observe the dead time between the high side and low side
  4. Refer to the table below for PWM channels oscilloscope connections:
    PWM ChannelPin For PIC32MK MCJ Curiosity Pro BoardPin For PIC32MK MCA Curiosity Pro Board
    PWM1HRPB14 (Pin 7 of J501 )RPB14 (Pin 19 of J601 )
    PWM1LRPB15 (Pin 8 of J501 )RPB15 (Pin 21 of J601 )
    PWM2HRPB12 (Pin 7 of J502 )RPB12 (Pin 22 of J601 )
    PWM2LRPB13 (Pin 8 of J502 )RPB13 (Pin 23 of J601 )
    PWM3HRPB10 (Pin 7 of J503 )RPB10 (Pin 24 of J601 )
    PWM3LRPB11 (Pin 8 of J503 )RPB11 (Pin 25 of J601 )