Go Down

Topic: fastest pulse? (Read 1 time) previous topic - next topic


I need to produce 2 separate pulses, simultaneously, both pulses variable in both rep rate and pulse width. max frequency is about 1000 Hertz. Pulse width should be from 5% to 100%. What is the minimum time between 2 digital writes? I know I can time with milli's, but I am not sure what the timing is on writes themselves. I can't use PWM as rep rate never changes. I also unsure how I handle keeping width a constant % as rep rate changes. Is this possible with an Uno?

8000ft above the average


Would this be better done with a 556?

8000ft above the average


1000 Hz has a period of 1mS, 1000uS.
Make yourself a blink without delay sketch, every 50uS check the state of your width and on/offtime, do your digitallwrites as needed.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.


... do your digitallwrites as needed

Agree with CrossRoads,

I know I can time with milli's,

Use micros() instead  => a 1000 Hz signal needs 2000 switches

optionally use direct port manipulation  - http://www.arduino.cc/en/Reference/PortManipulation - to optimize accuracy.
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)


I can't use PWM as rep rate never changes.

Yes you can change the rate of PWM.
Just google:-
arduino pwm frequency change

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131