Resistors needed between pins and 595s/165s?
Nightrider7731
Posts: 46
Are resistors needed between the stamp pins and either 595s or 165s?· I have them on the inputs/outputs from the ICs but I was wondering if there was any generally accepted rule to protect the pins.· If so, how large/small?
Thanks!
Thanks!
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
Thanks
·· There are two situations when resistors should/may be used:· 1) When connecting current higher current drawing devices, such as LEDs.· 2)·When using a pin as both an input and output.· In this case the resistor provides some protection in the event both the Stamp pin and the device pin are both set as outputs.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
And as has been stated, the amount of switching current is TRIVIAL compared to the amount of current an LED uses.
Conclusion: figure out what it is, make sure you're not going over it, then rest easy knowing you are covered. You definitely don't need to add a resistor to limit the current to uAmps, and you'd probably damage the functionality if you did. Adding a 220 ohm resistor is only useful if you are being careful.
Thanks!
If you are running at 9600 baud, it may work without further circuitry. If you want to be safe and conservative, you would put a MAX232 with 4 capacitors in with the BS2 to recieve and send proper RS-232 signal levels -- which would travel that distance no problem.
This brings up the question -- that Control Box, is it off the shelf or are you building one yourself? And what in the Control Box is making the signal serial?
In essence,·termination requirements are a function of conductor length and the operating frequency and a couple other things such as discontinuities and slew rate, the higher the frequency and the longer the conductor the more·termination becomes an issue,·as allan says, for the length your·talking about·operating 9600 baud should be ok, if your trying to do it at 138K it would be wise to add a 10-15 ohm series resistor.
I wouldnt worry about it in the initial design phase, while your still prototyping just keep this potential hazard in mind if you experience problems.·Other issues when dealing with multiple signal lines so close together is crosstalk and skewing between transmission times of parallelly operated signal lines, again these are mainly a function of the signals operating frequency. If you find things aren't working, try slowing the transmission speed, if it then works properly, it is likely one of these issues.
Post Edited (Paul Baker) : 3/21/2005 7:27:32 PM GMT
Note the BS2 I/O pins can source or sink 25 mA each -- which is basically what a 'high-current' driver sources and sinks. The length of the cable adds capacitance to the signal, which will slow the rise and fall times of your signals -- which if the signal comes from a key-press, that will be slow anyway. And you should de-bounce switch contacts, which means slower rise-times is actually better. I highly recommend a capacitive switch-debounce in the control box suggested elsewhere on this forum.
You will definitely need shielded cable, and the shield should probably be connected to the BS2 box's ground. 15' of wire could pick up a lot of noise otherwise. And for safety you should probably put 220 resistors in series, close to the BS2's pins. This will protect the BS2 from any inadvertent shorts circuits.
P.S. the '595 has drivers as good as the BS2.
·
And yes, I've allowed for the gnd and src.
Thanks!
So, you want to have a control box, with '165's in it to read the switch presses. You then intend to allow the BS2 to use a 'SHIFTIN' to clock the '165 data down the cable -- which IS serial then, my apologies, except it is synchronous serial, with a 16 uSec pulse used to clock the data. 16 uSec is an awfully short pulse to send at 5-volt signaling down a wire, especially when you intend to use it to 'clock' data out of a shift register at the far end and then read the data when it gets back.
And I expect you want to have a '595 in the box to do digital outputs for some other purpose -- LED's probably.
If you had a 16 uS high pulse, then 16 uS of 'silence', that would be a 32 uS square wave. That would be a 31,250 Hz wave. The BS2 actually puts 48 uS of 'silence' behind the pulse, but I'm going for worst case here. I'm going to conclude that it MIGHT work, but you are pushing your luck.
One quick fix would be to put those MAX232's in on both ends. One chip each side, 4 caps each side, and you should be good to 50'. You'll need to drive the clock outbound, and drive the data back inbound. And each MAX232 has two drivers and two recievers, so you'll have one clock and data pair to read your buttons, and a separate clock and data pair to write your '595s. Add a ground reference wire, and probably some Vdd wire to power your 'control box' circuits, and you are good to go. Thus you can have a 6-conductor cable do the whole job. I'd still like a shield, if it was me.
And a Max232 is good to 115 KBaud (8.7 uS per bit) so that should work fine.
RoboGeek
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There are 10 kinds of people in the world,
those that know binary and those that don't.
Formerly bugg.
www.parallax.com
www.goldmine-elec.com
www.expresspcb.com
www.startrek.com
·
Ill stop calling you by your old name if it bugs you (all puns intended :P)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·1+1=10
- Paul
·[noparse][[/noparse]EDIT] I think I just confirmed what Chris said way back on 3/21. I didn't catch it the first time through. It was·a bear·to troubleshoot though!
Post Edited (Paul) : 11/9/2005 2:38:01 AM GMT