PDA

View Full Version : Crazy Question about ports



MovieMaker
10-06-2008, 07:50 PM
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.

:-)

Bruce Bates
10-06-2008, 08:07 PM
MovieMaker -

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.

Amaral
10-07-2008, 05:29 AM
I don't get your question .. are you trying to reinvent a serial port ?

Mike Green
10-07-2008, 05:48 AM
Look through the Nuts and Volts Columns for a column using RCTIME and different resistor values with a capacitor to specify which switch out of several is closed.

MovieMaker
10-07-2008, 08:54 AM
Thank You gentlemen for your suggestions. My new BS2px24 is on the way. Remember, I am not an engineer, only a technician.



I appreciate your suggestions. Amaral, sorry I wasn't clear on this.



http://forums.parallax.com/images/smilies/tongue.gif

Mike Green
10-07-2008, 11:07 AM
Frankly, the labels "engineer" and "technician" are not very useful except from an HR standpoint. I've known people whose formal training was described as "technician" who were extraordinarily knowledgable and creative and some who were not at all creative and could regurgitate what they had been fed in the past, but not synthesize anything new. I've known people whose formal training was described as "engineer" who fitted the same range of description. It all depends on what you now know, what you're willing to learn, your native intelligence and creativity, and how hard you're willing to work.

Bruce Bates
10-07-2008, 12:25 PM
MovieMaker -

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.

MovieMaker
10-08-2008, 06:26 AM
Mr. Bates, I skipped over (don't know how) the Shift Register part of things. That sounded interesting. Is this only available in the 40. I have now on the way a 20. ( the BS2px24 to be exact) or is this something I can add (a special chip)? I should be getting a Board of Education. I ordered the USB one, but they were out of stock, so I went ahead and got the SERIAL Board of Education with the USB adapter. Same difference, I think. I wanted the IRbuddy but they told me they discontinued that.

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.

http://forums.parallax.com/images/smilies/smile.gif

Post Edited (MovieMaker) : 10/7/2008 11:33:11 PM GMT

Zoot
10-08-2008, 06:44 AM
"Shift Registers" are not built-in to Stamps (or any other microcontroller, for that matter) -- they are an external IC that lets you set a larger number of pins on that external IC to high or low, using fewer pins from the "master", or your Stamp.

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 (http://1uffakind.com/robots/povBitMapBuilder.php)
1uffakind.com/robots/resistorLadder.php (http://1uffakind.com/robots/resistorLadder.php)

MovieMaker
10-08-2008, 06:47 AM
Thank You, Zoot! that is what I wanted to hear. I have ordered two 74HC595 s to go with my bs2. OK, Now I see where I would use the SHIFTIN, SHIFTOUT. I really did not understand that earlier. This was EXACTLY the info that I was looking for.

God Bless!

http://forums.parallax.com/images/smilies/smile.gif

Lab Rat
10-08-2008, 08:12 AM
ok i sort of understand what i am read but could you expand on it for me. do you have some files or programs that demonstrate this. also could you explain to me what the two attached files are and how to use them

Zoot said...
"Shift Registers" are not built-in to Stamps (or any other microcontroller, for that matter) -- they are an external IC that lets you set a larger number of pins on that external IC to high or low, using fewer pins from the "master", or your Stamp.

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).

Lab Rat
10-08-2008, 08:26 AM
the label only decides what you get paid i will have the technician label in about 8 months. i am currently in a technical school to become an Electro-Mechanical technician. i currently am working with the board of education which is running the bs2 i just finished putting together an LED matrix which is 7 x 10 LEDs i now have to spend the many hours to program it (joy joy) also one of the reasons i have procatinated doing the project to begin with. i am doing the project as my graduation project and i am using an 8 bit shift register as an output not only to reduce pins but to increase the speed (or so i would like to think) the IC i am using is 74LS164 i see how to use it as an out put but how do i use it as an input and please include many details (I may be a "Jenious" bt i hate research so if any one knows what they are doing or has digital resources please email them to me ThisTwoJamie72@aol.com (mailto:ThisTwoJamie72@aol.com) thanks

Mike Green said...
Frankly, the labels "engineer" and "technician" are not very useful except from an HR standpoint. I've known people whose formal training was described as "technician" who were extraordinarily knowledgable and creative and some who were not at all creative and could regurgitate what they had been fed in the past, but not synthesize anything new. I've known people whose formal training was described as "engineer" who fitted the same range of description. It all depends on what you now know, what you're willing to learn, your native intelligence and creativity, and how hard you're willing to work.

Mike Green
10-08-2008, 10:40 AM
Lab Rat,
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.

Lab Rat
10-08-2008, 05:27 PM
ok thanks. i have the paper copy of the whats a microcontroller manual