STM32G4 Window Comparator Alternatives
I am designing a motor controller PCB that uses an STM32G4 MCU (since the CORDIC accelerator and FPU will be useful in my application). One of the required features for this project is cycle-by-cycle current limiting for a BLDC motor. I have two phase current sensors for phases A and B which I am reading through inputs that have an ADC and comparator. In the documentation I read how the comparators can be used to implement cycle-by-cycle current limiting. However, I need to be able to apply current limiting to positive and negative currents (i.e. the current magnitudes) of each phase. It looks like comparator window mode is meant to solve this exact problem. However, it appears that the STM32G4 series comparators do not have window mode. Is there a recommended alternative to window mode that would allow me to cycle-by-cycle current limit on both positive and negative current peaks?