e011070.PDF

(1541 KB) Pobierz
GENERAL INTEREST
MIDI to Voltage
Converter
with 16 independent voltage sources
Design by J. Scherpenisse
Although MIDI (Musical Instrument Digital Interface) was originally
developed for controlling musical instruments, it can also be used for
numerous other purposes. In the circuit presented here, MIDI signals
are used to set a number of DC voltages. Up to 16 output voltages can
be independently adjusted.
70
Elektor Electronics
1/2001
855738059.550.png 855738059.661.png 855738059.747.png 855738059.758.png
GENERAL INTEREST
One PIC
with many converters
The circuit is built around a Microchip
PIC16F84 microcontroller and 1 to 16 Linear
Technology LTC1452 D/A converters (see Fig-
ure 1 ). There is thus a separate D/A converter
for each output, instead of a single D/A con-
verter multiplexed over several outputs. The
major advantage of this approach is that it
dispenses with the multiplexer and sample &
Nowadays, every computer has a
sound card, and the sound card
always has a MIDI interface. How-
ever, in most cases the MIDI inter-
face is not used. Most people control
their musical instruments using
MIDI commands (if they actually
have any musical instruments…).
A microprocessor forms an excellent
starting point for building a circuit
that responds to MIDI commands. In
this case, the author has developed
a circuit that allows the values of
several DC voltages to be set in a
simple manner. These could be used
for measurement applications, for
example. From 1 to 16 channels are
possible, with each channel having
its own D/A converter and an
adjustable output voltage ranging
from 0 to 5 V.
CLK
CS
5V
5V
IC5
IC20
8
8
2
1
3
4
7
6
4
DIN
CLK
VOUT
REF
DOUT
3
CS
5V
1
CS
CLK
6
7
2
DIN
R4
DOUT
REF
VOUT
5
LTC1452
LTC1452
5
R5
220
5V
5V
IC2
K1
2
8
6
IC6
IC19
8
8
1
4
D1
2
1
3
4
7
6
4
DIN
CLK
2
VOUT
REF
DOUT
3
CS
5
1N1418
1
CS
CLK
3
6
7
2
DOUT
REF
VOUT
DIN
3
7
5
6N138
5
5
LTC1452
LTC1452
5V
5V
IC7
IC18
8
8
2
1
3
4
7
6
4
DIN
CLK
VOUT
REF
DOUT
3
CS
1
CS
CLK
5V
6
7
2
DIN
DOUT
REF
VOUT
5
LTC1452
LTC1452
5
5V
5V
R1
1
4x 10k
R3
1
4x 10k
C3
IC8
IC17
R2
8
8
27p
2
1
3
4
7
6
4
DIN
CLK
5V
VOUT
REF
DOUT
3
14
CS
K2
2345
2345
1
CS
CLK
4
6
6
1
2
7
2
MCLR
RB0
RB1
RB2
RB3
RB4
RB5
RB6
RB7
DOUT
REF
VOUT
DIN
7
00
02
04
06
015
013
011
09
3
4
01
03
05
07
014
012
010
08
5
5
17
IC1
8
CLK
CS
LTC1452
5
6
LTC1452
RA0
18
9
7
8
RA1
5V
5V
1
PIC16
10
9
10
RA2
RA3
IC9
IC16
F84
8
8
2
11
11
12
3
12
2
1
3
4
7
13
14
6
4
RA4
DIN
CLK
VOUT
REF
DOUT
13
15
16
3
CS
17
18
1
OSC2
OSC1
CS
CLK
6
19
20
7
2
S1
1
2
3
4
5
15
16
S2
8
7
6
5
DOUT
REF
VOUT
DIN
X1
C1
5
LTC1452
LTC1452
5
C2
C3
4µ7
16V
5V
5V
8765
1234
27p
27p
IC10
IC15
10MHz
8
8
2
1
3
4
7
6
4
DIN
CLK
VOUT
REF
DOUT
3
5V
CS
1
CS
CLK
6
7
2
DIN
DOUT
REF
VOUT
R7
5
5
LTC1452
LTC1452
IC4
7
2
5V
5V
6
REF
IC11
IC14
TL061
8
8
3
2
1
3
4
7
6
4
R6
DIN
CLK
VOUT
REF
DOUT
4
3
CS
1
CS
CLK
6
7
2
DOUT
REF
VOUT
DIN
5
LTC1452
LTC1452
5
5V
5V
IC3
D2
1N4001
IC12
IC13
8
8
7 805
5V
2
1
3
4
7
6
4
DIN
CLK
VOUT
REF
DOUT
K3
3
3
CS
1
9...12V
18mA
CS
CLK
2
C5
C6
6
7
2
DIN
DOUT
REF
VOUT
REF
REF
1
470µ
25V
10µ
16V
5
5
LTC1452
LTC1452
000158 - 11
Figure 1. The core of the circuit consists of a PIC16F84 and up to 16 D/A converters.
1/2001
Elektor Electronics
71
855738059.001.png 855738059.012.png 855738059.023.png 855738059.034.png 855738059.045.png 855738059.056.png 855738059.067.png 855738059.078.png 855738059.089.png 855738059.099.png 855738059.110.png 855738059.121.png 855738059.132.png 855738059.143.png 855738059.154.png 855738059.165.png 855738059.176.png 855738059.187.png 855738059.198.png 855738059.209.png 855738059.220.png 855738059.231.png 855738059.242.png 855738059.253.png 855738059.264.png 855738059.275.png 855738059.286.png 855738059.297.png 855738059.308.png 855738059.319.png 855738059.330.png 855738059.341.png 855738059.352.png 855738059.363.png 855738059.374.png 855738059.385.png 855738059.396.png 855738059.407.png 855738059.418.png 855738059.429.png 855738059.440.png 855738059.451.png 855738059.462.png 855738059.473.png 855738059.484.png 855738059.495.png 855738059.506.png 855738059.517.png 855738059.528.png 855738059.539.png 855738059.551.png 855738059.562.png 855738059.573.png 855738059.584.png 855738059.595.png 855738059.606.png 855738059.617.png 855738059.628.png 855738059.639.png 855738059.650.png 855738059.662.png 855738059.673.png 855738059.684.png 855738059.695.png 855738059.706.png 855738059.717.png 855738059.728.png 855738059.738.png 855738059.745.png 855738059.746.png 855738059.748.png 855738059.749.png 855738059.750.png 855738059.751.png 855738059.752.png 855738059.753.png 855738059.754.png 855738059.755.png 855738059.756.png 855738059.757.png 855738059.759.png 855738059.760.png 855738059.761.png 855738059.762.png 855738059.763.png 855738059.764.png 855738059.765.png 855738059.766.png 855738059.767.png 855738059.768.png 855738059.002.png 855738059.003.png 855738059.004.png 855738059.005.png 855738059.006.png 855738059.007.png 855738059.008.png 855738059.009.png 855738059.010.png 855738059.011.png 855738059.013.png 855738059.014.png 855738059.015.png 855738059.016.png 855738059.017.png 855738059.018.png 855738059.019.png 855738059.020.png 855738059.021.png 855738059.022.png 855738059.024.png 855738059.025.png 855738059.026.png 855738059.027.png 855738059.028.png 855738059.029.png 855738059.030.png 855738059.031.png 855738059.032.png 855738059.033.png 855738059.035.png 855738059.036.png 855738059.037.png 855738059.038.png 855738059.039.png 855738059.040.png 855738059.041.png 855738059.042.png 855738059.043.png 855738059.044.png 855738059.046.png 855738059.047.png 855738059.048.png 855738059.049.png 855738059.050.png 855738059.051.png 855738059.052.png 855738059.053.png 855738059.054.png 855738059.055.png 855738059.057.png 855738059.058.png 855738059.059.png 855738059.060.png 855738059.061.png 855738059.062.png 855738059.063.png 855738059.064.png 855738059.065.png 855738059.066.png 855738059.068.png 855738059.069.png 855738059.070.png 855738059.071.png 855738059.072.png 855738059.073.png 855738059.074.png 855738059.075.png 855738059.076.png 855738059.077.png 855738059.079.png 855738059.080.png 855738059.081.png 855738059.082.png 855738059.083.png 855738059.084.png 855738059.085.png 855738059.086.png 855738059.087.png 855738059.088.png 855738059.090.png 855738059.091.png
 
GENERAL INTEREST
the last (16 th ) converter are sent out
first and the data for the first con-
verter are sent out last, it is possible
to omit one or more converters with-
out making any changes to the
remaining hardware or software.
The LTC1452 converter has a resolu-
tion of 12 bits, of which only 7 bits
are used here. This results in 128
steps, which means that the step
size is 39 mV when the maximum
output voltage is 5 V. Standard MIDI
controller values have seven data
bits. However, it is possible to use
14-bit controllers with MIDI; this
requires two controller addresses,
hold circuits. The latter, in particular, are
rather sensitive with regard to correct timing
of the sample and hold signals.
The LTC1452 has a serial shift register at its
input, which is followed by a latch register
that is coupled to the actual converter. The
shift register also has a serial output, so sev-
eral converter ICs can simply be connected in
series.
With a supply voltage of +5 V, the LTC1452
output can directly deliver a voltage between
0 and 5 V. For higher output voltages or heavy
loads, a buffer must be added.
The interrupt routine in the processor scans
the MIDI input signal to see if any ‘control-
change’ messages with controller numbers
between 48 and 64 (for example)
appear on channel 1. If such a mes-
sage is found, the ‘value’ parameter
(the third byte of the message) is
stored in a table. In the time
between interrupts, the main pro-
gram loop continuously sends the
contents of this table, bit by bit, to
the converter ICs via output port B1
of the processor. Following each data
bit, a shift pulse is generated on port
B2. After all data bits for the 16 con-
verters have been output, a latch
pulse is sent via B2. This transfers
the data in all 16 converters to their
internal latches. Since the data for
MIDI in brief
For true connoisseurs of music electronics, no further explanation of MIDI is necessary.
However, a brief explanation of the structure and function of the control-change messages
is in order for readers who are not fully familiar with MIDI.
MIDI (Musical Instrument Digital Interface) is a protocol that transfers data from a trans-
mitter (MIDI out) to a receiver (MIDI in) via a serial connection. In principle, MIDI is a sys-
tem for unidirectional data traffic. Due to their musical (synthesiser) origins, these signals
were designed as messages that enable or disable a musical note, change a synthesiser set-
ting, modify a volume level or apply a frequency shift to all notes of a synthesiser (‘pitch
blend’).
A MIDI message is usually made up of three 8-bit bytes. The first byte of each message
(the status byte) indicates the message type and the MIDI channel for which the message is
intended. There are 16 MIDI channels, so several synthesisers or several sounds within a
single synthesiser can be separately controlled by a single computer using a single MIDI
connection.
One group of messages is called ‘control change’. These messages regulate controllers
within a device (such as a synthesiser) for functions such as pitch blend, volume and porta-
mento. When other types of devices (such as effects generators and reverb or delay units)
are controlled via MIDI, control change messages can be used to modify delay times or
reverb settings. A number of control change messages are predefined for a large number of
synthesisers and accessory equipment.
The second byte of a control change message can address up to 127 controllers (the
MSB of the second byte is always ‘0’). The third byte of the message contains the value that
is sent to the controller in question. Here again the values range between 0 and 127, since
the MSB of the third byte is also ‘0’.
Only the first byte of a message has a ‘1’ in the MSB position. This means that the status
byte can always be distinguished from the following bytes.
COMPONENTS LIST
Resistors:
R1,R3 = SIL array 4 x 10k
R2 = 33k
R4 = 470
R5 = 220
R6,R7 = 10k
Capacitors:
C1 = 4
F7 16V radial
C2,C3 = 27pF
C4,C7-C10 = 100nF
C5 = 470 µ F 25V radial
C6 = 10
µ
µ
F 16V radial
Semiconductors:
D1 = 1N4148
D2 = 1N4001
IC1 = programmed PIC16F84-
10/p, order code 000158-41 ,
see Readers Services page
IC2 = 6N138
IC3 = 7805
IC4 = TL061
IC5-IC20 = LTC1452CN8
The control change messages used in this circuit thus appear as follows:
10110000
0ccccccc
0vvvvvvv
Miscellaneous:
K1 = 5-way DIN socket, PCB
mount, receptacles at 180 °
K2 = 20-way boxheader, angled
pins
K3 = mains adapter socket, PCB
mount
S1,S2 = 4-way DIP switch
X1 = 10MHz quartz crystal
Disk, contains source code and hex
code files, order code 000158-
11 , see Readers Services page
0 0 0 0 = channel 1
0 1 1 = control change
1 = status byte
controller number
controller value
000158 - 12
A MIDI message is always transmitted at a bit rate of 31.25 kbit/s, so one bit takes 32 µs.
Each byte is preceded by a start bit (always ‘0’) and followed by a stop bit (always ‘1’).
The idle value between bytes is also ‘1’.
A 3-byte message thus contains 3 × 10 = 30 bits and thus takes 30 × 32 µs to send
(approximately 1 ms in total).
In terms of hardware, MIDI connections are always current loops, with optocouplers
used in the receiver to avoid ground loops.
72
Elektor Electronics
1/2001
855738059.092.png 855738059.093.png 855738059.094.png 855738059.095.png 855738059.096.png 855738059.097.png
GENERAL INTEREST
Program structure
The processor used in this circuit comes from the Microchip Inc. PIC series ( http://www.microchipinc.com ).
The PIC16F84 has 1 k words of 14-bit flash program memory, 68 bytes of data memory, 1 timer, 13 I/O ports and several interrupt
options. The package has only 18 pins.
The software for the PIC16F84 is written in the CVSAM language from TechTools. This assembler language can actually be regarded as
a collection of macros that translate single source code statements into one, two, three or sometimes even four true processor instruc-
tions. The new instructions that arise in this manner closely resemble standard instructions for ‘big’ microprocessors and are very easy to
use. The actual instruction set of the PIC processors is also understood and correctly assembled by the CVSAM. In some cases, using the
original instruction set is slightly more efficient. This can be a consideration with real-time applications and in case of interrupts that must
be handled as quickly as possible. On account of the readability of programs written in CVSAM, the author has chosen this language in
preference to the Microchip assembler (MPASM).
The optocoupler is connected to port B0, which is the standard interrupt pin. The start bit of each received byte thus triggers an interrupt.
The interrupt routine polls port B0 two times in rapid succession, in order to eliminate any noise pulses that may be present. If the start bit is
recognised, the port B0 interrupt is disabled and a new interrupt is enabled, namely that of the timer. The timer is then started, so that an
interrupt occurs again after approximately 32 µs. In the subsequent routine, the value at the B0 input is stored and the timer is restarted. In
this manner, the eight bits of the byte are read in. After this, the B0 interrupt is re-enabled, to allow the following byte to be received.
After each byte has been received, a test is made to see what type of byte it is. If it is status byte for a control change message, a switch
is set to cause the following byte to be interpreted as a controller number. Following that byte, the switch is set to yet another value, so
that the byte following the controller number byte will be seen as a controller value. Should a status byte be received at an incorrect time
(when a data byte is expected), the bytes received up to that point are ignored and the cycle starts again from the beginning.
Once all data for a controller have been received, the table is updated with the current values.
As long as no interrupt routine is active, the main program loop looks after sending the data in the table to the D/A converters. The
cycle time of the main loop is approximately 620 µs.
H1
IC5
IC20
IC2
IC6
IC19
IC7
IC18
IC8
IC17
IC1
IC9
IC16
IC10
IC15
IC4
IC11
IC14
IC12
IC13
H3
Figure 2. The single-sided printed circuit board for this circuit holds all components and connectors.
1/2001
Elektor Electronics
73
855738059.098.png 855738059.100.png 855738059.101.png 855738059.102.png 855738059.103.png 855738059.104.png 855738059.105.png 855738059.106.png 855738059.107.png 855738059.108.png 855738059.109.png 855738059.111.png 855738059.112.png 855738059.113.png 855738059.114.png 855738059.115.png 855738059.116.png 855738059.117.png 855738059.118.png 855738059.119.png 855738059.120.png 855738059.122.png 855738059.123.png 855738059.124.png 855738059.125.png 855738059.126.png 855738059.127.png 855738059.128.png 855738059.129.png 855738059.130.png 855738059.131.png 855738059.133.png 855738059.134.png 855738059.135.png 855738059.136.png 855738059.137.png 855738059.138.png 855738059.139.png 855738059.140.png 855738059.141.png 855738059.142.png 855738059.144.png 855738059.145.png 855738059.146.png 855738059.147.png 855738059.148.png 855738059.149.png 855738059.150.png 855738059.151.png 855738059.152.png 855738059.153.png 855738059.155.png 855738059.156.png 855738059.157.png 855738059.158.png 855738059.159.png 855738059.160.png 855738059.161.png 855738059.162.png 855738059.163.png 855738059.164.png 855738059.166.png 855738059.167.png 855738059.168.png 855738059.169.png 855738059.170.png 855738059.171.png 855738059.172.png 855738059.173.png 855738059.174.png 855738059.175.png 855738059.177.png 855738059.178.png 855738059.179.png 855738059.180.png 855738059.181.png 855738059.182.png 855738059.183.png 855738059.184.png 855738059.185.png 855738059.186.png 855738059.188.png 855738059.189.png 855738059.190.png 855738059.191.png 855738059.192.png 855738059.193.png 855738059.194.png 855738059.195.png 855738059.196.png 855738059.197.png 855738059.199.png 855738059.200.png 855738059.201.png 855738059.202.png 855738059.203.png 855738059.204.png 855738059.205.png 855738059.206.png 855738059.207.png 855738059.208.png 855738059.210.png 855738059.211.png 855738059.212.png 855738059.213.png 855738059.214.png 855738059.215.png 855738059.216.png 855738059.217.png 855738059.218.png 855738059.219.png 855738059.221.png 855738059.222.png 855738059.223.png 855738059.224.png 855738059.225.png 855738059.226.png 855738059.227.png 855738059.228.png 855738059.229.png 855738059.230.png 855738059.232.png 855738059.233.png 855738059.234.png 855738059.235.png 855738059.236.png 855738059.237.png 855738059.238.png 855738059.239.png 855738059.240.png 855738059.241.png 855738059.243.png 855738059.244.png 855738059.245.png 855738059.246.png 855738059.247.png 855738059.248.png 855738059.249.png 855738059.250.png 855738059.251.png 855738059.252.png 855738059.254.png 855738059.255.png 855738059.256.png 855738059.257.png 855738059.258.png 855738059.259.png 855738059.260.png 855738059.261.png 855738059.262.png 855738059.263.png 855738059.265.png 855738059.266.png 855738059.267.png 855738059.268.png 855738059.269.png 855738059.270.png 855738059.271.png 855738059.272.png 855738059.273.png 855738059.274.png 855738059.276.png 855738059.277.png 855738059.278.png 855738059.279.png 855738059.280.png 855738059.281.png 855738059.282.png 855738059.283.png 855738059.284.png 855738059.285.png 855738059.287.png 855738059.288.png 855738059.289.png 855738059.290.png 855738059.291.png 855738059.292.png 855738059.293.png 855738059.294.png 855738059.295.png 855738059.296.png 855738059.298.png 855738059.299.png 855738059.300.png 855738059.301.png 855738059.302.png 855738059.303.png 855738059.304.png 855738059.305.png 855738059.306.png 855738059.307.png 855738059.309.png 855738059.310.png 855738059.311.png 855738059.312.png 855738059.313.png 855738059.314.png 855738059.315.png 855738059.316.png 855738059.317.png 855738059.318.png 855738059.320.png 855738059.321.png 855738059.322.png 855738059.323.png 855738059.324.png 855738059.325.png 855738059.326.png 855738059.327.png 855738059.328.png 855738059.329.png 855738059.331.png 855738059.332.png 855738059.333.png 855738059.334.png 855738059.335.png 855738059.336.png 855738059.337.png 855738059.338.png 855738059.339.png 855738059.340.png 855738059.342.png 855738059.343.png 855738059.344.png 855738059.345.png 855738059.346.png 855738059.347.png 855738059.348.png 855738059.349.png 855738059.350.png 855738059.351.png 855738059.353.png 855738059.354.png 855738059.355.png 855738059.356.png 855738059.357.png 855738059.358.png 855738059.359.png 855738059.360.png 855738059.361.png 855738059.362.png 855738059.364.png 855738059.365.png 855738059.366.png 855738059.367.png 855738059.368.png 855738059.369.png 855738059.370.png 855738059.371.png 855738059.372.png 855738059.373.png 855738059.375.png 855738059.376.png 855738059.377.png 855738059.378.png 855738059.379.png 855738059.380.png 855738059.381.png 855738059.382.png 855738059.383.png 855738059.384.png 855738059.386.png 855738059.387.png 855738059.388.png 855738059.389.png 855738059.390.png 855738059.391.png 855738059.392.png 855738059.393.png 855738059.394.png 855738059.395.png 855738059.397.png 855738059.398.png 855738059.399.png 855738059.400.png 855738059.401.png 855738059.402.png 855738059.403.png 855738059.404.png 855738059.405.png 855738059.406.png 855738059.408.png 855738059.409.png 855738059.410.png 855738059.411.png 855738059.412.png 855738059.413.png 855738059.414.png 855738059.415.png 855738059.416.png 855738059.417.png 855738059.419.png 855738059.420.png 855738059.421.png 855738059.422.png 855738059.423.png 855738059.424.png 855738059.425.png 855738059.426.png 855738059.427.png 855738059.428.png 855738059.430.png 855738059.431.png 855738059.432.png 855738059.433.png 855738059.434.png 855738059.435.png 855738059.436.png 855738059.437.png 855738059.438.png 855738059.439.png 855738059.441.png 855738059.442.png 855738059.443.png 855738059.444.png 855738059.445.png 855738059.446.png 855738059.447.png 855738059.448.png 855738059.449.png 855738059.450.png 855738059.452.png 855738059.453.png 855738059.454.png 855738059.455.png 855738059.456.png 855738059.457.png 855738059.458.png 855738059.459.png 855738059.460.png 855738059.461.png 855738059.463.png 855738059.464.png 855738059.465.png 855738059.466.png 855738059.467.png 855738059.468.png 855738059.469.png 855738059.470.png 855738059.471.png 855738059.472.png 855738059.474.png 855738059.475.png 855738059.476.png 855738059.477.png 855738059.478.png 855738059.479.png 855738059.480.png 855738059.481.png 855738059.482.png 855738059.483.png 855738059.485.png 855738059.486.png 855738059.487.png 855738059.488.png 855738059.489.png 855738059.490.png 855738059.491.png 855738059.492.png 855738059.493.png 855738059.494.png 855738059.496.png 855738059.497.png 855738059.498.png 855738059.499.png 855738059.500.png 855738059.501.png 855738059.502.png 855738059.503.png 855738059.504.png 855738059.505.png 855738059.507.png 855738059.508.png 855738059.509.png 855738059.510.png 855738059.511.png 855738059.512.png 855738059.513.png 855738059.514.png 855738059.515.png 855738059.516.png 855738059.518.png 855738059.519.png 855738059.520.png 855738059.521.png 855738059.522.png 855738059.523.png 855738059.524.png 855738059.525.png 855738059.526.png 855738059.527.png 855738059.529.png 855738059.530.png 855738059.531.png 855738059.532.png 855738059.533.png 855738059.534.png 855738059.535.png 855738059.536.png 855738059.537.png 855738059.538.png 855738059.540.png 855738059.541.png 855738059.542.png 855738059.543.png 855738059.544.png 855738059.545.png 855738059.546.png 855738059.547.png 855738059.548.png 855738059.549.png 855738059.552.png 855738059.553.png 855738059.554.png 855738059.555.png 855738059.556.png 855738059.557.png 855738059.558.png 855738059.559.png 855738059.560.png 855738059.561.png 855738059.563.png 855738059.564.png 855738059.565.png 855738059.566.png 855738059.567.png 855738059.568.png 855738059.569.png 855738059.570.png 855738059.571.png 855738059.572.png 855738059.574.png 855738059.575.png 855738059.576.png 855738059.577.png 855738059.578.png 855738059.579.png 855738059.580.png 855738059.581.png 855738059.582.png 855738059.583.png 855738059.585.png 855738059.586.png 855738059.587.png 855738059.588.png 855738059.589.png 855738059.590.png 855738059.591.png 855738059.592.png 855738059.593.png 855738059.594.png 855738059.596.png 855738059.597.png 855738059.598.png 855738059.599.png 855738059.600.png 855738059.601.png 855738059.602.png 855738059.603.png 855738059.604.png 855738059.605.png 855738059.607.png 855738059.608.png 855738059.609.png 855738059.610.png 855738059.611.png 855738059.612.png 855738059.613.png 855738059.614.png 855738059.615.png 855738059.616.png 855738059.618.png 855738059.619.png 855738059.620.png 855738059.621.png 855738059.622.png 855738059.623.png 855738059.624.png 855738059.625.png 855738059.626.png 855738059.627.png 855738059.629.png 855738059.630.png 855738059.631.png 855738059.632.png 855738059.633.png 855738059.634.png 855738059.635.png 855738059.636.png 855738059.637.png 855738059.638.png 855738059.640.png 855738059.641.png 855738059.642.png 855738059.643.png 855738059.644.png 855738059.645.png 855738059.646.png 855738059.647.png 855738059.648.png 855738059.649.png 855738059.651.png 855738059.652.png 855738059.653.png 855738059.654.png 855738059.655.png 855738059.656.png 855738059.657.png 855738059.658.png 855738059.659.png 855738059.660.png 855738059.663.png 855738059.664.png 855738059.665.png 855738059.666.png 855738059.667.png 855738059.668.png 855738059.669.png 855738059.670.png 855738059.671.png 855738059.672.png 855738059.674.png 855738059.675.png 855738059.676.png 855738059.677.png 855738059.678.png 855738059.679.png 855738059.680.png 855738059.681.png 855738059.682.png 855738059.683.png 855738059.685.png 855738059.686.png 855738059.687.png 855738059.688.png 855738059.689.png 855738059.690.png 855738059.691.png 855738059.692.png 855738059.693.png 855738059.694.png 855738059.696.png 855738059.697.png 855738059.698.png 855738059.699.png 855738059.700.png 855738059.701.png 855738059.702.png 855738059.703.png 855738059.704.png 855738059.705.png 855738059.707.png 855738059.708.png 855738059.709.png 855738059.710.png 855738059.711.png 855738059.712.png 855738059.713.png 855738059.714.png 855738059.715.png 855738059.716.png 855738059.718.png 855738059.719.png 855738059.720.png 855738059.721.png 855738059.722.png 855738059.723.png 855738059.724.png 855738059.725.png 855738059.726.png 855738059.727.png 855738059.729.png 855738059.730.png 855738059.731.png 855738059.732.png 855738059.733.png 855738059.734.png 855738059.735.png 855738059.736.png
 
GENERAL INTEREST
and thus two control-change messages. This
capability is not (yet) implemented. Conse-
quently, in this version only seven bits are
sent for each DAC, and they must be padded
with five null bits and five extra shift pulses
per converter.
The reference voltages for the converters are
set to a value of 2.5 V, using the voltage
divider R7/R6 and the buffer IC4. This yields a
maximum output voltage of 5 V. The output
signals from all the converters are available
on connector K1.
Four DIP switches are connected to port A of
the processor. These can be used to set the
controller numbers. The binary value of port
A (four bits, with A0 = LSB) is shifted three
bits to the left when the supply voltage is
switched on. This yields steps of 8, thus 0, 8,
16, …, 120. This value is then used as the
starting value for the controller numbers to
which the circuit will respond. If all switches
are closed, the circuit starts with controller
numbers beginning at zero. If the switch for
RA0 is open (‘1’), the controller numbers
begin with 8.
The MIDI channel number can be set using
the DIP switches connected to ports
RB4–RB7. This port is also read on power-up.
If all four switches are closed (‘0000’), MIDI
channel 1 is selected. When all four
switches are open (‘1111’), MIDI
channel 16 is selected.
The MIDI signal is fed to port RB0 of
the PIC via DIN socket K1. Optocou-
pler IC2 provides electrical isolation
between the MIDI source and the
circuit, as is common with MIDI
equipment.
A 10-MHz crystal with two capaci-
tors is provided to generate the clock
signal for the PIC.
There is also a 5-V regulator on the
circuit board, so a simple unregu-
lated mains adapter that provides
9–12 V (20 mA max.) can be used to
power the circuit.
of wire bridges, especially around
the converter ICs. Mount as many
converters as you need, starting
with the first converter (IC5).
A programmed PIC for this circuit is
available from Readers Services
under order number 000158-41. If
you want to program your own
16F84, you can download the source
code file from the Elektor Electronics
Internet site ( http://www.elektor-
electronics.co.uk ), but it is also avail-
able on a floppy disk under order
number 000158-11 for those few
readers left with no access to the
Internet.
Other than this, anyone with a bit of
soldering experience should not
have any trouble assembling the cir-
cuit. All connectors are located at
one edge of the board, so it can eas-
ily be fitted into a suitable enclosure.
A standard MIDI interconnect cable
can be used to connect the circuit to
the equipment that supplies the con-
trol data.
Construction
The printed circuit board layout
shown in Figure 2 has been devel-
oped for this circuit. The board is not
available from Readers Services, but
since the layout is single sided, it
should not be too difficult for you to
make the board yourself. When
mounting the components, pay
attention to the fairly large number
(000158-1)
855738059.737.png 855738059.739.png 855738059.740.png 855738059.741.png 855738059.742.png 855738059.743.png 855738059.744.png
Zgłoś jeśli naruszono regulamin