Shift register suggestions
ke4pjw
Posts: 1,173
Hey folks,
I am working on a project that needs to read a set of dip switches. I am running low on available pins on the propeller and am looking at using a PISO shift register. I was thinking of going with the CD4014BE. It appears to be widely available but is of the 5 volt variety. Is this a good choice, or is there something better suited?
Regards,
Terry
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
-- Terry
I am working on a project that needs to read a set of dip switches. I am running low on available pins on the propeller and am looking at using a PISO shift register. I was thinking of going with the CD4014BE. It appears to be widely available but is of the 5 volt variety. Is this a good choice, or is there something better suited?
Regards,
Terry
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
-- Terry
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Leon Heller
Amateur radio callsign: G1HSM
Robert
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Leon Heller
Amateur radio callsign: G1HSM
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Timothy D. Swieter, E.I.
www.brilldea.com - Prop Blade, LED Painter, RGB LEDs, 3.0" LCD Composite video display, eProto for SunSPOT
www.tdswieter.com
Are only one switch on at at any time?
Some type of Multiplexing/charlieplixing could also work.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
-- Terry
You know that DIP switches need access ports in the enclosure, they take up room and I/O. Unless they are things that need to be configured "in the field" by almost anyone, I favor the USB serial to laptop approach or if the unit has a display then use that with 3 to 4 buttons maybe. Anything but DIP switches.
So I2C bus expanders are a solution to your requirement but changing the requirement may be the solution.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
*Peter*
[noparse][[/noparse]Edit] I just noticed that you have 16 inputs; I only have eight inputs to check. You can easily expand this to 16-bits and daisy-chain the x165s to read them all with one method call and the same three pins.
The shift/load and clock pins are common to both chips. The downstream 165's DO pin (9) connects to the upstream 165's SERIAL IN pin (10). The upstream 165 DO pin connects to the Propeller.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon McPhalen
Hollywood, CA
Post Edited (JonnyMac) : 2/23/2010 7:30:10 PM GMT
obex.parallax.com/objects/381/
- they are $0.78 each in a DIP16. You can cascade them for days.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Signature space for rent!
Send $1 to CannibalRobotics.com.
What's the difference/pros/cons with 74HC597 ?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Leon Heller
Amateur radio callsign: G1HSM
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon McPhalen
Hollywood, CA
Pin 9 - 1 ' Set to PISO
Pin 10 - 1 ' Populate registers with parallel data
Pin 10 - 0 '
Repeat 8 times
{
Pin 10 - 1 ' Shift data from LSB to Pin 3
Pin 10 - 0 '
Read bit from Pin 3
}
Is there something wrong with my understand of this?
Thanks in advance for your help!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
-- Terry
Cascade Q8 from the previous stage into SERIAL INPUT etc.
So change your clock from high/low to low/high to guarantee an edge and also remember to read the data before clocking for the next one as P8 appears at Q8 straight after parallel load.
BTW, take note of taking pin 9 low to change to serial mode.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
*Peter*
Post Edited (Peter Jakacki) : 2/27/2010 5:05:08 AM GMT
I am pulling my hair out [noparse]:)[/noparse] I *MUST* be something stupid that I can't see. I have checked the wiring again and again.
Thanks guys!
--Terry
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
-- Terry
If you comment your code as to what it is doing you will see it doesn't conform to the description I gave. Look at these simple steps
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
*Peter*
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
-- Terry
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Leon Heller
Amateur radio callsign: G1HSM