Maker Pro
Maker Pro

need an 8bit shift register that is GUARANTEED to powerup in knownstate

J

James W

Jan 1, 1970
0
Newbie Alert ON:

I'm working on a circuit that uses a serial-in-parallel-out 8bit shift
register to drive some opto-isolators that will control some relays. I
need to find a shift-register that is guaranteed to start in a known
state, either high or low, on the outputs..

I'm new to using shiftregisters... so.. do they all do this? Is this
possible? Any particular recommended (CMOS) devices?


thanks

- jim
 
C

CFoley1064

Jan 1, 1970
0
From: James W [email protected]
Date: 2/13/2004 7:10 PM Central Standard Time
Message-id: <[email protected]>


Newbie Alert ON:

I'm working on a circuit that uses a serial-in-parallel-out 8bit shift
register to drive some opto-isolators that will control some relays. I
need to find a shift-register that is guaranteed to start in a known
state, either high or low, on the outputs..

I'm new to using shiftregisters... so.. do they all do this? Is this
possible? Any particular recommended (CMOS) devices?


thanks

- jim

Hi, Jim. I'm not aware of any Serial In - Parallel Out (SIPO) shift registers
that start up in a guaranteed state. If you want, you can make one yourself,
or just do what everyone else does, and use the reset pin on the shift register
to initialize.

If you're using a microcontroller to do this job, the standard IC is the
74HC595. It's an 8-bit SIPO daisy-chainable shift register with built-in data
latches to avoid glitches on the outputs while shifting in new data. Cool IC,
16 pins, not too expensive. You've got separate controls for the shift
register (serial data input, clock, reset(active-low) ), and the latching
output (latch clock, tri-state output enable (active-low) ). You can make this
IC sing. It'll do anything except directly drive 8 opto inputs -- it's only
good for 75 mA total current source or sink abs. max.

The whole idea of "guaranteeing" startup output logic states usually isn't too
complicated, but a good answer would require more information. Like for
instance, what are you using to control the shift register? Discrete logic
ICs, a microcontroller. a Stamp, a PC printer port, a PDP-8 that has a 10
minute power up cycle while the 8" Shugart drives warm up? Is it on the same
power supply as the shift register? What kind of power supply do you have?
Different types of regulators have different types of power-up profiles. Do
you have a second voltage (possibly unregulated) driving the relays? What kind
of relays are you switching? (Some of the faster reed relays have less than a
millisecond from energize to power on, larger ones can have a lot more.) Do
you have anything else you need to guarantee startup state which might have a
faster time frame than a relay?

If you can give more information, you might get a more complete answer. Good
luck with your project. Look at the data sheet below -- it will answer a lot
of questions. Post a response if you want more info.

http://www.onsemi.com/pub/Collateral/MC74HC595A-D.PDF

Good luck
Chris
 
T

Tim Dicus

Jan 1, 1970
0
James W said:
Newbie Alert ON:

I'm working on a circuit that uses a serial-in-parallel-out 8bit shift
register to drive some opto-isolators that will control some relays. I
need to find a shift-register that is guaranteed to start in a known
state, either high or low, on the outputs..

I'm new to using shiftregisters... so.. do they all do this? Is this
possible? Any particular recommended (CMOS) devices?


thanks

- jim

Hi Jim,

May I point out a challenge you may have with just a shift register. You will need some device to "remember" the last switch
settings while your shift register collects new data.

The reason is that the data bits received on the shift registers I am familiar with "march" across the outputs as the clock is
toggled, or the outputs are in a tri-state (floating) while shifting until all bits are received. Leaving outputs floating is not
recommended.

I would suggest maybe the 74HC595 if you are interested in CMOS. The outputs can be brought up in tri-state output modes, so you can
use weak pullups (or pull-downs) to set the initial output to whatever you want. I would use a 74HC373 on the shift register outputs
to hold the previous data during the "parade" (bit shifting).

Pick the opto-isolators carefully and you should be able to drive 8 units ok. Digi-Key ( www.digikey.com ) has a selection of
opto-isolators for about any application with input current requirements as low as 1ma. Best selection is 5ma per isolator (40ma
total for 8 isolators).

Hope that helps.

Tim
 
J

James W

Jan 1, 1970
0
Chris, Thanks for the detailed answer.

The ACTUAL application is automotive. I'll have 3 big relays (~30A), and
3 small relays (~1A), with coil currents of ~150mA and ~10mA
respectively. Top side of the relays will of course be 13.8V.

Control needs to come from EITHER simple switches that will ground a
pin, or from a microprocessor (AVR) that will also ground a pin. I
intended to have the AVR connected to this relay 'board' using a shift
register, to cut down on pin count. The shift registers in turn would
drive opto's.

The guaranteed initial state request was so that if the AVR was not
present (mostly during the develpment stages) the relays would all be
open, unless overridden by one of the switches I mentioned above.

If I were to supply the power to the SIPO via the AVR, such that the
SIPO would have no power unless the AVR was present to control it, what
could I expect the SIPO's output pins to behave like? High-impedence?

- jim
 
J

Jim

Jan 1, 1970
0
Tim Dicus said:
I would suggest maybe the 74HC595 if you are interested in CMOS. The
outputs can be brought up in tri-state output modes, so you can
use weak pullups (or pull-downs) to set the initial output to whatever you
want. I would use a 74HC373 on the shift register outputs
to hold the previous data during the "parade" (bit shifting).

IIRC the 74HC595 contains a shift register and a separate output latch. The
output latch remains steady until a load signal is sent to the chip, at
which point it loads the contents of the shift register in a single step. In
this way you won't get this problem with the parading of bits while they are
shifted, so no extra 74HC373 is needed. Yes, I think the '595 is a cool chip
too ;)

Jim
 
T

Tim Dicus

Jan 1, 1970
0
Jim said:
outputs can be brought up in tri-state output modes, so you can
want. I would use a 74HC373 on the shift register outputs

IIRC the 74HC595 contains a shift register and a separate output latch. The
output latch remains steady until a load signal is sent to the chip, at
which point it loads the contents of the shift register in a single step. In
this way you won't get this problem with the parading of bits while they are
shifted, so no extra 74HC373 is needed. Yes, I think the '595 is a cool chip
too ;)

Jim

Thanks for the info on the '595! I had not noticed that before. That is why I am on this NG.

Tim
 
J

Jim

Jan 1, 1970
0
Tim Dicus said:
Thanks for the info on the '595! I had not noticed that before. That is why I am on this NG.

Tim
Glad to be of help! I'm pretty new to electronics too (software is my main
area), but I've used this IC quite recently and it kind of stuck in my head.
It is a very useful one chip solution for giving a microprocessor more
outputs. Plus chaining two or more of them together, as another poster
mentioned, means you can get as many outputs as you want very easily and
cheaply.

Jim
 
J

John Larkin

Jan 1, 1970
0
Newbie Alert ON:

I'm working on a circuit that uses a serial-in-parallel-out 8bit shift
register to drive some opto-isolators that will control some relays. I
need to find a shift-register that is guaranteed to start in a known
state, either high or low, on the outputs..

I'm new to using shiftregisters... so.. do they all do this? Is this
possible? Any particular recommended (CMOS) devices?


thanks

- jim

You could use a 4094 and not OE the thing until you knew it was safe.

John
 
C

CBarn24050

Jan 1, 1970
0
Hi, if you need a shift reg with power drivers built in try the TICP6595
 
C

CFoley1064

Jan 1, 1970
0
From: James W [email protected]
Date: 2/14/2004 9:19 AM Central Standard Time
Message-id: <[email protected]>

Chris, Thanks for the detailed answer.

The ACTUAL application is automotive. I'll have 3 big relays (~30A), and
3 small relays (~1A), with coil currents of ~150mA and ~10mA
respectively. Top side of the relays will of course be 13.8V.

Control needs to come from EITHER simple switches that will ground a
pin, or from a microprocessor (AVR) that will also ground a pin. I
intended to have the AVR connected to this relay 'board' using a shift
register, to cut down on pin count. The shift registers in turn would
drive opto's.

The guaranteed initial state request was so that if the AVR was not
present (mostly during the develpment stages) the relays would all be
open, unless overridden by one of the switches I mentioned above.

If I were to supply the power to the SIPO via the AVR, such that the
SIPO would have no power unless the AVR was present to control it, what
could I expect the SIPO's output pins to behave like? High-impedence?

- jim

Good. More info, more suggestions. It works.

First off, you want to be careful clocking a shift register with a switch of
any kind. All switches have contact bounce, which will mean multiple shifts
(possibly even off the chip into the bit-bucket). Better would be to have the
data switch and the clock pushbutton as uC inputs, and use software debounce.
You can then control the shift register directly from the uC.

Here are two options to get you started with the shift register thing. Both
will give you known outputs (the '595 will be tri-state, and the '164 will be
low) at turn-on. As another post mentioned, you can use pullup/pulldown
resistors to make tristate a known logic state. (View in fixed font or M$
Notepad):
AVR Guaranted with HC595

AVR OUT 1-------------------------------.
|
AVR OUT 2--------------------------. |
| | .-------------.
AVR OUT 3-----------------------. | | 14| |
| | '----oSDI o------
AVR OUT 4---------------------. | | 11| o------
| | '---o-----oCLK o------
AVR OUT 5-----------. | | | 10| o------
| | '----o-------oRST o------
VCC | | | | 12| 'HC595 o------
+ | '---o----------oLATCH CLK o------
| | | | | 13| o------
| | .-|--|-|-----oOE |
| | | | | | 9| |
1uF --- | __ | | | | .--oSDO |
--- '--|>=| | | | | | | |
| |1 |o----| | | | | '-------------'
o-----|__| | | | | |
| | | | | | .-------------.
| | | | | |14| |
.-. | | | | '--oSDI o------
| | | | | | 11| o------
22K | | | | | '-----oCLK o------
'-' | | | 10| o------
| | | '-------oRST o------
=== | | 12| 'HC595 o------
GND | '----------oLATCH CLK o------
| 13| o------
'------------oOE |
| |
| |
| |
'-------------'

AVR Guaranteed Cheapie with HC'164
VCC
+ .------------.
| | |
'--o S1 A o----------------o
AVR Out 1 | o----------------o
o-----------------o S2 o----------------o
| o----------------o
| HC164 o----------------o
| o----------------o
.-----------o CLR o----------------o
| | H o----o-----------o
| | | |
o--------o--------o CLK | |
AVR Out 2| | | | |
| | | | |
| | '------------' | Outputs to Opto
| | |
| | .-----------------------'
VCC | | | VCC .------------.
+ | | | | | |
| | | | '--o S1 A o----------------o
.-. | | | | o----------------o
22K| | | | '-----o S2 o----------------o
| | | | | o----------------o
'-' | | | HC164 o----------------o
| | | | o----------------o
o---o--|--------o CLR o----------------o
|+ | | H o----------------o
1uF--- | | |
--- '--------o CLK |
| | |
=== '------------'
GND
created by Andy´s ASCII-Circuit v1.24.140803 Beta www.tech-chat.de

The basic question here is if you can slam data through the shift register
faster than the relays can react. The answer with the AVR is probably "yes",
and if so, and if you're really hard-up for pins and don't need any other
outputs that can't squiggle around for a few dozen microseconds, the second
circuit is probably a safe shortcut. The first one is the standard AVR/PIC
"full metal jacket" solution. It assumes you're going to set Output Enable on
the '595s as soon as the processor clock stabilizes and you're started up (this
shows about 12 ms -- increase the 22K resistor if you need more - the time
constant can be conservatively figured at 1/2 RC). The outputs will remain
tri-stated (if you're driving the opto with less than 8 mA each, you can do
this directly, and don't need pulldowns or pullups -- tri-state means off for
anything that needs current to turn on) until you can take the controls and set
the chip. It is a bit of a pig, though, and requires 5 uC pins (or 4 if you
only need the tri-state on power-up, probably not a good idea). The idea,
though, is that these 5 pins can control an essentially unlimited number of
outputs by daisy-chaining more '595s. For both circuits, if you really want a
guarantee, you'll want an external low power/watchdog reset circuit, and you'll
NOR with that your AVR signal, you'll have more security -- neither setup above
does anything about a processor upset or restart.

There are "guarantees" with even greater degrees of confidence, but that
involves more time and hardware. If this is "mission critical" or involves
safety, leave it to an engineer.

I hope this has been of help.

Good luck, and be safe
Chris
 
Top