Maker Pro
Maker Pro

Shift registers 74HC166, 74HC595 controlled over a long cable ?

M

Martin Cibulski

Hi,

I built a telescope controller based on the Atmel AVR mega128 processor and
two integrated stepper motor drivers.
The controller's user interface is a small handbox with 8 bushbuttons and a
HD44780 compatible LCD (2x8 characters).

More details can be seen at:
http://martin-cibulski.de/atm/mount_controller_4/index.htm

Currently the handbox has a second CPU and is connected to the main CPU via
RS232.
But I think of another way to connect the handbox because I want to keep
both RS232 connections of the main CPU free for other uses.

Instead of the second CPU there could be simple shift registers in the
handbox (74HC166 for reading the buttons and a 74HC595 for writing to the
LCD).

My Question is:
Is it possible to control serial shift registers in the handbox from the
main CPU over the cable ?
The cable can be up to 5 meters long and I don't know if there are unwanted
reflections or oscillations on the cable.
If this happens the shift register will get wrong clock signals.

Has anybody successfully connected such shift registers over a long
connection ?
What can I do to avoid unwanted effects on the cable ?

Thanks for help,
Martin Cibulski
 
J

Joerg

Hi Martin,

How fast would the signal and clock be on that 5 meter cable? Do you
plan on using twisted pair such as Ethernet cable? That might make it
easier to drive than 50 ohm coax.

I suggest to look into simple line drivers and receivers (14C89 if fast
enough for you) as they provide hysteresis and nice amplitude margins.
There are four channels in one package.

Nice project photos on your web site.

Regards, Joerg
 
S

Stefan Heinzmann

Martin said:
Hi,

I built a telescope controller based on the Atmel AVR mega128 processor and
two integrated stepper motor drivers.
The controller's user interface is a small handbox with 8 bushbuttons and a
HD44780 compatible LCD (2x8 characters).

More details can be seen at:
http://martin-cibulski.de/atm/mount_controller_4/index.htm

Currently the handbox has a second CPU and is connected to the main CPU via
RS232.
But I think of another way to connect the handbox because I want to keep
both RS232 connections of the main CPU free for other uses.

Instead of the second CPU there could be simple shift registers in the
handbox (74HC166 for reading the buttons and a 74HC595 for writing to the
LCD).

My Question is:
Is it possible to control serial shift registers in the handbox from the
main CPU over the cable ?
The cable can be up to 5 meters long and I don't know if there are unwanted
reflections or oscillations on the cable.
If this happens the shift register will get wrong clock signals.

Has anybody successfully connected such shift registers over a long
connection ?
What can I do to avoid unwanted effects on the cable ?

Use passive filters to limit the risetime of the signals and to filter
out unwanted spikes, use a cable with good shielding, use a ground
return wire for every signal and use twisted pairs, go down with the
clock speed as far as your application allows.

Using old CMOS logic instead of 74HC may help (i.e. CD4094). Power it
from 5V and the logic levels will be compatible with the AVR.

Better performance is possible with differential signalling, but that
probably goes beyond your needs.
 
J

John Fields

Hi,

I built a telescope controller based on the Atmel AVR mega128 processor and
two integrated stepper motor drivers.
The controller's user interface is a small handbox with 8 bushbuttons and a
HD44780 compatible LCD (2x8 characters).

More details can be seen at:
http://martin-cibulski.de/atm/mount_controller_4/index.htm

Currently the handbox has a second CPU and is connected to the main CPU via
RS232.
But I think of another way to connect the handbox because I want to keep
both RS232 connections of the main CPU free for other uses.

Instead of the second CPU there could be simple shift registers in the
handbox (74HC166 for reading the buttons and a 74HC595 for writing to the
LCD).

My Question is:
Is it possible to control serial shift registers in the handbox from the
main CPU over the cable ?
The cable can be up to 5 meters long and I don't know if there are unwanted
reflections or oscillations on the cable.
If this happens the shift register will get wrong clock signals.

Has anybody successfully connected such shift registers over a long
connection ?
What can I do to avoid unwanted effects on the cable ?

---
I'd use RS-232 line drivers at the main CPU to send display data to
RS-232 receivers in the hand box, and then use the TTL output from the
receivers to drive the 595, which would in turn drive the display.

Likewise for the 166, I'd send shift/load and clock data from the main
CPU via RS-232 line drivers, convert it to TTL at the hand box with
RS-232 receivers to drive the 166, then send the serial data from the
buttons back to the main CPU with a single line driver, and then, at
the main CPU,convert it to TTL with an RS-232 receiver.


You'll need a cable something like this:

CPU BOX HAND BOX
+-------+ +-------+
| +12V |---------//----------|+12V |
| -12V |---------//----------|-12V |
| GND |---------//----------|GND |
| | | |
| 166CLK|---------//----------|166CLK |
| 166S/L|---------//----------|166S/L |
| 166SD|---------//----------|166SD |
| | | |
| 595SD|---------//----------|595SD |
| 595SCK|---------//----------|595SCK |
| 595RCK|---------//----------|595RCK |
+-------+ +-------+

and since you'll only be sending RS-232 (low edge rates) over about 20
feet you can forget about reflections and use pretty much any old
cable you can find.

If you use the +12 from the CPU's RS-232's positive supply to run a
78L05 in the hand box that'll take care of all the +5 you need on that
end, and you'll be done with the hardware!
 
M

Michael

John said:
---
I'd use RS-232 line drivers at the main CPU to send display data to
RS-232 receivers in the hand box, and then use the TTL output from the
receivers to drive the 595, which would in turn drive the display.

Likewise for the 166, I'd send shift/load and clock data from the main
CPU via RS-232 line drivers, convert it to TTL at the hand box with
RS-232 receivers to drive the 166, then send the serial data from the
buttons back to the main CPU with a single line driver, and then, at
the main CPU,convert it to TTL with an RS-232 receiver.

You'll need a cable something like this:

CPU BOX HAND BOX
+-------+ +-------+
| +12V |---------//----------|+12V |
| -12V |---------//----------|-12V |
| GND |---------//----------|GND |
| | | |
| 166CLK|---------//----------|166CLK |
| 166S/L|---------//----------|166S/L |
| 166SD|---------//----------|166SD |
| | | |
| 595SD|---------//----------|595SD |
| 595SCK|---------//----------|595SCK |
| 595RCK|---------//----------|595RCK |
+-------+ +-------+

and since you'll only be sending RS-232 (low edge rates) over about 20
feet you can forget about reflections and use pretty much any old
cable you can find.

If you use the +12 from the CPU's RS-232's positive supply to run a
78L05 in the hand box that'll take care of all the +5 you need on that
end, and you'll be done with the hardware!



Agree. I have two separate "boxes" running at home that talk to other,
fairly remote (20 ft., the other nearly 40 ft distant) boxes using the
scheme John so nicely describes. And I'm not talking traditional
UART+RS-232. Just gates and uC pins sending and receiving.
 
W

Wouter van Ooijen

What can I do to avoid unwanted effects on the cable ?

Match the cable impedance with series resistors (47 ohm is a good
guess), add small caps (100pF .. 10nF) at the receiving end, and use
schmitt-trigger receivers.

Or just use plain old 1488/1489...


Wouter van Ooijen

-- ------------------------------------
http://www.voti.nl
PICmicro chips, programmers, consulting
 
R

RobbStark

Has anyone used the DS9637A and DS9638 RS-422 line receiver and transmitter
pair? I need to send three custom serial streams of data from my LPT:
port to a 74HC595 over 100 feet away. I currently get incredible
interference and data loss over just 3 feet. I was thinking about using
this chipset because they operate on standard +5VDC power but the
datasheets are very vague as to actual application.
 
T

Tony Williams

RobbStark said:
Has anyone used the DS9637A and DS9638 RS-422 line receiver and
transmitter pair? I need to send three custom serial streams of
data from my LPT: port to a 74HC595 over 100 feet away.

Is that synchronous serial comms, something like
Clock, Data, and Load?

We did a similar job, over about 20 metres. Used
3x twisted pairs, with optocouplers at the far end
for total isolation. The transmitting end was push
pull drivers with about 200 ohm in series with each
output. I went push pull just in case single optos
with passive pullups wasn't fast enough, but we got
reliable data transfer at 40Kbits/sec with no trouble.
 
Top