Frequency vs. Time
Eric R
Posts: 225
While the BS2 does not like multitasking, what are the odds of making this situation work:
I am looking into a possible project where Frequency needs to be compared to time. Since the frequency is of a high voltage low amperage variety I will be converting this from frequency to voltage for a possible digital potentiometer scenario. Regardless of this input type, it will need to be compared to a variable time base. While the BS2 does not have a real time clock, an adjustable·pulse from a 555 timer would do fine and would lighten the load on the BS2.
What will take place is as follows:·Lets say for example, I am monitoring the speed of a treadmill and it is perfectly fine to raise the speed within moderation. The·"frequency" input vs. the "time base" input would allow for acceptable operation. However, if someone were to crank the speed knob ·faster than deemed acceptable, an output would shut down the treadmill. To determine the acceptable speed increase, the pot on the 555 timer would be adjusted inorder to increase of decrease the number of pulses (time base).
How well could the BS2 handle this situation???
I am looking into a possible project where Frequency needs to be compared to time. Since the frequency is of a high voltage low amperage variety I will be converting this from frequency to voltage for a possible digital potentiometer scenario. Regardless of this input type, it will need to be compared to a variable time base. While the BS2 does not have a real time clock, an adjustable·pulse from a 555 timer would do fine and would lighten the load on the BS2.
What will take place is as follows:·Lets say for example, I am monitoring the speed of a treadmill and it is perfectly fine to raise the speed within moderation. The·"frequency" input vs. the "time base" input would allow for acceptable operation. However, if someone were to crank the speed knob ·faster than deemed acceptable, an output would shut down the treadmill. To determine the acceptable speed increase, the pot on the 555 timer would be adjusted inorder to increase of decrease the number of pulses (time base).
How well could the BS2 handle this situation???
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office
Hadn't given the count function a thought, I will need to look into this. I have never had an application for the count function and am unfamiliar with it. I am about 6 months into the Basic Stamp learning world.
Since this project has many variables, one day I may need to detect a 1000hz rise in less than 1 second but the next day 1000hz rise in·2 seconds may be acceptable. The count function will allow a potentiometer based adjustment for this?
· COUNT pin, 1000, freq
This takes a lot of time though. Another approach is to use a shorter window and a multiplier:
· COUNT pin, 250, freq
· freq = freq * 4
On last thought -- you can use PULSIN to measure each half-cycle of your input stream, the calculate the frequency from that. Lots of options....
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office
If so I would make the pot a different input and read it with RCTIME and let the Stamp do the decision making.
Terry
Thanks guys!