Enabling PWM Module Removes PPS Mapping of the SDI2 in dsPIC33EP512MC202
Why does the SDI2 pin stop working when the SDI2 pin is mapped using PPS for SPI operation and PWM1 (mapped to RPIN47) is enabled?
The default value of the PWM register is ICONx bits 14 and 15. The default value of these bits is '1' which enables both PWML1 and PWMH1 pins as PWM pins. With these settings, PWMH1 overwrites the PPS configuration for RPIN47 (pin 22/SDI2). Map the SPI pin to a pad which is not used by an active peripheral.