This is only a preview of the December 2007 issue of Silicon Chip. You can view 32 of the 112 pages in the full issue, including the advertisments. For full access, purchase the issue for $10.00 or subscribe for access to the latest issues. Items relevant to "Infrared Audio Headphone Link For TV":
Items relevant to "PIC-Based Water-Tank Level Meter; Pt.2":
Items relevant to "Playback Adaptor For CD-ROM Drives; Pt.2":
Purchase a printed copy of this issue for $10.00. |
By MAURO GRASSI
Playback adaptor for
CD-ROM drives; Pt.2
Last month, we published the circuit details
of our new CD-ROM Player Adaptor and
described its operation. This month, we
show you how to build it.
to be installed. Before installing any
parts though, it’s a good idea to inspect
the PC board for hairline cracks in the
tracks or shorts. Some of the tracks are
very fine and quite close together, so
check these carefully.
T
Installing the wire links
O KEEP COSTS DOWN, we’ve
designed a single-sided PC board
for this project. This board is coded
07112071 and measures 136 x 97mm.
The complete board and the CD-ROM
drives could optionally be encased in
90 Silicon Chip
a plastic case or mini-tower computer
case, along with the power supply.
Because it’s single-sided, the PC
board is somewhat larger than a double-sided board would be and there
are quite a few wire links that have
Fig.2 shows the locations of the wire
links and these should all be installed
first. Because some of these links are
quite close together, it’s essential that
they be perfectly straight so that they
siliconchip.com.au
Fig.2: the first job in the assembly is to install all the wire links as shown here.
Make sure that these links are straight, to prevent shorts – see text.
Programming The Microcontroller
don’t short together.
The best way to straighten the link
wire is to stretch it slightly by clamping one end in a vice and pulling on
the other end using a pair of pliers.
Each wire link can then be cut to length
and its ends bent down at right-angles
using needle-nose pliers before mounting it on the PC board.
Once you’ve completed this task,
you’re ready to install the remaining
parts. Fig.3 shows the parts layout on
the board.
Start with the resistors, taking care
to ensure that the correct value is
used at each location. Table 1 shows
the resistor colour codes but it’s also
a good idea to check each one using a
digital multimeter before soldering it
to the PC board.
Next, solder in protection diode D1,
making sure that it is oriented correctly, then install the small tactile switch
(S3). The latter only fits correctly if it
is the right way around.
The next step is to solder in the 40siliconchip.com.au
IF YOU PURCHASE a kit, then the microcontroller will be supplied preprogrammed. If not, then you will have to program it yourself.
To do this, you will need to install both IC4 & IC5 (MAX232), as well as
the other two logic ICs. You then load the hex file into Pony Prog 2000 and
write to flash. If you don’t already have this program, it is available as a
free download from www.lancos.com/ppwin95.html
You will need to first flick switch S1 and make sure the orange LED lights
up. The micro is then ready to be programmed. We should also mention
that if you are using Pony Prog 2000, you must change the setting under
Setup -> Interface Setup and make sure that the only box that is ticked is
the “Invert Reset” box. Then select the correct device by going to Device ->
AVR -> Atmega8515.
Prior to programming, Pony Prog 2000 needs to be calibrated for correct
timing. To do this, simply go to Setup -> Calibration. This only needs to be
done the first time you run Pony Prog 2000 on a new computer.
Now choose File -> Open Program (FLASH) File and select your hex file.
Go to Command -> Program (FLASH) and Pony Prog 2000 should start
programming your micro. Once programming is complete, you should flick
switch S1 so that the orange LED goes out and then the firmware should
start running.
pin IC socket for the microcontroller,
plus the two 14-pin and two 16-pin
DIP sockets for the other ICs. Note that
only IC1, IC2 and IC3 are required for
normal operation, while IC4 and IC5
are required only if you are planning to
program the micro via this board. Make
sure that the sockets are all oriented
correctly – ie, with their notched ends
oriented as shown on Fig.3.
The TO-220 regulator is next on
the list. As shown, this part is fitted
with a small heatsink and is mounted
horizontally on the PC board.
December 2007 91
This view shows the fully assembled prototype PC board. Note that the two MAX232 ICs and the DB9 socket
(CON3) are only necessary if you intend programming the microcontroller on the board. If you buy a kit, the
microcontroller will be supplied pre-programmed. Note also that trimpot VR1 (contrast) and several wire links
were added to the board after this photo was taken.
The correct procedure here is to
first bend the regulator’s leads down
though 90°, exactly 5mm from its body.
That done, the device and its heatsink
are fastened to the PC board using an
M3 x 10mm screw and nut. The leads
are then soldered.
Don’t solder the leads before bolting the device to the PC board. If you
do, you could stress and break the PC
tracks as the device is tightened down
on the board.
Trimpot VR1 can go in next, followed by the 2.5mm DC socket (CON6)
and the electrolytic capacitors. The
latter are polarised, so make sure they
go in the right way around.
Now solder in the 100nF bypass
capacitors. Take particular care with
the 100nF capacitor immediately to
the left of IC1. It straddles a couple
of wire links and should be mounted
proud of the board so that its leads
don’t short against these links.
The other 100nF capacitors can be
pushed all the way down onto the
board.
The five LEDs (LEDs1-5) and the
infrared receiver module (IRD1) can
now be installed. As shown in the
photos, the LEDs all go in with their
leads bent at right angles and are
mounted about 5mm proud of the PC
board. A cardboard spacer cut to 5mm
makes a handy gauge when it comes
to bending the LED leads and spacing
them evenly off the board, so that they
all line up.
Take care to ensure that the LEDs
all go in the right way around. Just remember that the anode lead is always
the longer of the two.
IRD1 can be mounted so that its lens
lines up with the centres of the LEDs. It
must be oriented so that its lens faces
out from the PC board.
Installing the headers
The next job is to solder in the 16-
Table 2: Capacitor Codes
Value mF Code IEC Code EIA Code
100nF 0.1mF
100n
104
22pF NA 22p
22
Table 1: Resistor Colour Codes
o
o
o
o
o
No.
1
5
1
1
92 Silicon Chip
Value
1kW
470W
100W
51W
4-Band Code (1%)
brown black red brown
yellow violet brown brown
brown black brown brown
green brown black brown
5-Band Code (1%)
brown black black brown brown
yellow violet black black brown
brown black black black brown
green brown black gold brown
siliconchip.com.au
Fig.3: after the links are in, install the remaining parts on the PC board as
shown here. Take care to ensure that all polarised parts, including the IDC
headers, are correctly oriented – see text.
pin and 40-pin IDC headers. Pin 1 of
each of these is indicated by an arrow
on the side of the header and this corresponds to the square pad on the PC
board. Be sure to get them the right
way around.
In each case, it’s a good idea to
initially solder just two pins of the
header and then check that it is sitting
flat against the PC board. After that,
it’s a routine job to solder the rest of
the pins.
Finally, complete the PC board assembly by installing the 7.3728MHz
crystal (it can go in either way), the
two 22pF capacitors, the DB9 serial
port connector (CON3), the two stereo
jack sockets (CON8 & CON10), the two
4-way SIL pin headers (CON7 & CON9)
and the two toggle switches.
Fig.4: this diagram
shows how to connect
the Altronics Z-7013 LCD
module to the 16-pin IDC
socket. Note that pins
15 & 16 (the backlight
connections) are adjacent
to pin 1. Pin 15 is the
anode connection, while
pin 16 is the cathode.
Connecting the LCD module
The LCD module to use must conform to the Hitachi HD44780 industry
standard. This has an interface consisting of 16 or 14 lines, depending on how
the LED backlight is connected.
A 16-way (or 14-way) ribbon cable
is used to make the connection to the
siliconchip.com.au
December 2007 93
Fig.5: connect
the Jaycar LCD
modules as
shown in this
wiring diagram.
Note particularly
that the wires
from pins 1 & 2
of header CON2
are transposed at
the LCD module
(ie, pin 1 goes to
pin 2, while pin
2 goes to pin 1).
Fig.6: assigning the buttons on the
remote for the various functions is
easy – just follow the prompts on the
LCD readout. This is the prompt for
assigning the “Volume Up” button.
In particular, note that pin 1 on the
Jaycar modules is the +5V connection,
while pin 2 is the 0V connection. It’s
the other way around on the Altronics
module, where pin 1 is 0V and pin 2
is +5V.
Testing & troubleshooting
LCD module and this is terminated
at the other end in a 16-way IDC line
socket, with the red stripe on the cable
going to pin 1. This end then plugs
directly into the 16-way IDC header
on the PC board.
Fig.4 shows the connections to the
Altronics Z-7013 LCD module. This
device has 16 pins all in one line along
the bottom edge of the board (although
pins 15 & 16 are adjacent to pin 1).
Alternatively, the Jaycar QP-5516
and QP-5518 LCD modules each have
a 2 x 7-pin arrangement at one end;
ie, there are only 14 connections. The
backlight connections are made on the
module itself, so pins 15 & 16 of CON2
are not connected in this case. Fig.5
shows the wiring connections for the
specified Jaycar modules.
The audio output at the back of a CD-ROM
drives can be connected to CON7 or CON9 via
a standard 4-way cable fitted with matching
headers. These cables are readily available from
computer stores or you can make your own.
94 Silicon Chip
Great care has been taken to ensure
that the firmware is free from bugs but
we cannot guarantee that it will work
with every CD-ROM drive. We did test
the board with six different CD-ROM
drives and it worked well.
The only problem was that two
of the drives did not respond to the
volume change command. However,
we are not sure that these two drives
were actually functioning correctly all
of the time, as they appeared to have
intermittent faults.
Whichever drive you want to use for
this project, make sure it is an ATAPI
device (check that the IDC connector
on the back of the drive has 40 pins,
as opposed to 50 pins for a SCSI connector). Note also that the adaptor
will not work with some smaller form
factor CD-ROM drives which have 44pin connectors (akin to the 2.5-inch
notebook hard drives).
Before plugging in the micro (IC1),
the first thing to do is to check the
power supply rails. To do this, first
connect a 9-12V DC plugpack to the
DC socket (CON6) and switch on. That
done, check that the OUT terminal of
REG1 is at +5V with respect to ground.
Fig.7: 4-way headers CON7 &
CON9 are connected to the two
3.5mm stereo jack sockets. This
makes it easy to connect to the
CD-ROM drive audio outputs via
a standard stereo jack plug.
siliconchip.com.au
Table 3: CON2 Pin Assignments
Pin
Pin Name
1
VSS
Supply rail for module;
typically GND
2
VDD
Supply rail for module;
typically +5V
3
V0
Set LCD contrast
4
RS
RS = 0 selects instruction;
RS = 1 selects data
5
R/W
R/W = 0 selects write;
R/W = 1 selects read
6
E
E = 1 selects the LCD
module
7
D0
Data bus bit 0
8
D1
Data bus bit 1
9
D2
Data bus bit 2
10
D3
Data bus bit 3
11
D4
Data bus bit 4
12
D5
Data bus bit 5
13
D6
Data bus bit 6
14
D7
Data bus bit 7
15
A
LED backlight anode
16
K
LED backlight cathode
Parts List: CD-ROM Controller
Description
Similarly, you should be able to measure +5V on pin 40 of the 40-pin socket,
while pin 20 should be at 0V.
If these checks are OK, switch off
and plug in the micro. Make sure that
this device is oriented correctly and
that all its pins go into the socket. In
particular, take care to ensure that
none of the pins are folded back under
the device.
That done, set trimpot VR1 to midrange and switch on again. Check that
the LCD module initialises correctly,
then adjust VR1 for optimum display
contrast.
Remote control functions
The firmware has an option that
allows you to use any RC5 protocol
remote control. That means that you
can use virtually any universal remote
control plus most of the remotes that
are commonly used with TV sets, VCRs
and DVD players
The first step is to assign the buttons
that will control the various functions.
To do this, you first need to press and
hold the “Remote Program” button
(S3) while the device resets. To get
the device to reset, you toggle switch
S1 so that the orange LED lights and
then toggle it again to turn the LED
siliconchip.com.au
1 PC board, code 07112071, 136
x 97mm
1 16x2 backlit LCD module (Jaycar
QP-5516 or QP-5518, Altronics
Z-7013)
1 PC-mount 40-pin IDC header
(CON1) (Jaycar PP-1114,
Altronics P-5040)
1 PC-mount 90° 16-pin IDC header
(CON2) (Jaycar PP-1122,
Altronics P-5066)
1 PC-mount DB9 female RS232 socket (CON3) (Altronics
P-3050, Jaycar PS-0804)
(optional for programming)
1 28-pin or 40-pin SIL header strip
(Jaycar HM-3211, Altronics
P-5430)
1 16-way IDC ribbon cable (to
connect LCD module, length to
suit) (Jaycar WM-4502, Altronics
W-2616)
1 40-way IDE HDD cable (to
connect CD-ROM drives)
1 16-way IDC line socket (Jaycar
PS-0985, Altronics P-3516)
2 3.5mm stereo sockets, PC-mount
(CON8,10) (Altronics P-0094)
1 2.5mm DC socket, PC-mount
(CON6) (Jaycar PS-0520,
Altronics P-0621A)
1 PC-mount micro tactile switch
(S3) (Jaycar SP-0600, Altronics
S-1120)
2 SPDT 90° PC-mount toggle
switches (Altronics S-1325)
2 16-pin IC sockets (optional for
programming)
1 40-pin IC socket
2 14-pin IC sockets
1 TO-220 mini heatsink (Jaycar
HH-8502, Altronics H-0630)
1 7.3728MHz crystal (X1)
1 10kW horizontal trimpot (VR1)
1.5m tinned copper wire for links
1 M3 x 10mm machine screw
1 M3 nut
Semiconductors
1 ATMega 8515 microcontroller
programmed with CDATA.hex
(IC1)
1 74LS00 quad NAND gate (IC2)
1 74LS04 hex inverter (IC3)
2 MAX232 RS-232 transceivers
(IC4,IC5) (optional – see text)
1 infrared receiver module (IRD1)
(Jaycar ZD-1952, Altronics
Z-1611)
1 7805 3-terminal regulator (REG1)
1 1N4004 silicon diode (D1)
2 3mm green LEDs (LED1,LED5)
2 3mm red LEDs (LED2,LED4)
1 3mm orange LED (LED3)
Capacitors
2 47mF 16V electrolytic
1 10mF 16V electrolytic
10 1mF 63V electrolytic (optional
for programming)
4 100nF monolithic
2 22pF ceramic
Resistors (0.25W, 1%)
1 1kW
1 100W
5 470W
1 51W
Power Supply Options
LAST MONTH, we stated that one of the supply options for the board was
to plug a computer power supply into either CON4 or CON5. We have since
decided to scrap that option and now recommend that you stick to powering
the board from a 9-12V DC plugpack.
The disk drives can be powered directly from a computer power supply. Alternatively, if you don’t want the fan noise of a computer power supply, you can
use a mains adaptor like the Jentec JTA0202Y. This unit supplies +12V and
+5V rails at 2A each which is enough to power two drives and comes with
the correct plug (you’ll need a Y-splitter cable to power two drives).
At the moment, you will have to purchase this adaptor via eBay but it may be
available from Altronics and Jaycar in the near future.
off (ie, you hold S3 down while you
toggle S1 twice).
This resets the micro and takes you
to the “Setup Remote” screen. Here
you can program the keys to be used for
the project. The device will guide you
December 2007 95
Here’s another view of the assembled prototype PC board, this
time hooked up to an LCD module that we happened to have on
hand. Note that after the unit has been built, you have to assign
the remote control functions – see text.
through the set-up, and the keys that
you define will be stored in EEPROM
for later use.
For example, when the screen displays “Press Vol Up” (see Fig.6), you
simply press the “Volume Up” button on your remote. It’s just a matter
of cycling through all the options
until the button assignment has been
completed.
This means that you can use any
spare RC5 remote and define the keys
as you see fit. The “Power” button is
deliberately unused for this project
and this lets you control the device
with your TV remote control, for
example.
In other words, because the “Power”
button is unused, you can have your
TV off and use its remote to control the
CD-ROM Player Adaptor. Then, when
you are finished with the adaptor, you
can switch it off and use the remote to
control your TV again.
Of course, you won’t be able to play
a CD and watch your TV simultaneously using the same remote but this
feature can keep costs down. It means
that you don’t have to purchase a separate universal remote control, although
you can if you wish.
Operation
The user interface has been kept
quite simple. Occasionally, issuing
a command will result in an error
screen. This is perfectly OK as the
firmware has been designed to be
quite tolerant of errors. If it happens,
simply try the command again but if
the problem persists, it may indicate
an incompatibility or fault with your
drive.
The “Error” screen typically looks
like that shown in Fig.2 last month but
may have different numbers which
are used for debugging purposes. The
hexadecimal numbers give an indication of the state of the ATA registers
and the state machine when the error
occurred.
If the errors consistently re-occur,
this information will help to diagnose
SC
the problem.
Issues Getting Dog-Eared?
Keep your copies safe with these handy binders
REAL
VALUE
AT
$13.95
PLUS P
&
P
These binders will protect your copies of SILICON CHIP. They feature heavy-board covers
& are made from a distinctive 2-tone green vinyl. They hold 12 issues & will look great
on your bookshelf. Available Aust only. Price: $A13.95 plus $7 p&p per order (includes
GST). Just fill in and mail the handy order form in this issue; or fax (02) 9939 2648; or call
(02) 9939 3295 and quote your credit card number.
96 Silicon Chip
siliconchip.com.au
|