Crazy Question about ports
MovieMaker
Posts: 502
Do you think you could separate each BIT of an input and TEST it for a 1 or 0.· Doing it this way, you could have 8 inputs on the same pin and just mask them or something.· I am trying to figure a way to put more ports on the BS.· Like I said . . . crazy question.
:-)
:-)
Comments
You have two choices at this juncture if what you say is true. I say that because it's sometimes possible to double-up on I/O pin port usage. We'd have to know what was going on those ports to determine whether or not that's possible.
The other two solutions are a larger Stamp (BS2p40) with 16 more pin ports or using shift registers. Each shift register chip can fetch the input status of 8 lines (devices) connected to it, or set the output status of 8 lines (devices) connected to it. Additionally shift registers can be cascaded for multiple of 8 devices, but all of those in a cascade must be either input or output, no mixing of the two.
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When all else fails, try inserting a new battery.
I appreciate your suggestions. Amaral, sorry I wasn't clear on this.
The BS2px(24) still has only 16 I/O ports, it's just faster than the other BS2's. You MUST get the BS2p40 if you want 32 I/O ports. This Stamp has 2 banks of 16 I/O ports each. One bank of 16 I/O ports is known (in PBASIC) as MAINIO and the other bank is known as AUXIO, although they are otherwise both the same.
Needless to say, the BS2p40 has twice as many physical pins (32) assigned to I/O ports than the other 16 pin port Stamps. Here is a handy document to keep on hand when you want to determine which Stamp might best suit your needs. It's the Stamp Technical Comparison PDF (6th download from the top):
http://www.parallax.com/tabid/440/Default.aspx
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When all else fails, try inserting a new battery.
And , Mike, I was just trying to humble myself because I have a deep desire to learn, but have no formal education. I was once extremely creative, but life 101 got in the way and I would like to get back to the point were I can tap into the creativity that I had as a teenager. I haven't really seen much of it lately.
I is nice to have you gentlemen share your info with me. One day I hope to have that "AH-Hah!" Moment.
Post Edited (MovieMaker) : 10/7/2008 11:33:11 PM GMT
A common shift register is the 74HC595, which lets you set the states of 8 pins on the IC using only 3 pins from the Stamp. The nice thing about shift registers is that you can a) "cascade" them so that each extra IC (i.e. another extra 8 pins) only takes 1 more pin on the Stamp (after the first 3). So you could have 4 shift registers (another 32 output pins) using only 6 pins on the Stamp to control them; and b) the pins on the shift registers will stay wherever you put them until you change them again.
They are easy to use and wire up and control with the SHIFTIN and SHIFTOUT commands (see the Stamp Pbasic Manual for examples).
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
God Bless!
Look through the Nuts and Volts Columns. There are several on expanding a Stamp's I/O using various I/O Expanders including the 74HC595 and 74HC165. Go to the main Parallax web page and click on Resources. One of the items in the list that shows up is Nuts and Volts Columns, select that and go through the index. You can also download the StampWorks Manual. Under Resources, select Downloads, then Stamps in Class Downloads.