Shop OBEX P1 Docs P2 Docs Learn Events
74HC595 shift register connection to prop — Parallax Forums

74HC595 shift register connection to prop

edlikestoboogieedlikestoboogie Posts: 71
edited 2010-05-11 03:20 in Propeller 1
Is it okay to connect the input pins of the 74HC595 directly to the prop? without the use of current limiting resistors in between the two? My shift register is switching some mosfets to control motors, I was suggested to use a 100uF and 0.1uF decoupling caps on the shift register, is the 100uF cap good to use in this application?

Comments

  • kwinnkwinn Posts: 8,697
    edited 2010-05-06 11:41
    If the 74HC595 is running from 3.3V you can connect it directly, otherwise you need the resistors ( 2K to 4K7 ). A 0.1uF cap near the shift register is a good idea, and the 100uF would be needed if the power supply is any distance from the shift register. If the power supply is close by the 100uF is not really needed.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2010-05-06 11:43
    Yes that should be fine. If you are driving mosfets I presume the HC595 is using a 5V supply. Propeller at 3V to HC595 at 5V is ok without the resistors because the data is only going one way. The HC595 will register 3V as a 'High'.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.smarthome.viviti.com/propeller
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2010-05-06 11:44
    Since the Prop's outputs are 3.3V and the 595 is the same or 5V there is no need for current limit resistors. You only normally need this if you are feeding a higher voltage into a logic input that is powered off a lower voltage supply.

    By decoupling caps I assume you mean the supply lines and 0.1uF is standard practice for all logic devices. I don't know about the 100uF as I can't see that being necessary or making much of a difference. Try a 10uf or so tantalum as that would prove more useful. The 0.1uF should always be as close to the devices supply and ground pins as possible.

    Now you mentioned the HC595 but remember if you are running the shift registers from +5V then the minimum logic high threshold of these HC devices is 0.7VCC which is higher than the Prop's outputs. These means the HC595 is not guaranteed to see the Prop's 3.3V as a logic high, it might but it's borderline. If this is the case just substitute a 74HCT595 where the T means this is a TTL logic level compatible HC device so any voltage above 2V in will be recognized as a logic high.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    *Peter*
  • DavidMDavidM Posts: 630
    edited 2010-05-07 01:43
    Hi Pete,

    It's interesting that you say that running the 74HC595 at 5V , the props outputs 3.3V will not be high enough for the logic input for the shift register.

    I have made plenty of boards that use the 74HC595 and in the circuit I run the 74HC595 at 5V ( 4 of them cascaded driving 32 leds ) and I have the prop inputs ( even with a 1K series resistor in line for the 4 signal line) and I have no problems.

    But I read the spec sheet again and as you say, the hi level logic inputs are

    2.0v min 1.5 ( 0.75 of VDD )
    4.5v min 3.15 ( 0.70 of VDD )
    6.0v min 4.2 ( 0.70 of VDD )

    So running the 74HC595 shift register at 5V for VDD means the logic input minimum should be 3.5V! according to the spec sheet my circuit should not be working!

    So why does my circuit work?

    thanks

    Dave M
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2010-05-07 02:12
    Yes, Peter is on to something there. HC specs as he says should have a threshold of 3.5V. HCT has a high threshold of 2V (supply for HCT is 4.5 to 5.5V). Yet I've used both with no problems. I wonder if I should specify HCT for the 5V parts on the dracblade?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.smarthome.viviti.com/propeller
  • DavidMDavidM Posts: 630
    edited 2010-05-07 02:23
    HI Dr_Acula,

    I will in my next designs use the 74HCT595 instead of the 74HC595 as the specification is better suited., But yes the HC version does work?, Maybe Pete can enlighten us as to why it does when it shouldn't!


    Regards

    Dave M
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2010-05-07 02:57
    When you read a datasheet and it says Vih(min) then that means that this is the figure that the manufacturer will guarantee that the device will operate at over manufacturing variations, temperature extremes, and aging (IC's do age) etc. On the bench for prototypes I get away with many sins but I am never so game to do so when the device ends up in some far away location as an integral part of some expensive or safety critical system. I want to be able to sleep well.

    For some reason too there seems to be a school of thought that says "put current limit resistors on everything". Ok, no harm done but running outputs from the Prop to any logic input is not a current limit situation ever, so the resistors are redundant altogether. If outputs are coming from a logic device that is running from 5V and INTO the Prop then yes, you would definitely use "current limit" resistors as current will certainly be flowing when the input of the Prop is at a higher voltage then the Prop's supply.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    *Peter*
  • chorabakubchorabakub Posts: 1
    edited 2010-05-08 03:49
    Its really a good article. This site is so helpful. I want to know some other information about this post. So please give some other information about this side.Thanks

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jaguar XK8 Parts
  • Cluso99Cluso99 Posts: 18,069
    edited 2010-05-08 09:52
    Peter is correct if the 74HCxxx parts are using 5V power and are inputs from the prop. Too many designers use designs that are just bench tested without understanding the real design issues. Then they wonder why a circuit fails in the field. A hobby project can often get away with a design defect, but a commercial solution must be correct.

    Drac, look at the 74LVCxx parts as well. It depends on whether you are requiring the parts to run on 5V supply to drive other 5V logic.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
    · Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
    · Prop Tools under Development or Completed (Index)
    · Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)·
    · Prop OS: SphinxOS·, PropDos , PropCmd··· Search the Propeller forums·(uses advanced Google search)
    My cruising website is: ·www.bluemagic.biz·· MultiBlade Props: www.cluso.bluemagic.biz
  • SpectremanSpectreman Posts: 2
    edited 2010-05-08 20:40
    If you are not sure the 5V supply to the 74HC595 is always there when you drive the input high, you should add a series resistor to limit the input current. Cmos circuits are ESD sensitive and often have a protection diode from the input to the positive and negative supplies to clamp any large input voltages. So without a 5V supply, you will try to supply that voltage from the propeller chip output via the protection diode, which isn't a good idea. In many cases the output are short circuit proof, but not always.

    If the input stage to the 74HC595 is designed to be electrically symmetric, it will normally switch at 0.5xVdd, so it will often work with a 3.3V signal driving it. But as has been pointed out, the trip point can depend on temperature, supply voltage, age and also process variation during production and I agree that you should always make sure you meet the specified input levels or it may fail later on.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2010-05-09 12:33
    There are two figures to consider, they are:
    1. Vil(max) or the highest voltage that can be recognized as a low
    2. Vih(min) (or the lowest voltage that can be recognized as a high

    If you input a voltage at Vil(max) or lower it will be seen as a logic low.
    If you input a voltage at Vih(min) or higher it will be seen as a logic high.

    Now anything in between these voltage are not only sitting in the "noise margin" but they have another more serious consequence. If you are familiar with CMOS logic and how it is constructed you will know that the input stage is actually a P-channel MOSFET and a N-channel MOSFET connected in a complementary configuration (that's the C in CMOS). As their gates are connected together to the input the idea is that only one would be turned on while the other is off, so when the input goes to ground the output of the gate goes high and also if the input is connected to the supply then the output goes low.

    What about if the inputs aren't quite ground (VSS) or supply (VDD)? They will still work within the margins mentioned earlier but there are limitations obviously. Now however what happens when the input is in the noise band? Well, they can cease to act as a digital ON/OFF device as they are both partly on and partly off, that is not what a logic gate should ever do. What happens is current flows (conventional) from the supply through the P and through the N to ground. This shouldn't happen and might or might not be harmful but will certainly at the very least increase the current drain of the device. That is why you never have inputs floating because this can happen, you either pull them up or down.

    There have been some situations where I have had to make do with 74HC devices operating off +5V and driven by the Propeller at 3.3V. I can definitely say that it doesn't always work even on the bench. I usually kludge this to get around it and put a diode in the +5V supply to the logic so they are running at around 4.4V or so, and then Vih(min) is under 3.3V and they work fine.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    *Peter*
  • kwinnkwinn Posts: 8,697
    edited 2010-05-09 14:09
    Re: "there is no need for current limiting resistors"

    True, there is no need for the resistors when the output from the prop is driving an input pin on a '595 under normal circumstances. I always include them unless switching speed requirements precludes doing so to make the circuit as rugged and forgiving as possible.

    If the '595 were to fail and present a short to ground or Vcc that prop output would be damaged without a current limiting resistor. Another consideration is during troubleshooting. If you should short a '595 output pin to the input pin with a scope or meter probe would have the same result.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2010-05-09 14:22
    Kwinn, this type of thinking is called over-engineering. For one thing, most CMOS outputs will not go into meltdown when they are shorted and it has been proven even on the forum that the Propeller can handled sustained shorting of the outputs. I agree with one of the previous statements which would be a very specific situation where the 74HC would be external to the Prop and run off a different power-supply. For those situations where this could happen I might put in current limit resistors.

    However, if the 74HC is on the same board or system and especially if it is run from the same supplies then it would be redundant and it would be over-engineering to put current limit resistors on the Prop. Lightning could strike it too, a meteorite could hit it, what do we do? This is risk assessment which looks at the outcome as well, is it a problem? No, then don't worry about it. Every extra component you end up putting on a board is another potential source of a problem and increases the probability of a failure. I keep my designs clean and simple calculating the design parameters and realistic sources of problems. So it's not underdone, but neither is it overcooked.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    *Peter*
  • Cluso99Cluso99 Posts: 18,069
    edited 2010-05-10 03:05
    Kwinn: Just to echo Peter comments. Did you know that by adding those extra resistors you would actually be lowering the MTBF calculations. Mean time between failure. This is because you now have more parts on the pcb, and each part has a MTBF figure - don't ask me to explain MTBF, you can look it up on the wiki but it's complicated.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
    · Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
    · Prop Tools under Development or Completed (Index)
    · Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)·
    · Prop OS: SphinxOS·, PropDos , PropCmd··· Search the Propeller forums·(uses advanced Google search)
    My cruising website is: ·www.bluemagic.biz·· MultiBlade Props: www.cluso.bluemagic.biz
  • kwinnkwinn Posts: 8,697
    edited 2010-05-10 04:34
    Ouch. No fair ganging up on me.... Actually, you are both right to say that adding in the resistors is a bit of over engineering.

    @Peter, if the '595 were on the same board and run off the 3.3V supply I would not bother with the resistors either, but if it is running off +5V I would put them in unless switching speed was an issue. The reason is that two of the input pins are adjacent to the output pins (SER and /SCLR) and if I were scoping those pins it would be very easy to have the scope probe short them to the adjacent pin. The price of 5 SMT resistors is a very small price to pay for that protection.

    @Cluso99, I am far more familiar with MTBF than I ever wanted to be, and am aware that adding components reduces it. I have been in field service for over 30 years now and designed/built my first interface boards a couple of years after I started in service. Most of those original boards have long since been retired, but I still have a few out there, still plugging away, and very few of them have ever had a problem. Most of those problems happened when a power supply failed or a thunder storm rolled through the area.

    @all, some of my customers are in remote areas where getting to the site is very expensive ($1000.00+), so the cost of a few extra components is insignificant by comparison. In addition to that the volumes are small (usually less than 100 units) so the design cost far outweighs that of a few additional components. I make them as rugged as possible, and as a result almost all of the boards I have produced have been retired without a single failure, and a lot of them have been in service for 20 years or more. After 2 years of working with the prop I am confident that any properly designed boards using it will be equally robust.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2010-05-10 12:49
    kwinn said...
    Ouch. No fair ganging up on me.... Actually, you are both right to say that adding in the resistors is a bit of over engineering.

    LOL, it's like a game of football, it's all fun, even if we gang up on you! You go for resistors, n we will resist you smile.gif

    There's no problem with having good arguments and experiences all round, it's a forum.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    *Peter*
  • SpectremanSpectreman Posts: 2
    edited 2010-05-11 01:15
    Peter, you sound like the Borg: Resistors are futile.

    The pmos and nmos transistors in the input stage of a 74HC595 have a threshold of 0.6-0.7V, so if the input voltage deviate that much from either supply, there will be current flowing in the input stage. So even at Vil(max) and Vih(min), we will have current but it will not affect the logic function but will add to the total current consumption. This will be true for the 74HCT595 as well, even if the input levels are different.

    It was suggested earlier to use 74HCT595 instead of 74HC595 to ensure correct input levels and I agree. However, for some reason the HCT devices are more expensive so it might be better to use a single HCT buffer to do the level shifting and then use standard HC devices. This will also minimize the number of inputs with reduced input swing so current consumption will be reduced.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2010-05-11 03:20
    The difference from Mouser for HCT is only about 25c or so in which case I wouldn't bother unless I was using thousands of them. It is true that some current will flow at the margins but actually very very little otherwise the datasheets would have to be rewritten so it's inconsequential. There is always the sub-threshold current and even the threshold voltage is not really an indicator of the switching state of the mosfet as switching mosfets really require a more realistic threshold figure that is relative to full Rds(on) rather than the micro-amp conduction they are talking about.

    This type of discussion wants me to get up and put together a test rig to confirm these statements which I might just do. I'm just curious too.

    Ahh, I love a good argument.......(as long as I win) smile.gif

    Propeller resistance is futile.....you will be assimilated.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    *Peter*
Sign In or Register to comment.