Pages: [1]   Go Down
Author Topic: fastest pulse?  (Read 753 times)
0 Members and 1 Guest are viewing this topic.
Buena Vista, CO
Offline Offline
Full Member
***
Karma: 0
Posts: 180
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?

Jim
Logged

8000ft above the average

Buena Vista, CO
Offline Offline
Full Member
***
Karma: 0
Posts: 180
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Would this be better done with a 556?

Jim
Logged

8000ft above the average

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 439
Posts: 23739
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 170
Posts: 12451
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
... do your digitallwrites as needed
Agree with CrossRoads,

Quote
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.
Logged

Rob Tillaart

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

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 509
Posts: 31452
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I can't use PWM as rep rate never changes.
Yes you can change the rate of PWM.
Just google:-
arduino pwm frequency change
Logged

Pages: [1]   Go Up
Jump to: