Using comparators and a high speed emulated/virtual SR latch - STM32F334xx
I want to use two internal comparators to monitor current in a circuit. When the current gets above a level I want to turn off my switch, when the current falls below a level I want to turn on the switch. This needs to be done at a speed that is too fast and precise for software to handle (the off time can be as little as ~1uS and must have high resolution and minimal (nS) delay). I could use an external SR latch that is reset by the high current level comparator and set by the low current level comparator (I have done this in simulations and it works well), but I was wondering if there was a way to emulate a fast SR latch using the internal hardware, like perhaps using timer compare hardware or something similar. The processor I am currently looking at is the STM32F334xx. Any suggestions would be appreciated.
