Hi,

Shonky is correct about layout problems causing EMI/EMC susceptibility.

A couple of thing to consider when you transfer the design to Printed Wiring Board (PWB).

1) The controller device is CMOS and even though the output of the chip is controlling very slow events, the rise and fall time is usually very fast. I noticed that the design does not include any termination for the lines that drive the motor controller. It is often a good idea to series terminate the lines at the driver side. The termination resistor can be roughly estimated by:
a) Estimate the output impedance of the driver (RO)
R(Out) = V(OL) / I(OL)
Example: The datasheet specifies Normal Drive Output Low
Voltage V(OL) as 0.3V and Low Output Current I(OL) as 2mA.

R(out) = 0.3V / 2mA = 0.3 / 0.002 = 150 Ohm

The wiring you have in your circuit is around 100 Ohms, this
exceeds the 150 Ohm and no series termination should be
required. The worst it will do is degrade the rise and fall
time a little which in your case is negligible.

The output drive strength is programmable. The datasheet also
specifies that it has a high-drive capability of 8 mA at
VCC=3.3V. If it is progammed for high drive (to drive your
opto-isolators), the value of R(Out) is calculated as:

R(Out) = V(OL) / I(OL)
The datasheet specifies Normal Drive Output Low
Voltage V(OL) as 0.3V and Low Output Current I(OL) as 8mA.

R(out) = 0.3V / 8mA = 0.3 / 0.008 = 37.5 Ohm

b) To terminate the line properly (to eliminate reflections that
may cause Overshoot - which may over-Voltage the output driver
power ESD clamps)for the high-drive case, you need to use the
following calculation:

R(Series) = Zo - R(Out) Where:
R(Series) is the series termination resistance value
Zo is the target impedance of the transmission line
(The target impedance of the circuit board - like 50 Ohms)
R(Out) is the output resistance you just calculated above

R(Series) = 100 Ohms (your wire impedance of your breadboard)
R(Out) = 37.5 Ohms (calculated above)

R(series) = 100 Ohms (-) 37.5 Ohms = 62.5 Ohms (use a 68 Ohm)

If you don't need the extra drive for the Opto-isolators,
just program it out.

For your new board layout use the target impedance of board
(preferred 50 Ohm Characteristic Impedance) for Zo in the
formula above.


PWB Board & Routing Recommendations:
------------------------------------

1) Use a 4 layer PWB. You can use a similar stack-up like this:

Layer 1 - Signal Layer 1
Layer 2 - Solid Ground and Routed Power within Ground
Layer 3 - Signal Layer 2
Layer 4 - Ground

If you have to use a 2 layer (increases susceptibility and
emissions), use the following stack-up:

Layer 1 - Signal Layer
Layer 2 - Ground and Routed power within Ground

On Layer 1, use a ground fill with around 10 mil spacing
around the traces. Make sure that the ground fill vias into
the Ground on Layer 2 (don't leave unconnected Ground Islands
on Layer 1. Sometimes it works to drill a hole and solder a
wire from the Ground Island to layer 2 Ground Plane - Vias
work better though. Make sure you don't drill through traces
on Layer 2 though <grin>.

2) Place your sensitive lines in Layer 3 like Reset,
CBUS lines and UART Lines if you use them, & USB Lines. Route
non-sensitive lines on Layer 1 of the 4 Layer Stack-up.

3) Do not route any lines across or adjacent to the Routed Power
Traces or to Reset

4) Route 8 mil traces with 4X the line width space from edge to
edge ie... If your trace width is 8 mils the next trace
adjacent to it is 32 mils away edge-to-edge. This is
conservative, but you don't have a lot of traces, so use the
space. This prevents crosstalk, but if the board is small,
with short traces, you can go down to 2X with no problem.

5) Don't route any of the motor outputs or motor power traces
near the digital traces.

6) Consider a plane split bridged by a Zero Ohm resistor between
the Motor circuitry and the Digital Circuitry to partition
the noise. It is easier to add or remove it. The Opto-
Isolator can easilly cross the boundary, but if you need a
common ground, the Zero Ohm Resistor is easy to install.
Since you have Opto-isolators, no digital return currents
have to cross the boundary and you should be okay.

7) Make the power traces wide (20 mils). As Shonky mentioned,
The decoupling capacitors should be close to the chip. Place
them with the smallest value closer (a 100nF capacitor is
placed closer to the chip than a 10uF capacitor is), to the
chip VCC and via directly into the ground plane(s). The 10 uF
can be placed further away.

8) Place any series resistors at the driver side of the net.

9) Route the motor traces as a Differential Pair as much as
possible if they are long. They do not have to be matched.

10) Route the USB Bus as a Differential Pair on the inside
layer for the 4 layer PWB. If your board is 40 mils or
62 mils thick, space the dielectric layers 8 to each other.
Use 10 mil traces and space them 15 mils away edge to edge
from each other (45 Ohm Characteristic, 90 Ohms
Differential Impedance). Route any Ground around them spaced
12 mils away from the trace pair (for Co-Planar Differential
Striplines).

11) Make sure all of the unused lines are either pulled high or
low unless they affect functionality. One trick if you are
experiencing Ground Bounce issues is to have all of the
unused drivers driving low. This works well with FPGAs with
lots of I/O or I/O banks.

12) If you do use a 7805 off of +12V, place a 10uF capacitor
near the input and another near the output - it needs to see
low ESR on both sides - most linear regulators need this. A
Tantalum Capacitor works best, always select the working
voltage of a Tantalum (you can get by with less with an
electrolytic cap), by multiplying the applied voltage by 2.
ie... 25V cap on the input (2 X 12V), and (2 X 5V) = 10V or
16V on the output.

13) Is there a reason why you didn't connect VCC to VCCIO?
Most design examples have these connected.

14) Make sure you filter the Motor Driver Supply with a Pi
filter of some sort. Like a 0.1uF connected to the +12V
power input, then a Ferrite Bead, then a 0.1uF cap to the
Motor Driver Chip. Remember the Bulk Low Frequency Capacitor
on the Motor Driver Chip side of the Ferrite Bead.

15) Be sure to decouple the power from the USB with a 0.1uF and
10uF to clean it up. This returns your generated noise to
your card and filters off any noise coming to you from the
USB Host.


Ross
_________________________
In SI, a little termination and attention to layout goes a long way. In EMC, without SI, you'll spend 80% of the effort on the last 3dB.