COMPARE Function on BS2Px
Smoke Liberation Front
Posts: 30
Good morning!
I am wondering how the COMPARE function compares vaoltages. Does it have (3) states? ( A higher than B, B higher than A and A=B) More importantly (because the Stamp is a digital device), can the Stamp only compare voltages that are 0 or 5 volts? Or can I, say, have the voltages be 2.7V and 4.2V and compare them (without the Stamp going wonky because of being in a digitally indeterminant state).
I have a circuit that looks at a sensor reading (voltage) and compares it to a set point (manually controlled; the other voltage). The comparator circuit is fairly robust, but I am interested in having the mu-C be the comparator so that we can change things as needed.
Thanks for any help!
Smokey
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Freeing smoke from wire and IC captivity since 1972
I am wondering how the COMPARE function compares vaoltages. Does it have (3) states? ( A higher than B, B higher than A and A=B) More importantly (because the Stamp is a digital device), can the Stamp only compare voltages that are 0 or 5 volts? Or can I, say, have the voltages be 2.7V and 4.2V and compare them (without the Stamp going wonky because of being in a digitally indeterminant state).
I have a circuit that looks at a sensor reading (voltage) and compares it to a set point (manually controlled; the other voltage). The comparator circuit is fairly robust, but I am interested in having the mu-C be the comparator so that we can change things as needed.
Thanks for any help!
Smokey
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Freeing smoke from wire and IC captivity since 1972
Comments
·· The comparator is analog and can handle analog voltages within the input range of the I/O pins.· The best source of technical data on this function would be the SX datasheet located at the following link.· Take care.
http://www.parallax.com/dl/docs/prod/datast/SX48BD-Data-v1.1.pdf
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
Like any comparator, it has two states at the output, either p1>p2 or p1<p2, and if p1=p2 or close to it, you will see noise in the output and in the result variable. Just as with any comparator, you can add a bit of positive feedback to create hysteresis.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
Until the next time I free smoke from their bonds... I appreciate the help.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Freeing smoke from wire and IC captivity since 1972