Hi everyone, I'd like to insert the Teensy into the path between an external MCU outputting a 100kHz square wave on the STP/DIR/EN pins, and have the Teensy output a modified STP/DIR/EN signal. Timing will be crucial, as a rising edge on the STP pin indicates a step or microstep on the stepper driver itself, and they'll need to be synchronized.

I was going to have the Teensy interrupt on a rising edge, check the state of the DIR and EN pins, and add that to a buffer, outputting the signal to a different set of STP/DIR/EN pins connected to the driver but I'm a little foggy on the best way to implement that in the code.

I'd need to have it interrupt or poll on incoming STP signals, but still be able to output a perfect output based on the contents of the buffer. I don't know whether this is possible with an incoming and outgoing signal frequency of 100kHz, at the Teensy 3.2's typical clock rate. Anyone have any advice on how to code this, or whether it's possible?