I need the Arduino to provide a signal 100 - 10000 ns "high" in a 57,5 Hz cycle. Thats my calculation:
At 57.5 Hz one “cycle” takes 17391304,34 ns
Signal “high”-time has to be between 100 ns and 10000 ns.
Example: Signal high for 5000 ns, then low for 17386304,34 ns then cycle
The Arduino works @ micro-seconds level in practice. So 57.5Hz = 17391.xxx uSec
So your 8693's are quite good.
However depending on the Arduino you have (Crystal or resonator) the 16Mhz clock might be off a few percent.
you could correct for this.
note that the call for loop() takes time and the digitalwrite()'s too.
I f you want it more precise, you'll need to get rid of loop jitter and digitalWrite delays.
You'll still see some jitter from micros() and millis() interrupts.
void loop(){
while (1){
PORTB = PORTB | 0b00100000; // pin high
delayMicroseconds(5);
PORTB = PORTB & 0b11011111; // pin low
delayMicroseconds(17386); // tweak as needed for they 6-8 clock cycles of direct port manuipulation
} // end while
} // end loop
What I found out: Using the code of CrossRoads (thank you for that) my Arduino delivers a stable signal of 5.06 microseconds - perfect.
The Arduino has to feed the signal to another circuit which expects a timing as mentioned above. When I connect it to that circuit the voltage goes down and then the signal varies between 600 - 900 nanoseconds. Not good as it effects the total timing of the cycle.
What load does the other circuit present to the Arduino output? Sounds like either the connecting cable (you are connecting signal plus gnd?) are bogging it down, or the end circuit is.
Crossroads: The Arduino is supplied with 12V current and ground from the interface, the Arduino delivers the signal. According to the specification there must be a 10 kOhms resistor between ground and the signal wire. A 500 Ohms resistor lowers the voltage of the pulse to 1.9V (specification: 1 - 2V)
DrAzzy: The other circuit is a kind of interface. The interface-log says: 57.1944 Hz, so less than calculated.