Utilizing for I/O to a computer?
jrsteensen
Posts: 3
Hey there. Im brand new to BASIC Stamps, I was curious if it were possible to utilize them for I/O to a computer easily via USB? I want to use it to interface toggle switches to send keystrokes on a computer and have bits spit back from a shared memory file to light up LEDs, move servos for gauges, and possibly 7 segment LED displays, and interface with rotary encoders? Possible?
Thanks.
Thanks.
Comments
You could certainly use some fairly cheap controllers to connect some of the switches to some of the LEDs and some of the pots to some of the LCDs and so on. It'll be quite a bit more complicated if all of the inputs have to be available to all of the outputs. 200 inputs is a hell of a lot, and you're going to be seriously taxing available memory too.
You have alot going on for a single BS2. You first have to see how much I/O you will need to control all of this stuff considering that a BS2px (fastest version) is only going to provide 16 I/O lines. Have you considered the Parallax SX28 or SX48 (proto board)? They are not too far off of the BS2 with much more horse power and very similar in BASIC style programming that the BS2 uses. Myself and others can help with that on this forum. The SX48 would provide double the ram and space as the SX28 and also 36 I/O lines but it's surface mount so the proto board is a good option for $10. The SX28 is DIP style like the BS2 and has 20 I/O lines compared to the BS2's much slower processing power with 16 I/O lines.
You should consider using cascaded 74HC595 ICs·for the LED outputs. Since you have 100 LED outputs and the 74HC595 ICs have 8 outputs, you will need 100/8 = ·13. This will use up only 3 I/O lines on the BS2 or SX chip.
You should consider using cascaded 74HC165 ICs for the LED inputs. Since you have 200 toggle switches and the 74HC165 ICs have 8 inputs, you will need 200/8 = 25. This will use up only 1 I/O line on the BS2 or SX chip as normally you will use 3, but Latch and Clock lines can be tied into the 74HC595 Latch and Clock lines (with a 10K pull down resistor on the Latch).
So now you are using only (4) I/O lines (Latch, Clock, Data595 and Data165) on a BS2 or SX chip to control over 100 LED outputs and 200 toggle switch inputs as well as (13) 74HC595 and (25) 74HC165 ICs.
The 2 Text LCD's can be serial as well·only only use 2 more I/O lines. The Graphical LCDs I'm not sure about them so if they are serial based, then perhaps only 2 more I/O lines are to be used.
Now you have 8 I/O lines being used total.
OK - I have not used the POTs and Rotary Encoders but it may still be possible to do it all with a BS2·or SX chip if you are creative in your design.
However, you have so much stuff·going on - you should probably consider the SX chip for speed and interrupt capability (as needed).
This will give you a scalable solution. Add '595's to drive LED's, build a 'small' system with two boards, one master one slave. Then you can add slave boards as needed.
a "cheap" solution.
Adrian