Shop OBEX P1 Docs P2 Docs Learn Events
Resistors needed between pins and 595s/165s? — Parallax Forums

Resistors needed between pins and 595s/165s?

Nightrider7731Nightrider7731 Posts: 46
edited 2005-11-09 02:14 in BASIC Stamp
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!

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-03-18 23:20
    ·· Normally for protection, you could use from 220 ohms to 1K.· They are not required on those 2 chips though.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage

    Parallax Tech Support
    csavage@parallax.com
  • Nightrider7731Nightrider7731 Posts: 46
    edited 2005-03-21 16:40
    Thanks for the reply.· I've been trying to learn to read datasheets and find out what is the lowest amount of current @5V required to trigger either the Fairchild 595 or 165.· I'm going to utilizing every pin on my BS2, so I want to make sure I don't over source or sink my stamp.· Am I reading the datasheet incorrectly when I see the max input current is 1 uA?

    Thanks
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-03-21 17:39
    ·· Typically when connecting TTL/CMOS devices to the·pins of the stamp, you don't have to worry too much about current, unless you have many devices sharing the same pins (It would be a lot).

    ·· 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
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-03-21 18:18
    There is a third which doesn't apply to stamps and that is reflection reduction in high speed transmission lines due to impedance mismatch, but this obviously isn't an issue for stamps so its omission is probably wise to prevent someone for mistakingly thinking they need one. The only realm in which this would apply is the interfacing with long cables such as a serial or USB cable.
  • allanlane5allanlane5 Posts: 3,815
    edited 2005-03-21 18:36
    Yes, and please don't try to figure out the lowest amount of current to trigger the '165 or '595 and put in resistance to do that. There is an amount of 'switching current' needed which is higher than the 'steady state' current. And the '165 or '595 being TTL devices regulate that themselves. The only reason you MIGHT want to put in a 220 ohm resistor is if you think a '165 or '595 might fail disasterously on you -- the 220 will then protect the BS2 pin.

    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.
  • Nightrider7731Nightrider7731 Posts: 46
    edited 2005-03-21 18:38
    I'll be using a 15' serial cable from a control box back to the stamp box to control about 13 of the pins.· Will I run into an impedance mismatch·issue?

    Thanks!
  • allanlane5allanlane5 Posts: 3,815
    edited 2005-03-21 19:07
    If you are running a serial cable from a control box to the Stamp box, I assume that serial cable will use TX and RX and GND, so it will have three conductors at least.

    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?
  • Nightrider7731Nightrider7731 Posts: 46
    edited 2005-03-21 19:16
    I using the serial cable for nothing more than a nice package of bundled wires that I can connect and disconnect for storage.· There is no serial communication going on.· It is nothing more than a glorified extension cord for 13 pins.
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-03-21 19:19
    This may be overload to your brain but heres a site that explains quite a bit: http://www.interfacebus.com/Design_Termination.html

    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
  • allanlane5allanlane5 Posts: 3,815
    edited 2005-03-21 19:31
    If it is a cable with 13 conductors (Plus ground, DO NOT forget the ground wire, and hopefully a 'VDD' source wire) then it is NOT a "serial" cable at all, it is a "parallel" cable. I believe printers have used parallel cables of up to 25 feet for years without problems -- and I've run very well shielded parallel cables 50 feet.

    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.
    ·
  • Nightrider7731Nightrider7731 Posts: 46
    edited 2005-03-21 19:44
    I·am planning on·using a 595·and a 165 in my home made control box ~15' from the stamp.· Should I expect any issues with these TTLs at that distance (other than shielding)?· Or should I put them closer to the BS2 and have a long run from the TTLs to their sources?

    And yes, I've allowed for the gnd and src.

    Thanks!
  • allanlane5allanlane5 Posts: 3,815
    edited 2005-03-21 20:06
    Aha, I think I understand your design.

    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.
  • Nightrider7731Nightrider7731 Posts: 46
    edited 2005-03-21 20:16
    Thanks for the ideas.· Since the cable will be swappable at will, I like the idea of building it to support a future longer length.
  • allanlane5allanlane5 Posts: 3,815
    edited 2005-03-21 20:25
    One additional thought: If you use 485 drivers, you'll be good to 4,000 feet. Of course, you'll then have to use an 'A' and 'B' wire for each signal, so you are back up to a 12 conductor cable. Sigh.
  • Nightrider7731Nightrider7731 Posts: 46
    edited 2005-03-21 20:50
    What if I need 5,000 feet? tongue.gif
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-03-21 21:03
    fiber optics baby!
  • Nightrider7731Nightrider7731 Posts: 46
    edited 2005-03-21 22:05
    Mmmmmmmmmmmmmmm, fibre! burger.gif
  • MacGeek117MacGeek117 Posts: 747
    edited 2005-11-08 02:19
    I guess we had our Wheaties this morning!
    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
    ·
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-11-08 15:00
    Bugg, you particularly bored yesterday? Pretty old thread to dredge up [noparse]:)[/noparse]

    Ill stop calling you by your old name if it bugs you (all puns intended :P)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·1+1=10
  • PaulPaul Posts: 263
    edited 2005-11-09 02:14
    I found this interesting (after all these months) because you actually·_DO_ need·a resistor in a particular case. You will need a small (220 ohm) resistor _IF_ you are using both the '165 and the '595 on the BS2 and they share data lines. I had to add the resistor to the Data line because the '165 was outputing data at the same time the Stamp was sending to the '595. This caused one to be outputing a High and the other a Low. Oddly enough this didn't show up on the original BS2p-24 but tore up the data transfers when I switched to the slower BS2. (cost savings) I'm assuming this happened·because of the speed (clock) difference.

    - 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
Sign In or Register to comment.