emaq
Member level 4
I am generating a 100 kHz interleaved signal (image attached below) with 80 % duty cycle using the following code for Arduino UNO. However, when I measure the signal frequency with oscilloscope, I get 48 kHz only. If I try to reduce the delayMicroseconds() the maximum achievable frequency is 61 kHz.
Why this is happening? Either with UNO I cannot get more than 61 kHz or the oscilloscope measurements are incorrect... I could figure out the reason. Please help me with this issue.
Why this is happening? Either with UNO I cannot get more than 61 kHz or the oscilloscope measurements are incorrect... I could figure out the reason. Please help me with this issue.
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 void setup() { pinMode(11, OUTPUT); pinMode(13, OUTPUT); digitalWrite(11, HIGH); digitalWrite(13, HIGH); } void loop() { digitalWrite(13, LOW); delayMicroseconds(2); digitalWrite(13, HIGH); delayMicroseconds(3); digitalWrite(11, LOW); delayMicroseconds(2); digitalWrite(11, HIGH); delayMicroseconds(3); }