e019022.PDF

(218 KB) Pobierz
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
GENERAL INTEREST
I 2 C Servo Interface
control eight servos using the I2C bus
Design by C. Fuchs
Model servos have improved greatly in the past few years and now offer
greater torque and speed, so much so that they are increasingly being used
for other applications. The circuit described here controls up to eight servos
using the well-established I 2 C bus. Additional cards enable expansion up to
64 servos. Software running under Win95/98 demonstrates the features of
the circuit and allows simple programming on a PC using Visual Basic.
Generating an accurate Pulse Width Modu-
lated (PWM) signal necessary to control a
model servo is not an easy job for any com-
puter particularly so if its running a multi-
tasking operating system like Windows.
Needless to say the problem gets worse
when we add more servos and need to gen-
erate more control waveforms. In this situa-
tion the application of a little hardware often
works wonders. The solution presented here
uses a simple card driving eight servos con-
trolled from an I 2 C bus on a parallel PC inter-
face like the one presented in the March 1999
PC Topics Supplement of Elektor Electronics.
The card allows eight servos to be controlled
independently via commands sent over the
I 2 C bus. Address selector switches on the
card enable eight of these cards to be con-
nected in parallel to the same I 2 C bus thereby
providing a maximum of 64 servos to be con-
trolled from the same I 2 C bus.
other end (usually 90 degrees of
movement). The control is propor-
tional so that intermediate pulse
widths will move the arm to the cor-
responding intermediate position.
The control voltage for each of the
eight monoflops is produced by an 8-
channel DAC type TDA8444, which
interfaces to an I 2 C PC port and can
be controlled using software rou-
tines running in Visual basic on the
PC.
High torque/speed servos can
generate appreciable levels of elec-
trical interference and despite care-
ful PCB layout and supply decou-
pling this has led to occasional mal-
function of the TDA8444. If you plan
to use many servos it is advisable to
power the servos independently
from an external supply and use the
+5 V derived from the I 2 C connector
for the circuitry on this interface card
only.
Circuit overview
An outline of the servo controller circuit is
shown in Figure 1. The NE555 timer (IC6) is
configured as an astable multivibrator, gen-
erating a pulse every 20 ms to trigger the
eight monostable multivibrators (monoflops)
formed by the four 556 dual timers (IC2-IC5).
The pulse width output signal from these ICs
will control the movement of each servo con-
nected to that channel. A 1-ms wide pulse
will move the servo arm to one end of its
travel while a 2-ms pulse will move it to the
Circuit details
IC1 is the main component of the cir-
cuit diagram shown in Figure 2 it is
an 8-channel Digital to Analogue
22
Elektor Electronics
9/2001
855734972.550.png 855734972.639.png 855734972.650.png 855734972.661.png
GENERAL INTEREST
Converter (DAC). The voltage level
of the eight analogue outputs can be
adjusted with a 6-bit resolution, giv-
ing 2 6 or 64 steps. Information to the
DAC is supplied from the clock and
data lines (SCL and SDA) of the I 2 C
interface over the parallel wired mini
DIN connectors K1 and K2. These
connectors also allow the interface
card and servos to be powered from
the I 2 C bus. Details of the command
structure are given later.
The address of the DAC on the I 2 C
bus can be set up on DIP switch S1.
This corresponds to bits 2, 3 and 4 of
the DAC address
(0100_A2_A1_A0_0). The address
switch allows up to eight interface
cards to be controlled over the same
I 2 C bus.
The VMAX (Pin 2) input of the
DAC can be used to reduce its out-
put voltage range if it is connecting
to lower voltage circuitry. In this
IC1
U +
Logic
I 2 C
SDA
SCL
D/A
2 off
mini-DIN socket
6-way
Control
IC2.A
IC2.B
1 / 2
IC3.A
1 / 2
IC3.B
1 / 2
IC4.A
1 / 2
IC4.B
1 / 2
IC5.A
1 / 2
IC5.B
1 / 2
1 / 2
Trigger
NE556
NE556
NE556
NE556
NE556
NE556
NE556
NE556
20ms
Q
IC6
Q
NE555
1ms
U +
Power
2ms
010006 - 12
servo motor connections
Figure 1. Servo interface block diagram.
application we are using 5 V
throughout so VMAX can be left
open-circuit. The output voltage of
each channel (pins 9-16) of the DAC
are connected via resistors R3-R10 to
the control inputs (CV) of the dual
timer IC’s. The voltage level will be
approximately in the range of 0.26 V to 3.12 V.
The NE556 dual timers are connected in
the classic monoflop configuration. The tim-
ing components R = 18.7 kΩ, C = 100 nF
together with a control voltage input of 0.26 V
on the 6.04 kΩ series resistor will give an out-
put pulse width of 1.0 ms. Increasing the con-
+5V
+5V
+5V
14
14
14
14
R2
IC2
IC3
IC4
IC5
7
7
7
7
4
R
8
7
DIS
IC2, IC3, IC4, IC5 = 556N
K1
K2
R1
IC6
3
4
3
4
3
OUT
555CP
2
5
2
5
6
+5V
+5V
+5V
+5V
THR
2
TR
1
6
1
6
R11
R12
R13
R14
CV
5
1
4
4
4
4
C10
C1
R
R
R
R
6
1
2
6
1
2
6
1
2
6
1
2
33n
63V
TR
TR
TR
TR
IC2.A
IC3.A
IC4.A
IC5.A
5
5
5
5
DIS
THR
OUT
DIS
THR
OUT
DIS
THR
OUT
DIS
THR
OUT
C2
C4
C6
C8
+5V
CV
CV
CV
CV
3
3
3
3
100n
R3
6k04
100n
R5
6k04
100n
R7
6k04
100n
R9
6k04
SCL
SDA
C16
C11
100n
470µ
16V
+5V
IC1
1
R19
4x 10k
+5V
+5V
+5V
+5V
1
2
9
VMAX
DAC0
DAC1
DAC2
DAC3
DAC4
DAC5
DAC6
DAC7
R15
R16
R17
R18
10
11
12
13
14
15
16
3
4
SDA
SCL
10
10
10
10
2345
R
R
R
R
8
13
12
8
13
12
8
13
12
8
13
12
TR
TR
TR
TR
IC2.B
IC3.B
IC4.B
IC5.B
5
6
7
9
9
9
9
A0
A1
A2
DIS
THR
OUT
DIS
THR
OUT
DIS
THR
OUT
DIS
THR
OUT
C3
C5
C7
C9
CV
CV
CV
CV
11
11
11
11
100n
R4
6k04
100n
R6
6k04
100n
R8
6k04
100n
R10
6k04
8
TDA8444
654
S1
1
2
3
K11
C12
C13
C14
C15
470µ
470µ
470µ
470µ
K3
K4
K5
K6
K7
K8
K9
K10
010006 - 11
Figure 2. Servo interface circuit diagram.
9/2001
Elektor Electronics
23
855734972.001.png 855734972.012.png 855734972.023.png 855734972.034.png 855734972.045.png 855734972.056.png 855734972.067.png 855734972.078.png 855734972.089.png 855734972.100.png 855734972.110.png 855734972.121.png 855734972.132.png 855734972.143.png 855734972.154.png 855734972.165.png 855734972.176.png 855734972.187.png 855734972.198.png 855734972.209.png 855734972.220.png 855734972.231.png 855734972.242.png 855734972.253.png 855734972.264.png 855734972.275.png 855734972.286.png 855734972.297.png 855734972.308.png 855734972.319.png 855734972.330.png 855734972.341.png 855734972.352.png 855734972.363.png 855734972.374.png 855734972.385.png 855734972.396.png 855734972.407.png 855734972.418.png 855734972.429.png 855734972.440.png 855734972.451.png 855734972.462.png 855734972.473.png 855734972.484.png 855734972.495.png 855734972.506.png 855734972.517.png 855734972.528.png 855734972.539.png 855734972.551.png 855734972.562.png 855734972.573.png 855734972.584.png 855734972.595.png 855734972.606.png 855734972.617.png 855734972.628.png 855734972.637.png 855734972.638.png 855734972.640.png 855734972.641.png 855734972.642.png 855734972.643.png 855734972.644.png 855734972.645.png 855734972.646.png 855734972.647.png 855734972.648.png 855734972.649.png 855734972.651.png 855734972.652.png 855734972.653.png 855734972.654.png 855734972.655.png 855734972.656.png 855734972.657.png 855734972.658.png 855734972.659.png 855734972.660.png 855734972.662.png 855734972.663.png 855734972.664.png 855734972.665.png 855734972.666.png 855734972.667.png 855734972.668.png 855734972.669.png 855734972.670.png 855734972.671.png 855734972.002.png 855734972.003.png 855734972.004.png 855734972.005.png 855734972.006.png 855734972.007.png 855734972.008.png 855734972.009.png 855734972.010.png 855734972.011.png 855734972.013.png 855734972.014.png 855734972.015.png 855734972.016.png 855734972.017.png 855734972.018.png 855734972.019.png 855734972.020.png 855734972.021.png 855734972.022.png 855734972.024.png 855734972.025.png 855734972.026.png 855734972.027.png 855734972.028.png 855734972.029.png 855734972.030.png 855734972.031.png 855734972.032.png 855734972.033.png 855734972.035.png 855734972.036.png 855734972.037.png 855734972.038.png 855734972.039.png 855734972.040.png 855734972.041.png 855734972.042.png 855734972.043.png 855734972.044.png 855734972.046.png 855734972.047.png 855734972.048.png 855734972.049.png 855734972.050.png 855734972.051.png 855734972.052.png 855734972.053.png 855734972.054.png 855734972.055.png 855734972.057.png 855734972.058.png 855734972.059.png 855734972.060.png 855734972.061.png 855734972.062.png 855734972.063.png 855734972.064.png 855734972.065.png 855734972.066.png 855734972.068.png 855734972.069.png 855734972.070.png 855734972.071.png 855734972.072.png 855734972.073.png 855734972.074.png 855734972.075.png 855734972.076.png 855734972.077.png 855734972.079.png 855734972.080.png 855734972.081.png 855734972.082.png 855734972.083.png 855734972.084.png 855734972.085.png 855734972.086.png 855734972.087.png 855734972.088.png 855734972.090.png 855734972.091.png 855734972.092.png 855734972.093.png 855734972.094.png 855734972.095.png 855734972.096.png 855734972.097.png 855734972.098.png 855734972.099.png 855734972.101.png 855734972.102.png 855734972.103.png 855734972.104.png 855734972.105.png
 
GENERAL INTEREST
trol voltage up to its maximum of 3.12 V will
produce a 2.0 ms pulse. These two pulse
widths represent the maximum and minimum
travel of the servo and should produce a 90
degress travel of the actuating arm. In prac-
tice, component tolerances may introduce an
offset or reduce the travel so it may be nec-
essary to alter component values to achieve
exactly 90 degrees if this is important for your
application. The 1 ms to 2 ms pulse width
signal to each servo must be repeated
approximately every 20 ms. A free running
astable multivibrator formed by IC6 provides
this signal by generating a short 1 ms pulse
every 20 ms to simultaneously trigger each of
the eight monoflops. The output pulses are
then taken to the three pin output connectors
on the PCB along with the supply rails to
drive the servos.
Different servo manufacturers in the past
have always tended to use their own pin des-
ignations for the servo connectors and if you
have some of these older servos the pin con-
figurations shown in Figure 3 should help. Be
careful here, an incorrectly wired servo will
be an expensive mistake. Thankfully, the sit-
uation in the UK is improving and most mod-
ern servos share a common pin configuration
and are interchangeable. As mentioned ear-
lier, servos can generate a high level of elec-
trical noise so the PCB for this circuit
is laid out with wide supply rails to
the servo connectors and large sup-
ply decoupling capacitors to reduce
this interference.
Graupner/JR
Futuba
Construction
Multiplex
Robbe
The PCB layout is shown in Figure 4.
Building the card should begin by fit-
ting and soldering the more robust
components such as the wire links (9
in all), the IC sockets, connectors
and pin strips to the PCB. Next, fit
the passive components. Don’t forget
that the resistor array R19 must be
fitted the correct way round. Before
the IC’s are fitted into their sockets,
it is a good idea to connect the card
to ensure that the +5 V supply is
available on all the power supply
pins of the IC’s. Only if everything
looks OK can the IC’s be fitted and
the card connected to the I 2 C inter-
face. If many servos are connected it
is important to use an external +5 V
power supply and not rely on the I 2 C
bus supply.
After power up, check that the
outputs of the eight DAC channels
Microprop
Simprop
990030 - 13
Figure 3. Pinouts of some popular
servos.
are at 0 V (0.26 V maximum). Con-
nect an oscilloscope to the output of
IC6 (pin 3) and look for the short
1 ms pulse repeated every 20 ms.
When a servo is plugged into the
card, its output arm should drive to
an end position. If all functions are
satisfactory then the circuit up to the
TDA8444 should be OK.
010006-1
R19
H2
S1
K2
A0
A1
A2
C16
C11
C10
C2
C3
C4
C5
C6
C7
C8
C9
K11
K3
C12
K4
K5
C13
K6
K7
C14
K8
K9
K10
K1
R1
R2
+
+
+
+
+
+
+
+
H4
-
-
-
-
-
-
-
-
0
+
15
Figure 4. Simple layout using a single sided PCB (board not available ready-made).
24
Elektor Electronics
9/2001
855734972.106.png 855734972.107.png 855734972.108.png 855734972.109.png 855734972.111.png 855734972.112.png 855734972.113.png 855734972.114.png 855734972.115.png 855734972.116.png 855734972.117.png 855734972.118.png 855734972.119.png 855734972.120.png 855734972.122.png 855734972.123.png 855734972.124.png 855734972.125.png 855734972.126.png 855734972.127.png 855734972.128.png 855734972.129.png 855734972.130.png 855734972.131.png 855734972.133.png 855734972.134.png 855734972.135.png 855734972.136.png 855734972.137.png 855734972.138.png 855734972.139.png 855734972.140.png 855734972.141.png 855734972.142.png 855734972.144.png 855734972.145.png 855734972.146.png 855734972.147.png 855734972.148.png 855734972.149.png 855734972.150.png 855734972.151.png 855734972.152.png 855734972.153.png 855734972.155.png 855734972.156.png 855734972.157.png 855734972.158.png 855734972.159.png 855734972.160.png 855734972.161.png 855734972.162.png 855734972.163.png 855734972.164.png 855734972.166.png 855734972.167.png 855734972.168.png 855734972.169.png 855734972.170.png 855734972.171.png 855734972.172.png 855734972.173.png 855734972.174.png 855734972.175.png 855734972.177.png 855734972.178.png 855734972.179.png 855734972.180.png 855734972.181.png 855734972.182.png 855734972.183.png 855734972.184.png 855734972.185.png 855734972.186.png 855734972.188.png 855734972.189.png 855734972.190.png 855734972.191.png 855734972.192.png 855734972.193.png 855734972.194.png 855734972.195.png 855734972.196.png 855734972.197.png 855734972.199.png 855734972.200.png 855734972.201.png 855734972.202.png 855734972.203.png 855734972.204.png 855734972.205.png 855734972.206.png 855734972.207.png 855734972.208.png 855734972.210.png 855734972.211.png 855734972.212.png 855734972.213.png 855734972.214.png 855734972.215.png 855734972.216.png 855734972.217.png 855734972.218.png 855734972.219.png 855734972.221.png 855734972.222.png 855734972.223.png 855734972.224.png 855734972.225.png 855734972.226.png 855734972.227.png 855734972.228.png 855734972.229.png 855734972.230.png 855734972.232.png 855734972.233.png 855734972.234.png 855734972.235.png 855734972.236.png 855734972.237.png 855734972.238.png 855734972.239.png 855734972.240.png 855734972.241.png 855734972.243.png 855734972.244.png 855734972.245.png 855734972.246.png 855734972.247.png 855734972.248.png 855734972.249.png 855734972.250.png 855734972.251.png 855734972.252.png 855734972.254.png 855734972.255.png 855734972.256.png 855734972.257.png 855734972.258.png 855734972.259.png 855734972.260.png 855734972.261.png 855734972.262.png 855734972.263.png 855734972.265.png 855734972.266.png 855734972.267.png 855734972.268.png 855734972.269.png 855734972.270.png 855734972.271.png 855734972.272.png 855734972.273.png 855734972.274.png 855734972.276.png 855734972.277.png 855734972.278.png 855734972.279.png 855734972.280.png 855734972.281.png 855734972.282.png 855734972.283.png 855734972.284.png 855734972.285.png 855734972.287.png 855734972.288.png 855734972.289.png 855734972.290.png 855734972.291.png 855734972.292.png 855734972.293.png 855734972.294.png 855734972.295.png 855734972.296.png 855734972.298.png 855734972.299.png 855734972.300.png 855734972.301.png 855734972.302.png 855734972.303.png 855734972.304.png 855734972.305.png 855734972.306.png 855734972.307.png 855734972.309.png 855734972.310.png 855734972.311.png 855734972.312.png 855734972.313.png 855734972.314.png 855734972.315.png 855734972.316.png 855734972.317.png 855734972.318.png 855734972.320.png 855734972.321.png 855734972.322.png 855734972.323.png 855734972.324.png 855734972.325.png 855734972.326.png 855734972.327.png 855734972.328.png 855734972.329.png 855734972.331.png 855734972.332.png 855734972.333.png 855734972.334.png 855734972.335.png 855734972.336.png 855734972.337.png 855734972.338.png 855734972.339.png 855734972.340.png 855734972.342.png 855734972.343.png 855734972.344.png 855734972.345.png 855734972.346.png 855734972.347.png 855734972.348.png 855734972.349.png 855734972.350.png 855734972.351.png 855734972.353.png 855734972.354.png 855734972.355.png 855734972.356.png 855734972.357.png 855734972.358.png 855734972.359.png 855734972.360.png 855734972.361.png 855734972.362.png 855734972.364.png 855734972.365.png 855734972.366.png 855734972.367.png 855734972.368.png 855734972.369.png 855734972.370.png 855734972.371.png 855734972.372.png 855734972.373.png 855734972.375.png 855734972.376.png 855734972.377.png 855734972.378.png 855734972.379.png 855734972.380.png 855734972.381.png 855734972.382.png 855734972.383.png 855734972.384.png 855734972.386.png 855734972.387.png 855734972.388.png 855734972.389.png 855734972.390.png 855734972.391.png 855734972.392.png 855734972.393.png 855734972.394.png 855734972.395.png 855734972.397.png 855734972.398.png 855734972.399.png 855734972.400.png 855734972.401.png 855734972.402.png 855734972.403.png 855734972.404.png 855734972.405.png 855734972.406.png 855734972.408.png 855734972.409.png 855734972.410.png 855734972.411.png 855734972.412.png 855734972.413.png 855734972.414.png 855734972.415.png 855734972.416.png 855734972.417.png 855734972.419.png 855734972.420.png 855734972.421.png 855734972.422.png 855734972.423.png 855734972.424.png 855734972.425.png 855734972.426.png 855734972.427.png 855734972.428.png 855734972.430.png 855734972.431.png 855734972.432.png 855734972.433.png 855734972.434.png 855734972.435.png 855734972.436.png 855734972.437.png 855734972.438.png 855734972.439.png 855734972.441.png 855734972.442.png 855734972.443.png 855734972.444.png 855734972.445.png 855734972.446.png 855734972.447.png 855734972.448.png 855734972.449.png 855734972.450.png 855734972.452.png 855734972.453.png 855734972.454.png 855734972.455.png 855734972.456.png 855734972.457.png 855734972.458.png 855734972.459.png 855734972.460.png 855734972.461.png 855734972.463.png 855734972.464.png 855734972.465.png 855734972.466.png 855734972.467.png 855734972.468.png 855734972.469.png 855734972.470.png 855734972.471.png 855734972.472.png 855734972.474.png 855734972.475.png 855734972.476.png 855734972.477.png 855734972.478.png 855734972.479.png 855734972.480.png 855734972.481.png 855734972.482.png 855734972.483.png 855734972.485.png 855734972.486.png 855734972.487.png 855734972.488.png 855734972.489.png 855734972.490.png 855734972.491.png 855734972.492.png 855734972.493.png 855734972.494.png 855734972.496.png 855734972.497.png 855734972.498.png 855734972.499.png 855734972.500.png 855734972.501.png 855734972.502.png 855734972.503.png 855734972.504.png 855734972.505.png 855734972.507.png 855734972.508.png 855734972.509.png 855734972.510.png 855734972.511.png 855734972.512.png 855734972.513.png 855734972.514.png 855734972.515.png 855734972.516.png 855734972.518.png 855734972.519.png 855734972.520.png 855734972.521.png 855734972.522.png 855734972.523.png 855734972.524.png 855734972.525.png 855734972.526.png 855734972.527.png 855734972.529.png 855734972.530.png 855734972.531.png 855734972.532.png 855734972.533.png 855734972.534.png 855734972.535.png 855734972.536.png 855734972.537.png 855734972.538.png 855734972.540.png 855734972.541.png 855734972.542.png 855734972.543.png 855734972.544.png 855734972.545.png 855734972.546.png 855734972.547.png 855734972.548.png 855734972.549.png 855734972.552.png 855734972.553.png 855734972.554.png 855734972.555.png 855734972.556.png 855734972.557.png 855734972.558.png 855734972.559.png 855734972.560.png 855734972.561.png 855734972.563.png 855734972.564.png 855734972.565.png 855734972.566.png 855734972.567.png 855734972.568.png 855734972.569.png 855734972.570.png 855734972.571.png 855734972.572.png 855734972.574.png 855734972.575.png 855734972.576.png 855734972.577.png 855734972.578.png 855734972.579.png 855734972.580.png 855734972.581.png 855734972.582.png 855734972.583.png 855734972.585.png 855734972.586.png 855734972.587.png 855734972.588.png 855734972.589.png 855734972.590.png 855734972.591.png 855734972.592.png 855734972.593.png 855734972.594.png 855734972.596.png 855734972.597.png 855734972.598.png 855734972.599.png 855734972.600.png 855734972.601.png 855734972.602.png 855734972.603.png 855734972.604.png 855734972.605.png 855734972.607.png 855734972.608.png 855734972.609.png 855734972.610.png 855734972.611.png 855734972.612.png 855734972.613.png 855734972.614.png 855734972.615.png 855734972.616.png 855734972.618.png 855734972.619.png 855734972.620.png 855734972.621.png 855734972.622.png 855734972.623.png 855734972.624.png 855734972.625.png 855734972.626.png 855734972.627.png 855734972.629.png
 
GENERAL INTEREST
is read with X = 0 to 7 corresponding to scroll
bars 1 to 8. The value of the setting is read (in
the range 0 to 63) and assigned to the vari-
able A3.
VB-variable
A1
Start-
condition
Acknow-
ledge
0
1
0
0
A3
A2
A1
0
chip sub-adresses 0 - 7
VB-variable
A2
I3
1
I2
1
I1
1
I0
1
CN3
0
CN2
CN1
CN0
Acknow-
ledge
DacValue = VScrollX.Value
Instruction bits (F)
converter number
The maximum value MAX of the vertical
scroll bars are set at 63 so there is no need to
convert this value. The three least significant
bits of A2 contain the code for the DAC num-
ber (0 to 7) which corresponds to that scroll
bar. Bit 4 is always set to a 0 and all of the
higher four bits are always set to a 1 (= 240
= Instruction F: sending data without an
address will always write to the same DAC).
The variable A1 contains bits 2,3 and 4 which
defines the chip sub-address. The upper 4
bits contain the fixed chip address 0100 (64 d ).
The three variables A1, A2 and A3 shown
in Figure 5 represent the data telegram sent
over the I 2 C bus to the TDA8444 every time a
scroll bar is moved. The routines required for
this are provided in iic.dll . These func-
tions are defined under GLOBAL. Sending
information over the I 2 C bus begins with
ErrorMsg = StartCon( LPT)
VB-variable
A3
Acknow-
ledge
Stop-
condition
D5
D4
D3
D2
D1
D0
databits for DAC
010006- 13
Figure 5. Format for programming the TDA8444.
The Software
The demonstration software
i2cservo.exe is a 16-bit program
and only runs under Win95/98 and
not under NT. The file iic.dll con-
tains software to interface to the PC
hardware and must be placed in the
same folder as the application or in
the system folder in Windows. Visual
Basic 3 was used to write the soft-
ware. Options in the menu list allow
selection of the parallel port LPT1
(378hex) or LPT2 (278hex) and also
the subaddress which is decoded on
the card by DIP switch S1. A 7 will
talk to an interface board which has
the all three switches connected to
+5 V while a 0 will talk to one which
has all three connected to ground.
The 8 scroll bars correspond to the
eight DAC output channels and
therefore the servos. Clicking and
dragging on one with the mouse will
cause the corresponding servo to
move. This simple executable
demonstration programme written in
Visual Basic 3 together with the
source code and the PCB layout files
are available as a free download
from the Elektor Electronics website.
This program is a good starting
point for developers and is relatively
easy to modify and expand.
When the program first starts the
default chip sub-address is set to 7
(all of the address pins are switched
to +5 V)
To send the I 2 C-Start condition, and then
ErrorMsg=Transmit(LPT,A1..A3)
is used to send the three bytes. After send-
ing the I 2 C bus will be released again by
using the stop command
ErrorMsg = StopCon(LPT)
COMPONENTS LIST
Any errors detected are assigned to five error
variables Er1 to Er5 and displayed in the
lower status window. See the box ‘Error
codes’ for a list of the possible error mes-
sages. For further information on the
TDA8444 a data sheet can be downloaded
from the Philips Semiconductors website at
http://www.semiconductors.com/acrobat/data
sheets/TDA8444_3.pdf
ChipAdress = Val(Text1.Text)
Resistors:
R1 = 100
R2 = 27k
and the port used is set to LPT2.
R3-R10 = 6k 04, 1%
R11-R18 = 18k
Lpt = Lpt2
7, 1%
R19 = 10k 4-way SIL array
LPT1 and LPT2 are defined in
Modul1.bas and have the values
&H378 and &H278 respectively. Both
or the settings (7 and LPT2) can of
course be redefined.
Capacitors:
C1 = 33nF
C2-C9,C16 = 100nF
C10 = 1µF 16V radial
C11-C15 = 470µF 16V radial
(010006-1)
Error codes
0
(SubText1_Change,
SubParallel1/2_Click).
Semiconductors:
IC1 = TDA8444
IC2-IC5 = NE556
IC6 = NE555
Error 0000
No failure detected
Next comes the check to determine
if the I 2 C interface is connected.
The I 2 C bus is not free.
1
Error 0001
2
Error 0002
No acknowledge received.
3
Error 0003
Unable to generate the stop
condition.
ErrorMsg=TestConnected(LPT)
Miscellaneous:
K1,K2 = 6-way mini-DIN socket
K3-K10 = 3-way pinheader
K11 = 2-way PCB terminal block,
lead pitch 5mm
Disk, project software, order code
010006-11
Voltage failure on the I 2 C
bus.
4
Error 0004
The corresponding failure message
(if any) will be output. During opera-
tion each movement of a scroll bar
The I 2 C Interface is not
connected.
5
Error 0005
6
Error 0006
An undefined error has
occurred.
SubVScrollX_Change()
9/2001
Elektor Electronics
25
855734972.630.png 855734972.631.png 855734972.632.png 855734972.633.png 855734972.634.png 855734972.635.png 855734972.636.png
 
Zgłoś jeśli naruszono regulamin