Ok, so I have an application that pulls an input pin low. The sketch has to wait a specified time and then turn an ouput high.
Firstly, the whole cycle takes <512us. The interrupt input pin and one of the outputs are connected together, so I have to switch the output back to an input at the end of it all so there isn’t a short when the interrupt is next pulled low.
Now, I did try. I setup an interrupt on a pin that called my timing routine.
The timing routine changed the output pin to low, then changed it from being an input to an output.
There is a fixed delay of 255 us then a variable delay of 0-255 us based on the value of a internal variable.
Then the output is turned high. The rest of the second 255us is waited out and the output is turned into an input and we are done.
However it didn’t seem to work at all.
Am I expecting too much speed wise from a normal arduino sketch? Is the delay routine not accurate enough?
Am I going to have to switch to inline assembly to get this to work?