frequency to pulse width for BS2
Archiver
Posts: 46,084
What is the best way to get pulse width in microseconds from frequency in Hz
for use with the Stamp? I know that the period is the reciprocal of the
frequency and the pulse width would then be half of the period (assume equal
low and high periods). But since the stamp doesn't do fractions I'm not sure
the best way to get the pulse width from a frequency value. Thanks!
for use with the Stamp? I know that the period is the reciprocal of the
frequency and the pulse width would then be half of the period (assume equal
low and high periods). But since the stamp doesn't do fractions I'm not sure
the best way to get the pulse width from a frequency value. Thanks!
Comments
http://www.emesys.com/BS2math2.htm#Reciprocal
Depends on the range of pulse widths you have and the accuracy you require.
-- Tracy
>What is the best way to get pulse width in microseconds from frequency in Hz
>for use with the Stamp? I know that the period is the reciprocal of the
>frequency and the pulse width would then be half of the period (assume equal
>low and high periods). But since the stamp doesn't do fractions I'm not sure
>the best way to get the pulse width from a frequency value. Thanks!
later.
Can someone explain the freqout command for the BS2. Since the max value is
32Khz can I put in the max value for both frequencies to get 64Khz (sum and
difference frequencies) since the output is a mixture of the two programmed
frequencies? Why the 32Khz limit?
>later.
Please do try it again. Sometimes the packets get lost in cyberspace.
<http://www.emesystems.com/BS2math2.htm#Reciprocal>
>Can someone explain the freqout command for the BS2. Since the max value is
>32Khz can I put in the max value for both frequencies to get 64Khz (sum and
>difference frequencies) since the output is a mixture of the two programmed
>frequencies? Why the 32Khz limit?
The freqout command is created by using PWM, and the base time slot
for the PWM is about 4.5 microseconds. The superposition rule does
not really apply for addition of frequencies. Although it does work
well for subtraction. For example, freqout 0,5000,1000,1001 gives a
nice 1 hz beat frequency.
There is some more information about Stamp PWM you might find of
interest at this URL:
http://www.emesystems.com/BS2PWM.htm
If you just need several discrete square-wave frequencies, and you
aren't particular about exactly what they are, you can get them
directly of the PWM command.
There are some external frequency synth chips, but I don't have URLs at hand.
-- regards,
Tracy Allen
electronically monitored ecosystems
mailto:tracy@e...
http://www.emesystems.com
I need every frequency from 1 Hz to 100 kHz in 1 Hz increments! I had tried
to use the PAK8 but now thinking about just the Stamp and maybe a multiplier
to get the even frequencies above 32K. Although I'm not sure how that will
work with the PWM signal from the stamp.