This is only a preview of the July 2014 issue of Silicon Chip. You can view 38 of the 104 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 "Threshold Voltage Switch":
Items relevant to "Micromite, Pt.3: Build An ASCII Video Display Terminal":
Items relevant to "Touch-Screen Digital Audio Recorder, Pt.2":
Items relevant to "L-o-o-o-n-g Gating Times For The 12-Digit Counter":
Purchase a printed copy of this issue for $10.00. |
Touch-Screen Digital
Audio Recorder Pt.2
By ANDREW LEVIDO
Last month, we introduced our new TouchScreen Digital Audio Recorder and described
how it worked. This month, we will give the
assembly details, provide some performance
graphs and describe how the unit is used.
A
LL THE PARTS for the TouchScreen Digital Audio Recorder
(except the battery) are mounted on
a single PCB coded 01105141 (106 x
74mm). Most of these parts and the
connectors are surface-mount types
which are installed on the top side of
the PCB. Only the microphone, touchscreen display and the SD card socket
are located on the underside.
Don’t be put off by the surfacemount nature of this project. With
a little bit of care and patience, any
reasonably experienced hobbyist can
put this together in a few hours. As
with any surface mount work, you will
need a good work light, fine tweezers,
a flux pen and a roll of solder wick. If
you have some form of magnification
(or a magnifying lamp), then so much
the better.
70 Silicon Chip
Fig.6 shows the parts layout on the
PCB. Begin with IC2 (LM3658). This
is a 10-pin QFN (quad flat no-lead)
package with 0.5mm pin spacing and
a central thermal pad. Once you have
successfully soldered this device in
(as described below), you can consider
yourself an SMD guru!
The technique is as follows: start by
applying a small amount of solder to
each of the 10 outer pads on the PCB.
You want just enough solder to later
re-flow under the pins but not so much
that the pads are bridged or the chip
does not sit flat against the board. Use
solder wick to take off any excess if
you have to.
Next, apply some liquid flux to the
pads, then carefully position the chip
so that it is centred horizontally and
vertically with respect to the pads
(take care to ensure that it is orientated
correctly). Check that the pins, which
are just visible on the sides of the chip,
line up with the elongated pads. This
is best done with the aid of a magnifying lens (or a microscope if you have
access to one).
Once it’s in place, hold the chip
down using a pair of tweezers and
apply your soldering iron to the elongated pads. Heat them just long enough
for the solder you applied earlier to
melt and re-flow under the pins. Add
a small amount of solder during this
procedure if necessary.
Once you have done this for all pins,
flip the board over and melt a blob of
solder into the four holes under the
thermal pad. You will have to apply
quite a bit of heat here, since the large
rectangle of copper on the bottom side
siliconchip.com.au
Microphone bias
You must now decide if you want the
microphone bias to be available to the
external microphone. If you do, install
a link in the position marked “BOTH”
(near CON2); otherwise install a link
in the position marked “INTL”. You
can either use a 0Ω (0805) resistor (as
we have) or just bridge the pads with
a blob of solder.
Next, install the USB connector
(CON7). First, place it on the board
(make sure that the locating pins go
into their holes) and solder the four
mounting tabs. You will have to apply
a fair bit of heat to get the solder to
take to these. It’s then just a matter of
soldering the five pins. These protrude
siliconchip.com.au
1
CON5
INT MIC
CON1
ICSP
AUDIO RECORDER
100k
4.7M
2.2 µF
IC3
PIC32MX695–
F512H
2.2 µF
2.2 µF 5.1k 5.1k
Q4
01105141 4.7M NTR4170N
100nF
2.2 µF
1
is designed to be a heatsink. This step
will not only solder the thermal pad
but will also continue the re-flow
process for the pads.
Alternatively, if you are lucky
enough to have a hot-air rework tool,
simply apply a little solder paste to the
pads, position the chip and re-flow the
solder with the hot air. Surface tension
will help pull the chip into position if
your placement was not perfect. This
is a lot faster and less prone to errors
than using a soldering iron, so if you do
a lot of SMT work it is an investment
worth considering.
Note, however, that once the chip is
in place, you still have to flip the PCB
over and melt solder into the holes
under the thermal pad.
Microcontroller IC3 is the next on
the list. Apply a generous amount
of flux, then carefully position it on
the pads (make sure it’s correctly orientated) and tack solder a couple of
pins on opposite corners. Now check
that it’s perfectly aligned and adjust if
necessary before soldering the remaining pins.
Don’t worry if you end up with a few
solder bridges – you can clean these
up later with solder wick.
The CODEC (IC1) can now be installed. With its 0.65mm pin spacing,
it will seem positively huge compared
to the last two chips. Use the same
technique as for the microcontroller.
Regulator REG1 is the easiest of the
lot. Once it’s in, install the four SOT-23
Mosfets and then the passive SMDs (ie,
the resistors and capacitors). These are
0805 size and so are fairly straightforward to solder by hand. Take care here
because the capacitors are not marked
and it’s easy to mix them up.
X1
12MHz
Q1
NTR4170N
22pF
2.2 µF
5.1k
MIC IN
CON7 USB
100nF BOTH INTL 2.2 µF
MIC BIAS
10nF
REG1
Q2
NTR4170N 10k
1M
IC1
5.1k
1M
TLV320AIC23
100k
IC2
2.2 µF
100nF
Q3
NTR4170N
10Ω 2.2 µF 100k
100nF 2.2 µF100k
1M
LM3658
100k 470Ω100k
1
100k 100k 100k 100k
100nF
1M
X2
22pF
CON3
LINE OUT
LED1
ACTIVITY
2.2 µF
22pF
CON2
22pF 2.2 µF 22pF 2.2 µF
MCP1725
2.2 µF
LINE IN
22pF 5.1k 5.1k
100 µF
100 µF
A
CON4
1M
TEST
PHONES OUT
100 µF
32kHz
(TOP OF PCB)
BATTERY CLIP LEADS
INT MIC
+
CON6
LCD CONNECTION CABLE FOLDED UNDER
TO ATTACH TO PCB HERE
STRIPS OF DOUBLE-SIDED
ADHESIVE TAPE ATTACHING
LCD DISPLAY TO
UNDERSIDE OF PCB
QVGA 64K COLOUR TFT LCD
DISPLAY WITH LED BACKLIGHTING
SD CARD
SOCKET
(UNDERSIDE OF PCB)
Fig.6: install the parts on the PCB as shown on these layout diagrams. The
three SMD ICs and regulator REG1 go in first (see text), followed by the
passive SMDs (resistors & capacitors) and then the larger through-hole
parts. The LCD, SD card socket and internal microphone are mounted on
the underside of the PCB, as shown in the bottom layout.
just enough from back of the connector
to get at with a soldering iron.
Follow with the four 3.5mm audio jacks (CON1-CON4), then fit the
through-hole electrolytic capacitors
and the two crystals (X1 & X2). We
used one of the capacitor lead offcuts
to make a small strap to hold the 32kHz
(X2) crystal in place.
It’s a good idea to also solder two
more lead offcuts to the pads on the
back of the electret microphone insert.
This makes it easy to install later on.
The final step for this side of the
board is to mount the ICSP header
(CON5) if you intend to program the
micro yourself. There’s no need to
mount the test header – it was used
during development as a handy way
to get access to the data traffic between
the micro and the SD card.
SD card socket & LCD
As stated earlier, the SD card socket
and the touch-screen LCD are mounted
on the underside of the PCB (see Fig.6).
Start with the SD socket (CON6), as
it’s difficult to get to some of its pins
once the LCD is installed. This socket
shares its locating holes with two of
July 2014 71
These views show the assembled PCB. The touch-screen LCD is installed by first soldering its ribbon cable to its PCB
pads, then folding the LCD over this cable and securing it using strips of double-sided adhesive tape (see Fig.6).
the audio jacks. There are four pads
to solder around the outside and 11
on the inside.
Mounting the LCD involves soldering its flexible ribbon cable to corresponding pads on the underside of the
PCB. The two 1mm holes at either edge
of the ribbon are used to line everything
up. Take a minute or two to familiarise
yourself with the correct orientation of
the display before soldering any pads;
it should be positioned such that it can
fold back over the ribbon cable to face
up as shown in Fig.6.
To install it, first peel the cover paper off the strip of double-sided sticky
tape on the ribbon (not the strips on the
back of the display). That done, line up
the two 1mm holes in the ribbon with
their corresponding holes in the PCB
(we used a couple of 1mm drill bits
to make this easy), then press down
on the ribbon to fix it onto the PCB
with the tape
(TOP OF CASE)
B
A
58
7.8
16
31
3.7
30.5
B
22
35
12.5
24
C
C
L
11.5
58 x 44mm CUTOUT FOR
LCD DISPLAY/TOUCH PANEL
8.5
8.5
3.0
B
22
A
B
5.3
(FRONT
PANEL)
HOLES A: 3.0mm DIA.
HOLES B: 4.5mm DIA.
HOLE C: 3.75mm x 8.0/6.5mm
ALL DIMENSIONS IN MILLIMETRES
Fig.7: follow this diagram to make the display cutout in the case lid and to drill and cut the holes in the end panel. The
display cutout can be made by drilling a series of holes around the inside perimeter, knocking out the centre piece and
filing the job to a smooth finish. Hole ‘A’ at top left is for the microphone.
72 Silicon Chip
siliconchip.com.au
Parts List
The ribbon cable can now be soldered to the pads. Work quickly here,
as the ribbon will melt if you apply too
much heat. We found it best to press
the ribbon down onto the PCB with a
probe, then solder three or four pads
at a time, moving progressively along
the ribbon.
Once the soldering is complete, fold
the display over the ribbon and secure
it to the PCB using the two strips of
double-sided adhesive tape on the
back of the panel. During this process,
make sure that the LCD panel’s four
plastic posts (one at each corner) drop
into their locating holes in the PCB.
Now fit the electret microphone
insert (ie, with the wire leads soldered
to it) to the PCB, observing the polarity. Don’t solder it yet though; instead,
position the PCB in the top half of the
case and temporarily fix it there with
a couple of mounting screws. That
done, push the microphone down
until its face is flush with the inside
of the case, then solder its leads and
trim off any excess.
The PCB assembly can now be
completed by soldering the battery
clip leads to the battery terminals
(marked B+ & B-). Be sure to loop these
leads through the strain relief holes as
shown in Fig.6.
Preparing the case
Now turn your attention to the case.
First, carefully mark out the LCD cutout and the microphone hole on the
siliconchip.com.au
1 double-sided PCB, code
01105141, 106 x 74mm
1 black hand-held ABS case with
battery compartment, 89 x 147
x 25mm (Altronics H8986)
1 12MHz HC-49/US SMD
crystal (X1) (Altronics V2267,
element14 1842280, Digi-Key
535-10218-1-ND)
1 32.768kHz watch crystal (X2)
1 3mm orange or red LED (LED1)
1 QVGA RGB LCD touch-screen
with LED back-light and
controller (Altronics Z7080)
4 3.5mm switched SMD stereo
jack sockets (CON1-CON4)
(Digi-Key CP-3524SJCT-ND)
1 5-pin header (CON5) (optional,
for in-circuit programming)
1 push-push SD card socket
(CON6) (Altronics P5720 or
equivalent)
1 SMD mini-B type USB connector
(CON7) (Altronics P1308,
element14 1507528, Digi-Key
151-1206-1-ND)
1 electret microphone insert
(MIC1) (Jaycar AM4008)
4 No.4 x 6mm self-tapping screws
1 short length light duty red hookup wire
1 short length light duty black
hook-up wire
1 3.6V Lithium-ion AA cell
1 AA cell sized piece of nonconductive foam
1 SD/SDHC/SDXC card
1 USB type A to mini type B cable
1 short length double-sided tape
lid as shown in Fig.7. That done, cut
out the rectangular hole for the LCD
and clean up the edges using a fine file.
We chamfered the edges of the cut-out
to improve its appearance, as shown
in the photos of the unit.
Next, drill the 3mm-diameter hole
for the microphone, then mark out and
drill the end panel according as shown
in Fig.7. Alternatively, you can simply
attach the end-panel diagram to the
panel and use it as a drilling template.
The cut-outs for the USB socket and
the SD card socket can be made by
drilling a series of very small holes,
joining them up and then filing the
job to shape. Once completed, test fit
the panel to the PCB – you may need
to fettle the socket openings to get
everything to line up nicely.
Be careful when drilling and cutting
Semiconductors
1 TLV320AIC23 96kHz audio
CODEC IC (IC1) (element14
1575048, Digi-Key 296-26817-1ND)
1 LM3658SD Li-ion battery charger
IC (IC2) (element14 1312584 or
Digi-Key LM3658SD/NOPBCT-ND)
1 PIC32MX695F512H SMD
microcontroller programmed with
0110514A.HEX (IC3)
1 MCP1725-3002E/SN LDO 3.0V
regulator (REG1) (element14
1851958 or Digi-Key MCP17253002E/SN-ND)
4 NTR4170N SMD N-channel
SOT-23 Mosfets (Q1-Q4)
(element14 1887064 or Digi-Key
NTR4170NT1GOSCT-ND)
Capacitors (all SMD 2012 size [0805
imperial] unless specified)
3 100µF 6.3V electrolytic
13 2.2µF 16V X7R ceramic
5 100nF 50V X7R ceramic
1 10nF 50V X7R ceramic
6 22pF 50V C0G/NP0 ceramic
Resistors (all SMD 2012 size [0805
imperial])
2 4.7MΩ
6 5.1kΩ
5 1MΩ
1 470Ω
10 100kΩ
1 10Ω
1 10kΩ
1 0Ω
Where to buy a kit: a kit of parts will
be available for $139.95 from Altronics
(Cat. K 5530). It will have SMDs IC1IC3 pre-soldered to the PCB.
out this end panel. There are a lot of
connectors in a very small space, so
there is almost “more hole” than panel.
Once everything is correct, fit the
front panel to the PCB and then insert
the assembly into the top section of
the case. Secure the board with four
short self-tapping screws, then fit two
of the supplied battery terminals into
the bottom half of the case. Solder the
battery wires to these terminals, making sure that the positive lead goes to
the positive terminal and the negative
lead goes to the (spring-loaded) negative terminbal.
We used a piece of foam to fill the
open space in the left-over battery
position, so the cell cannot move.
Testing & Troubleshooting
Now for the smoke test! The stepJuly 2014 73
READY
PATH &
FILENAME
SD: DIR1 / DIR2
FILENAME.WAV
FILE
NAVIGATION
+
FILE
+
–6.0dB
00 : 15 : 36
FILENAME.WAV
+
+
FILE
SKIP TO
NEXT/
PREVIOUS
FILE
–
–
PLAYING
PHONES
VOLUME
(PRESS OR
SWIPE
UP OR
DOWN)
& MUTE
RECORD/PLAY
COUNTER &
FILENAME
(SWIPE LEFT/
RIGHT TO
SKIP BACK/
FORWARD)
–6.0dB
+
+
–3.0dB
48kbps
BACKLT
–
–
–
PLAY ONE/
ALL IN
DIRECTORY
CONFIG
& USB
MODE
ABOUT
RECORD &
PLAYBACK
CONTROLS
14:37:16
HIGH
TIME,
DATE &
BATTERY
STATUS
2014–05–16
SET
RECORD
SAMPLE
RATE
+
INPUT
SOURCE
& GAIN
–
–
CONFIGURE
SET
TIME &
DATE
14:37:16
HIGH
A
SET
BACKLIGHT
LEVEL
STATUS
VIEW
ABOUT
SCREEN
OK
14:37:16
2014–05–16
HIGH
2014–05–16
RETURN
TO MAIN
SCREEN
C
B
Fig.8: the icons (or buttons) displayed on the touch-screen LCD are context sensitive and may be greyed out if not
relevant to the current function. There are three main status screens: READY, PLAYING and CONFIGURE.
by-step procedure is as follows:
(1) Connect a bench power supply set
to deliver 4V to the battery terminals
(ie, without the battery installed). Be
sure to get the polarity correct and if
your supply has current limiting, set
this to around 500mA.
(2) Apply power and check that the
LCD lights up and displays the various menus and icons. Of course, this
assumes that you purchased a preprogrammed micro. If the micro didn’t
come pre-programmed, now is the
time to program it.
(3) Once you have a working micro,
insert an SD card and check that you
1
can move through the directories, play
audio files and make a recording using
the internal microphone.
(4) If that checks out, remove the power
supply, insert a battery and check that
it begins to charge when the unit is
connected to a USB port on a PC.
(5) Press the USB button and verify
that the audio recorder appears as an
external drive on the PC.
If this all checks out, you are ready
to start using the Touch-Screen Digital Audio Recorder. If you do have
problems, work logically to isolate
the cause. If the display is black, for
example, check the 3V rail and 12MHz
Touchscreen Recorder THD vs Frequency 05/20/14 11:52:38
+10
05/20/14 11:35:13
+6
Headphone Out (8Ω -10dB)
0.2
+4
Headphone Out (16Ω -10dB)
0.1
+2
Headphone Out (32Ω 0dB)
Amplitude Variation (dBr)
Total Harmonic Distortion + Noise (%)
Touchscreen Recorder Frequency Response
+8
0.5
0.05
0.02
Headphone Out (32Ω -10dB)
Line Out
0.01
Headphone Out (100kΩ 0dB)
0.005
Headphone Out (100kΩ 0dB)
-0
Line Out
Headphone Out (32Ω 0dB)
-2
-4
Headphone Out (8Ω 0dB)
-6
Headphone Out (16Ω 0dB)
-8
-10
-12
-14
-16
Signal-to-noise ratio, both outputs <at> 0dB, backlight full
on/off: 92dB unweighted, 96dB A-weighted
0.002
0.001
clock to make sure these are OK, since
the micro can’t run without them.
If the 32kHz oscillator is working,
then you can be sure the micro itself is
OK, so look for problems with Mosfets
Q1 & Q2 and for soldering issues on the
LCD ribbon cable and the corresponding pins on the micro.
If the display works but you can’t
read an SD card, check the components
and soldering in that part of the circuit.
Make sure that the SD card is formatted
correctly and try an alternative card
if there are still problems. Similarly,
if there is a problem with the audio,
check the circuitry around IC1.
20
50
100
200
500
1k
2k
5k
10k
-18
20k
Frequency (Hz)
Fig.9: distortion vs frequency plots for the recorder. Note
that since the headphone output performance (at 0dB) into
a high impedance is better than the line output, there’s
little reason to use the line output. We had to use a 20kHz
low-pass filter for these measurements so distortion above
10kHz is understated; the dotted lines indicate our guess
as to the real performance.
74 Silicon Chip
-20
20
50
100
200
500
1k
2k
5k
10k
20k
Frequency (Hz)
Fig.10: the frequency response is flat for either output up
to 18kHz into a high-impedance load. However, the lowfrequency roll-off is significant when driving headphones
(typical 16Ω headphones/ear-buds have a -3dB point of
100Hz). Note that bass performance could be improved by
increasing the value of the two 100μF electrolytic coupling
capacitors to 470μF.
siliconchip.com.au
If the activity LED pulses steadily
while playing and recording, you can
be reasonably sure that the problem
lies with the CODEC or its surrounding
circuitry. Any problems are most likely
to be caused by incorrectly positioned
parts, solder bridges or missed/faulty
solder joints.
Using the recorder
The Touch-Screen Digital Audio
Recorder is fairly intuitive to use.
Most of the time, the user interacts
with a single screen like that shown
in Fig.8A. The “buttons” are context
sensitive and may be greyed out if
they are not relevant for some reason.
For example, as shown in Fig.8A, the
Stop button will be greyed if there is
nothing playing or recording.
A status bar is shown at the top of
the screen and immediately below that
are two lines of text (eg, to indicate
the directory path and filename). In
addition, the current time and date
are displayed at the bottom of the
screen, along with the battery charge/
discharge status.
The READY status in Fig.8A indicates that an SD card has been successfully mounted. The file navigation
keys can then be used move through
the directories and files on the card.
The file “rocker” moves through the
entries in the current directory.
The current entry (eg, a filename)
is displayed on the lower of the two
text lines and the path is shown on
the upper line. If the current entry is
a directory, the down arrow allows a
sub-directory to be selected. Similarly,
the up arrow button allow you to move
up to the parent directory, if you are
currently below the root directory.
Immediately below the file navigation area are buttons to jump to the
configuration screen and to put the
recorder into USB mode. MSD mode
allow the files on the recorder to be
read on a PC via the USB port. To the
right of this are the headphone volume
control and the output mute button.
The bottom row of buttons control
the record and playback functions.
Pressing the record button creates a
new file and begins a recording, while
pressing the Play button opens and
plays the selected file. Once playing,
the screen changes slightly to that
shown in Fig.8B (the record screen
is similar).
At the same time, the status changes
to PLAYING and a counter replaces
siliconchip.com.au
The PCB is secured to integral
mounting posts inside the case
using four self-tapping screws.
the path name. In addition, the file
navigation and USB mode buttons are
disabled and the play/record controls
change as shown.
The action of the Pause button is
fairly obvious – it toggles between
pause and resume on alternate presses.
The Skip button stops playing the
current file and skips to the next one
in the directory. When recording, the
Skip button closes the current file and
immediately opens another and carries
on recording into that.
Fig.8C shows the configuration
screen. It’s entered by pressing the
Configuration button on the main
screen. At the top left is the line input
gain rocker, while immediately below
that is the input source selector. Pressing this repeatedly rolls through the
three options: line input, mic input
and mic input with 20dB extra gain.
At top centre is the record sample
rate selector and to its right, the backlight level control. Any change to the
sample rate applies from the next
recording. The About button displays
the software version information (as
you might expect) while the OK button returns control to the main screen.
Either side of the OK button are buttons that allow setting of the time and
date. If an error occurs at any time, a
message is displayed at the top of the
screen along with an Acknowledge
button to dismiss it. The error message gives the reason for the error and
a code indicating which part of the
software was responsible.
If a catastrophic error occurs, the
activity LED will flash an error code.
These error codes correspond to the
processor exception codes except for
a double flash that indicates the event
queue has overflowed. These errors
should never happen under normal
circumstances and a full reset is the
only way to recover.
You can explore the rest of the user
interface yourself and even attempt
some software modifications of your
SC
own if you are so inclined.
July 2014 75
|