·· I've never heard of anyone trying to perform such a task.· Are you trying to control the motors directly off the I/O pins or are you using some sort of motor controller?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ Chris Savage Parallax Tech Support csavage@parallax.com
I guess you could try the FREQOUT command.· The recommended solution is the PWMPAL, available on our website under Accessories, Motor Control.· We also have Motor Controllers listed that have the PWM generation and driver circuitry all-inclusive.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ Chris Savage Parallax Tech Support csavage@parallax.com
You can pulsout two frequencies with FREQOUT.· If you had a notch filter on the input to the mosfets that would only pass one of the two frequencies, then you could control two motors almost simultaneously.
There is also a low pass filter, which passes only frequencies below a certain frequency, and high pass filter, which only pass frequencies above a certain frequency.· These might be easier to build, if you choose widely separated frequencies such as 500 and 2500.· Radio Shack probably has all the parts you need.
I modulate the pulses by pulsing one of the pins on the BS2. I could use 555 timer to generate the pulses and the BS2 to select the duty cycle. 555 timers are dirt cheap. What would be a good circuit to do this?
The BS2 is a single-tasking processor.· It cannot do PWM on two pins, unless you do as in the attached.
The approach I've taken is to not use the "PWM" command.· Instead, you use the main loop of your program to update each pin.· You can change the duty cycle by making "Low1" and "High1" different values.
Now, the fastest speed of the pulses may be low -- 500 uSec high and low.· You can put in a 'PAUSE' command to change the pulses by 1 mSec.· But I think this is the best the BS2 can do, if you're trying to drive multiple pins.
Post Edited (allanlane5) : 9/13/2005 1:09:45 PM GMT
A signal which is high for 5 mSec, and low for 22 mSec, has a period of 27 mSec, and a duty cycle of 5/22 == 22%.
A period of 22 mSec is a frequency of 1/22 mSec == 45 Hz.
Now, I don't know what the duty cycle of 'FREQOUT' is.
And I hope you're driving that fan through a transistor or Darlington or some other 'high current' device. Driving it directly from a BS2 pin could damage the pin (if you're pulling more than 25 mA).
Comments
·· I've never heard of anyone trying to perform such a task.· Are you trying to control the motors directly off the I/O pins or are you using some sort of motor controller?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sid Weaver
Do you have a Stamp Tester yet?
http://hometown.aol.com/newzed/index.html
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sid Weaver
Do you have a Stamp Tester yet?
http://hometown.aol.com/newzed/index.html
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sid Weaver
Do you have a Stamp Tester yet?
http://hometown.aol.com/newzed/index.html
·
The approach I've taken is to not use the "PWM" command.· Instead, you use the main loop of your program to update each pin.· You can change the duty cycle by making "Low1" and "High1" different values.
Now, the fastest speed of the pulses may be low -- 500 uSec high and low.· You can put in a 'PAUSE' command to change the pulses by 1 mSec.· But I think this is the best the BS2 can do, if you're trying to drive multiple pins.
Post Edited (allanlane5) : 9/13/2005 1:09:45 PM GMT
can somebody tell me how the translate this into a freq
for x = 1 to 300 'time, personal pref.
high fan
pause 5
low fan
pause 22
this will set a low volt fan at approx 25 %
for x = 1 to 200
high fan
pause 25
low fan
pause 4
this will run a low volt fan at approx. 75 %
japer
A period of 22 mSec is a frequency of 1/22 mSec == 45 Hz.
Now, I don't know what the duty cycle of 'FREQOUT' is.
And I hope you're driving that fan through a transistor or Darlington or some other 'high current' device. Driving it directly from a BS2 pin could damage the pin (if you're pulling more than 25 mA).
i used the transistor that came with what is a microcontroller
with a diode to prevent backfeeding problems
thanks for helping me with the math on this one
japer