I was wondering the plausibility of writing a program to do this:
Hook a 1 Hz square wave to an input When the arduino detects a rising edge from this input, the counter begins counting as dictated by an external 1 MHz clock When the counter reaches a predetermined number (say, 56 for a delay of 56 microseconds), the arduino will output 5V to a specified pin When the arduino detects the falling edge from the input, the counter begins counting (by 1MHz external clock again) When counter reaches a different predetermined number, arduino outputs 0 volts
I will probably use port manipulation to set the output low/high since port commands have a very short processing time. My question is how to use the timer/counter using an external clock.
The goal is to delay an input signal by a predetermined abount of microseconds as determined by an external 1MHz clock. I already have a program that makes use of the arduino's 16MHz clock, but want to try to do this with a more accurate external clock.