PIC32MK Question: PWM
I've got a board with the PIC32MK1024MC (the motor control version of the MK).
In the manual section relating to motor control PWM, it says:
"Most of the PWM output pins are normally multiplexed with other GPIO pins. When the Debugger
halts the device, the PWM pins will take the GPIO characteristics that is multiplexed on that pin.
For example, if the PWM1L and PWM1H pins are multiplexed with RE0 and RE1, the
configuration of GPIO pins will decide the PWM output status when halted by the Debugger."
This doesn't seem to be the case. When I halt my program in the debugger while the MK is actively generating PWM on six channels driving a BLDC motor, it continues to do so in the last PWM state it happened to be in when it entered the debugger, despite the fact that I have these pins programmed to output a low (which turns off the gate drivers to the MOSFETs) when in GPIO mode. This is a bad thing! The program isn't running, so nothing is commutating the motor, but it is letting current flow through two of the motor phases, which heats it up quickly.
Is this feature broken on the PIC32MK? If so, this'll make debugging code difficult (and potentially injurious to the motor).