I'm looking to drive a high side driver at PWM frequency of 200Hz on a Teensy 4.1 with variable duty. The high side driver current sense pin is connected to an analogue pin on the Teensy. I want to sample an analogue reading only when the PWM output is low (HSD is on). I'll also likely need to read the analogue input with some delay after the PWM output has gone low (approximately 200uS).
How can I achieve this and guarantee synchronisation?