• AVR Freaks

Hot!PIC32MK Question: PWM

Sal Ammoniac
Super Member
  • Total Posts : 219
  • Reward points : 0
  • Joined: 2011/11/27 14:04:14
  • Location: 0
  • Status: offline
2019/08/18 15:30:19 (permalink)

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).

0 Replies Related Threads

    Jump to:
    © 2020 APG vNext Commercial Version 4.5