I have a Dallas 1-wire weather station and the circuits are breaking down (it's 15 years old) I was thinking if I just bypassed the 1-wire chips and hooked the eight reed switches to something like this I could get the position out without tying up 8 pins on the micro.
Chris, that's what I was thinking of but it doesn't work the way I had thought it did. I guess I will go with a 2p40 stamp and use the extra pins. Thanks anyway.
This chip has three selector pins, A, B, and C. These are the pins your processor is placing the input pin's value on.
It has eight input pins that the user connects to the levels he wants to look at. Use the chart to see the relationship:
Input value___Bits 0,1,2__Input No.
__0_____________0,0,0_____1
__1_____________0,0,1_____2
__2_____________0,1,0_____3
__3_____________0,1,1_____4
__4_____________1,0,0_____5
until we reach
__7_____________1,1,1_____8
Bits 0,1,2 are the the three processor pins to the A, B, and C pins on the '151. The eight switches go to inputs D0 thru D7 of the '151. The G pin just gets connected to ground, unless you want to tristate the output. The Y pin is the true output; the W pin is the inverted output. Take the appropriate output and feed it into a fourth processor pin.
Why can't you juust use a parallel to serial shift register (8->2) and read the status of the 8 switches with SHIFTIN? Data_In, Clock and Ground are your three connections, thus you only need to use 2 Stamp pin ports.
It occurs to me that the list of TTL chips I found with a brief description of the chip's function might be a good thing to have: rabbit.eng.miami.edu/info/datasheets/
This is by no means an exhaustive list of all possible TTL ICs.
Enjoy!
kenjj
Thanks everyone, Bruce, you asked "why can't you...." the answer is I can (and probably will) but I didn't think of it until you mentioned it. The 151 chip works on one input at a time and this vane may have two switches closed at once so I don't think that will work. The shift register looks like it will work just fine for the job I have.
Thanks again.
Comments
or, maybe you want a priority encoder.
whats the application?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tom Sisk
http://www.siskconsult.com
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
Franklin, the 74LS151 does what you want. The data sheet is at:
rabbit.eng.miami.edu/info/datasheets/74LS151.pdf
This chip has three selector pins, A, B, and C. These are the pins your processor is placing the input pin's value on.
It has eight input pins that the user connects to the levels he wants to look at. Use the chart to see the relationship:
Input value___Bits 0,1,2__Input No.
__0_____________0,0,0_____1
__1_____________0,0,1_____2
__2_____________0,1,0_____3
__3_____________0,1,1_____4
__4_____________1,0,0_____5
until we reach
__7_____________1,1,1_____8
Bits 0,1,2 are the the three processor pins to the A, B, and C pins on the '151. The eight switches go to inputs D0 thru D7 of the '151. The G pin just gets connected to ground, unless you want to tristate the output. The Y pin is the true output; the W pin is the inverted output. Take the appropriate output and feed it into a fourth processor pin.
And that should do it. 'Luck!
kenjj
Why can't you juust use a parallel to serial shift register (8->2) and read the status of the 8 switches with SHIFTIN? Data_In, Clock and Ground are your three connections, thus you only need to use 2 Stamp pin ports.
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
You're right! Never trust a memory over 30 years old!
Thanks for the correction.
Tom
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tom Sisk
http://www.siskconsult.com
·
74_151 -- 8-input multiplexer
It's like a one-way "8PST" switch, one of the eight input signals is switched through to the Output by the select bits (%000 - %111).
See attached dwg.
(74HC, HCT, LS, etc.)
The '151 will switch digital signals (0,5V).·
If you wanted to switch from/between analog signals, then something like the 4066 (CD4066 et al.) would be more appropriate.
rabbit.eng.miami.edu/info/datasheets/
This is by no means an exhaustive list of all possible TTL ICs.
Enjoy!
kenjj
Thanks again.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen