A circuit for driving a motor of a compressor includes a microcontroller, which includes an op- amp, a comparator, a first serial interface, and a first dedicated pin. The op-amp amplifies a value indicating current in a power factor correction converter, which includes a power switch. The comparator asserts a comparison signal in response to the amplified value exceeding a reference value. The comparison signal is output on the first dedicated pin. A programmable logic device (PLD) includes a second serial interface in communication with the first serial interface and a second dedicated pin. The comparison signal is received on the second dedicated pin and the PLD receives control messages from the microcontroller via the second serial interface. The PLD sets a value in an off-time register based on a control message from the microcontroller. The PLD controls the power switch according to the comparison signal and the off-time register.