2 PWM to Switch Mapping

The PWM instance-to-switch mapping can be arbitrary. The dsPIC33A devices allow routing of the PWM outputs to any remappable pin (RPx) for additional flexibility. The PWM instance mapping used in this example was chosen to allow sharing of the PWM and APWM master period, duty cycle and phase registers (MPER, MDC, MPHASE). This reduces the number of registers to write during operation. All of the auxiliary PWM Generators (APG) are located on the secondary side. The 24 PWM outputs are mapped to their corresponding switch per Table 2-1 below.

Table 2-1. PWM Mapping
BankPhaseSwitch PositionSwitch DesignatorPWM output
1APrimary HighQAP_HPWM1H
Primary LowQAP_LPWM1L
Secondary HighQAS_HPWM2H
Secondary LowQAS_LPWM2L
BPrimary HighQBP_HPWM3H
Primary LowQBP_LPWM3L
Secondary HighQBS_HAPWM1H
Secondary LowQBS_LAPWM1L
CPrimary HighQCP_HPWM4H
Primary LowQCP_LPWM4L
Secondary HighQCS_HAPWM2H
Secondary LowQCS_LAPWM2L
2APrimary HighQAP_HPWM5H
Primary LowQAP_LPWM5L
Secondary HighQAS_HPWM6H
Secondary LowQAS_LPWM6L
BPrimary HighQBP_HPWM7H
Primary LowQBP_LPWM7L
Secondary HighQBS_HAPWM3H
Secondary LowQBS_LAPWM3L
CPrimary HighQCP_HPWM8H
Primary LowQCP_LPWM8L
Secondary HighQCS_HAPWM4H
Secondary LowQCS_LAPWM4L