Yeah that’s exactly what the oscilloscope showed under test. As long as the clock pulse executes immediately after the direction change, it seems fine. It’s a big, ugly hack. But, surprisingly reliable probably outside of crazy EMI conditions.
Changing up the algorithm would be nice. It’s current state was a long process of compiling to assembly and going instruction-by-instruction to optimize the speed as much as possible. The shortest execution loop is 7 instructions, which gives me the 2.28MHz with the Arduino’s crystal.
But, for the time being, I’m just trying to get the glue logic right
. I’m already down about $60 on failed boards + components. This next build is going to be fully through-hole, so at least I can socket and reuse the components if there’s another problem.