This is only a preview of the December 2021 issue of Silicon Chip. You can view 40 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. Articles in this series:
Items relevant to "Hummingbird Audio Amplifier":
Items relevant to "SMD Trainer Board":
Articles in this series:
Items relevant to "Digital Lighting Controller Translator":
Items relevant to "USB Cable Tester – Part 2":
Purchase a printed copy of this issue for $11.50. |
Cable
U
S
B Tester
Our USB Cable Tester, introduced last month, is ideal for going through
piles of cables and sorting them out. It's also a great first step in diagnosing
a faulty USB-connected device. It can perform continuity and short-circuit
checks on practically any USB cable and will report problems such as high
resistance in the power wires; a source of frustrating intermittent faults.
Part 2: by Tim Blythman
I
n the initial article last month, we
described the reasoning and principles of operation behind the USB
Cable Tester. Bristling with all the
standard USB sockets, it will test and
diagnose any cable with either a USB-C
or USB-A (2.0 or 3.2) on one end and
any of USB-C or USB-B (such as 2.0,
3.2, micro or mini) on the other end.
It will report whether the cable
is suitable for power only, USB 2.0
or USB 3.2 operation (and indicate
whether one or two SuperSpeed lanes
are present). With USB 3.2 (which
has replaced USB 3.0 and USB 3.1),
each SuperSpeed lane consists of
four wires, forming differential pairs
in both (upstream and downstream)
directions.
The unit scans every combination
of wires among the upstream facing
siliconchip.com.au
and downstream facing ports. It can
tell you which wires are internally
shorted or open circuit to help with
diagnosis and repair.
The USB Cable Tester also runs
pulses of up to 1A through the cable's
power (VBUS and GND) wires to assess
their ability to carry current under realworld conditions. The resistance and
voltage drop is reported.
This feature will ferret out many
cables that are causing intermittent
problems. When devices like portable
hard drives mysteriously stop working, it's possibly due to their high current needs being hampered by poor
connections.
With this tool, you can weed out
dodgy cables and choose the best ones
for high-current applications. Now
you can know for sure if it's the cable
Australia’s electronics magazine
or the device that's causing problems.
The USB Cable Tester can also run
tests when only one end of a cable is
plugged in, and it does this for three
reasons.
Firstly, it verifies cables that are
OTG (USB on-the-go) compatible,
which short their GND and ID pins.
This state indicates to a device that it
should instead behave as a host. Since
OTG cables are usually adaptors, their
other end is typically a socket, so you
can't plug in it at both ends.
The second reason is to help those
who construct and repair cables. You
can use it to check individual cable
halves, mainly to ensure that there
are no shorts between any conductors.
The third is perhaps the most
important. That is to check that the
very fiddly USB sockets have been
December 2021 85
correctly soldered to the PCB.
It's a kind of self-diagnosis, if
you will.
We will offer a different order
of construction than usual to take
advantage of this self-diagnosis
feature.
PCB layout
The internal photos and the
overlay diagram (Fig.3) show that
the USB sockets all lie along one
edge of the PCB. CON5, CON6
and CON8 are on a narrow neck
without any surrounding components. That makes fitting those
sockets easier.
The other sockets (CON3,
CON4 and CON7) are near the
relays and buck circuitry around
Q3. Since these components are
only needed for the power testing
and not connectivity testing, we
can fit those other components
after confirming the USB sockets have been soldered correctly.
So, no components below
the rows of resistors and above
the sockets should be fitted until
later, except for the two other surface-mounting parts, the 220mW resistor and the inductor L1. These are low
in profile and can be fitted with the
other surface-mounting parts to simplify the workflow.
Enclosure
Prepare the case lid as the first step
because the LCD is needed to perform our initial diagnostic tests, and
we need to align all the parts to fit the
LCD headers accurately.
Refer to the cutting diagram, Fig.4.
The single 4mm hole at upper right is
for access to pushbutton S1; we suggest
reading the Options section below to
determine if you wish to fit it (and thus
whether this hole is needed).
It's essential that the opening for the
LCD is centred horizontally to avoid
the connecting header being skewed.
We used a technique that requires a
sharp hobby knife, pliers (preferably wide-nosed), a hacksaw or jigsaw
and a drill.
You can use the bezel as a template,
keeping in mind that the bezel will
hide most imperfections in the top
panel. Mark the edges of the hole on
both sides; small holes drilled in the
very corners of the cutout area will
help to align the two sides.
Firmly score the rectangular cutout
86
Silicon Chip
Fig.3: the only parts that are somewhat tricky to fit are the USB sockets. Make
sure that IC1, RLY1, RLY2, the diodes and Mosfets are orientated as shown.
Note that there is a single 10kW resistor amongst the rows of 1kW parts. The
USB Cable Tester might still work if you mix this up, but it will drain the battery
much more quickly. The six USB sockets are located along one edge of the PCB.
It is important to fit USB-C socket CON4 before the relays and associated parts
are mounted on the board, so you have decent access to its pins.
Tactile switches with long actuators can be hard to come by,
although you can certainly use such a part if you can find it.
Our assembly uses four wires to stand S1 off the PCB so that
you can access it from outside the case.
Australia’s electronics magazine
siliconchip.com.au
Fig.4: fortunately,
the laser-cut bezel
hides any small
inaccuracies in the
large rectangular
cutout in the case.
The LCD mounting
holes must be
drilled accurately to
ensure that the LCD
aligns with the PCB
underneath. The hole
marked in green is
used for accessing S1,
and is optional.
As scrolling text can
be hard to read at
some LCD contrast
settings, the revised
firmware (C/D)
halves the scroll
speed and provides
a hidden option 4
under calibration
to adjust it (1 =
original speed, 2 =
default, 4 = extra
slow). Kits sent after
4/11/21 have this
revised firmware.
with the hobby knife against a straight
edge. Take care with this, as a slip with
a sharp knife can really hurt you!
Make a hole in the centre of the
rectangle that's large enough to accept
the saw blade, then use the saw to cut
up to the scored edges. You'll need to
make a number of these cuts around
the edge to divide the rectangle into
manageable pieces.
Then carefully flex the plastic to
snap it along the score lines and break
out the centre area in small sections. If
the score lines are accurate, the result
will have neat, precise edges. Use the
hobby knife to lightly shave small
pieces of plastic from the edges of the
hole to enlarge the hole if necessary
and to tidy up.
Another method is to drill a row
of holes inside the periphery of the
marked area to remove most of the
plastic, then file the edges smooth
until the LCD fits. This is slower but
requires fewer tools.
With the LCD in place, you can use
it (or the bezel) to mark and drill the
location of the four mounting holes.
If your LCD doesn't have a pin
header fitted to its underside, solder it now. When the screen comes
with a header, it's usually supplied
siliconchip.com.au
separately. Try to keep the pins at right
angles to the LCD's PCB to ensure that
they will fit squarely into the header
sockets on the main PCB.
Mount the bezel to the outside of
the lid with the four 15mm-long M3
machine screws, keeping the matte
surface facing out. Secure on the inside
with four nuts. While simplifying
assembly, these nuts also provide the
spacing necessary to clear the top of
the headers on the LCD panel.
Slide the LCD module over the
machine screws and secure it with
the remaining M3 nuts. The top of
the LCD panel should sit just proud
of the bezel on the outside of the lid.
You can see this in our photos at the
end of the article.
Using four self-tapping screws,
secure the main PCB to the other half
of the case. This will allow us to align
the headers to the LCD and solder them
in exactly the right place. There should
be a 20mm gap between the main and
LCD PCBs when the case pieces are
assembled.
Note that the enclosure will only
fit together one way, so check that it
slots together with the LCD1 pads on
the PCB in line with the LCD panel's pins. If the LCD panel's pins are
Australia’s electronics magazine
above the USB sockets when the case
is assembled, remove the PCB and
rotate it by 180°.
If you have 20mm spacers, you
might like to use them (and the three
mounting holes on the PCB) to align
the LCD. Doing it that way is less fiddly.
Before proceeding, check our photos of how the header sockets are fitted
to the main PCB. Note that they only
occupy the six end positions of each
end of the header; the four central positions are not connected (as they are
not used in the LCD's four-bit mode).
Separate the case pieces and slot
the sockets onto the LCD's pins as
described above. Then place the two
case pieces back together. This should
align the socket pins into the pads on
the main PCB. If you are having trouble, try aligning one edge of the case
and pivoting the other end closed.
This will bring the pins into location
one at a time.
With the pins located, screw the case
halves together to secure everything in
place. Then use your soldering iron to
tack one pin to the main PCB at each
end of the two headers (four pins in
total) through the side opening. This
is easiest at the end near the top of
December 2021 87
Using the finished USB
Cable Tester is as easy as plugging
one end of a cable into a Downstream Facing
Port, the other end into an Upstream Facing Port and then
checking the LCD for its assessment.
the PCB. Once you are happy they are
secure and still correctly aligned, disassemble the case.
Now solder the remaining pins without disturbing the alignment and then
refresh any pins that might need it. At
this stage, you should be able to reassemble the two halves with the pins
lining up and seating into the header,
pivoting the case as described earlier.
If you're having trouble with the
alignment, you could instead join the
LCD to the main PCB with ribbon cable,
strands of hookup wire or similar. Keep
in mind to follow the correct pin ordering and use at least 5cm of cable for
each connection to allow for flex when
the case halves are separated.
Remove the main PCB from the case
to continue the construction. To simplify testing, we recommend detaching the LCD from the lid to allow the
bare PCB to be attached to the LCD
and powered up later while allowing
access to the test points and jumpers
on the PCB.
Soldering the USB sockets
Some of these are surface-mounted,
so the usual collection of SMD tools is
required. With CON4 and CON6 being
some of the finest pitch parts we have
worked on, a magnifier is a necessity,
as is a good source of bright light. A
mobile phone camera set to a high digital zoom level is an excellent alternative to a magnifier.
88
Silicon Chip
You should also have a fine-tipped
adjustable soldering iron, flux (preferably paste) and tweezers. Fortunately,
most of the USB sockets (except for
CON8) have locating pins, making
exact positioning easy.
Your flux should recommend a solvent to use for cleanup. Some desoldering braid (solder wicking braid) is
a cheap and handy thing to have on
hand for fixing any bridges or other situations where there is too much solder.
Remember that flux can generate
smoke. Use a fume extraction fan
or work outside if necessary. Working outside is another way of getting
decent illumination.
Start with the mini-USB socket,
CON5. Apply flux to the pads, rest the
part in place (locking its plastic pins
into the PCB holes) and apply a bit
more flux to the top of the pins. Ensure
that it is flat against the PCB. Also try
to keep the part square and parallel to
the PCB so it will align correctly with
the front panel.
Clean the iron's tip and apply some
fresh solder to it. Then apply it to the
point where the pins meet the pads. If
you can't get in close, try applying the
iron to the extended pads and allow
them to draw solder off the iron tip.
If you get a good fillet at the point
where the pin meets the pad, then all
is well. Do the remaining pins, then
turn up the iron slightly to secure the
mechanical pads. Clean the tip and
Australia’s electronics magazine
add fresh solder as needed.
Pay attention to the mechanical
pads, as these sockets will see a rough
life and be subjected to repeated insertions and removals. There is also a
through-hole pad accessible from the
reverse of the PCB to help secure the
shell of this part.
Flip the PCB over and apply the iron
to the pad. Gently feed in solder until
the hole fills up. There should already
be flux present if you have used it generously; if not, add a little more.
Now use the same technique for
CON8, the micro-USB socket. It has no
locating pins, so you will have to take
extra care with its alignment. Its front
should be parallel with CON5 and its
pins centred in their pads. Work one
pin at a time to avoid bridges. If you
get a bridge, remove it with extra flux
and solder braid.
Like CON5, turn up the iron to solder the larger mechanical pads. There
are also extra pads underneath the
PCB to help secure CON8; solder these
similarly.
CON4 and CON6 are the trickiest
part of this build; the other two remaining USB sockets (CON3 and CON7)
are through-hole only parts. The most
significant trouble we had with pins
on these parts bridging was when solder crept up to where they sit closer
together, near their tops.
If you keep your iron down near
the PCB and just on the PCB pads
siliconchip.com.au
before you get back to soldering.
Use your magnifier to examine the
cleaned PCB. Any faults you can pick
up now will be easier to see and repair
before more components are fitted and
may be more apparent now that the
flux has been cleaned up.
If you're unsure about your soldering, use a multimeter to check for
continuity between the bottom ends
of where the 26 1kW resistors will be
fitted in the middle of the PCB, since
these all go back to the USB sockets.
If you find any short circuits, you
can use the circuit diagram and overlay to identify the affected connector
and pins.
Through-hole parts
A close-up view of the soldered pins on some of the USB sockets. This is what
you want the solder joints to look like; glossy, with clear fillets between the
PCB pads and socket pins, and no bridges between them. Elongated pads are
provided for many of the pins which make soldering them significantly easier.
only, you should avoid that problem.
Apply flux paste before placing the
socket, then add more before soldering the pins.
Set up your magnifier to give you a
good view, clean the iron tip and apply
fresh solder. You'll see that two of the
12 pins have shorter PCB pads; these
are not connected in circuit, so they
do not have to be soldered.
Solder the surface-mount pins, adding flux, cleaning the iron tip and adding solder to it as needed. Inspect your
work closely, as it's only possible to
easily remove the part and start afresh
if the other through-hole pins haven't
been soldered.
If you think there might be bridges,
use more flux and solder wicking
braid to remove them. Take care not
to allow solder onto the upper parts
of the leads.
Flux can make inspecting solder
joins difficult. You can avoid the hassle of cleaning the entire board of flux
for inspection by gently wiping away
the flux with a cotton bud dipped in
an appropriate flux solvent.
When you're happy with the top
of the PCB, flip it over and solder the
through-hole pins. These are closely
spaced too, but surface tension should
keep the solder where it needs to be,
and you can also use solder braid to
remove bridges here.
Turn up the iron and solder the four
mechanical mounting pins. For these,
siliconchip.com.au
more solder is definitely better than
less. Add some solder to the two central pads under the connector to help
with mechanical strength.
It might look like two pairs of the
through-hole pins on each of CON4
and CON6 are bridged; the two outermost pairs in the row of eight. This is
fine as they are all connected to their
respective socket's GND pin. You can
check this against the circuit diagram
and overlay.
We suggest leaving CON3 and CON7
until you can complete the self-tests,
which will involve getting most of the
USB Cable Tester functional.
You can fit inductor L1 and the
220mW resistor now. Neither is polarised, so apply flux, rest the part in
place and tack one lead with the iron.
You may need more heat on L1 due to
its size. Solder the second lead on each
part, then go back and refresh the first
lead if necessary.
Now is a good time to clean up any
flux that may be present on the PCB,
given that all the surface-mounting
parts have been fitted and there will
be little need for more flux paste to be
used. This will allow closer inspection
of your soldering.
Your flux should recommend a
cleaning agent, but isopropanol or
methylated spirits are good alternatives. Ensure that the board is allowed
to dry and that any flammable solvents have a chance to evaporate
Australia’s electronics magazine
Continue by fitting the resistors,
referring to the overlay diagram (Fig.3)
as a guide. Fit the four 10kW parts
first, then the 28 1kW resistors, then
the rest. Check the resistances with a
multimeter if you are not confident of
the part markings. The 100W, 1kW and
10kW resistors only differ in one colour
band. Once identified, solder them in
and trim the leads close.
To get the LCD operating so we
can run the tests, we need to fit all
the parts above and including IC1,
except S1 and S2. If you don't have
a pre-programmed microcontroller,
you should install CON2 to permit
programming in-circuit.
Now fit D2, the 100nF capacitor near
IC1, 10kW trimpot VR1, Q1 and CON2
if needed (we recommend a vertical
header for CON2).
Be sure to align Q1 and VR1 to the
silkscreen pattern. Also solder the battery holder to CON1, running red to +
and black to −.
Check that D2 is a 1N5819 and that
its cathode stripe faces as shown on
the silkscreen. You don't need a header
at CON1; you can solder the wires to
the pads. The holes near CON1 are for
strain relief, so thread the battery leads
from below the PCB into the tops of
the holes and then solder from below
(see photos).
While there is room to fit a socket
for IC1, we don't recommend you use
one. For a start, the large number of
pins will make fitting and removing
IC1 tricky. We only used one to allow
us to test different microcontrollers.
Gently bend IC1's pins to slot into
the PCB, making sure that the pin 1
marker goes to the left as shown. Tack
down two pins on opposite corners
December 2021 89
Screen 1: on reset, the calibration prompt is displayed. This
splash screen is shown for seven seconds. Calibration mode
is entered if the USB Cable Tester receives an ESC character
via the CON9 serial header during that time.
and check that the part is flat and orientated correctly. Adjust if needed and
then solder the remaining pins of IC1.
If you don't have a pre-programmed
chip, program it now, as described
below. Otherwise, skip ahead to the
Testing section.
Programming
Install cells in the battery holder
to power the circuit (unless you have
a programmer that can supply up to
25mA at 4.5-5V). You can use a PICkit
3, PICkit 4 or Snap programmer.
We use the MPLAB X IPE for programming; it can be downloaded
(along with the MPLAB X IDE) from
www.microchip.com under the "Tools
and Software" tab.
Select the PIC16F18877, click
"Apply", select your programming tool
and click "Connect". Open the HEX file
"0410821C.HEX" using the "Browse"
button and then press "Program".
If you see a "Program and Verify
successful" message, all is well. Otherwise, check the wiring and soldering around the five tracks that go to
CON2 from IC1.
Two of the programming pins (PGD
and PGC) are also used for probing the
USB sockets at CON3 and CON4, so
make sure that they are not shorting
to anything else.
If you have a PIC16F18875, use the
"0410821D.HEX" file instead. Our original prototype used a PIC16F18875,
which is why the PCB is marked with
this part number.
We decided to standardise on the
PIC16F18877 as we think it will be
more useful in the future and doesn't
cost much more (it has more room
for expansion). Though they are from
the same family, some of their special
function registers are in different locations, so the HEX files are not interchangeable.
When finished, detach the programmer and power down the circuit (eg,
by removing the cells).
90
Silicon Chip
Screen 2: the Calibration screen has four options which
are accessed by sending a 1, 2, 3 or 4 character. Sending
Ctrl-C at any time will exit calibration mode. The measured
battery voltage is displayed at top right to assist calibration.
Testing
Plug the LCD into its headers, apply
power and adjust VR1, the LCD contrast control, until the display is legible. You should see a splash screen
with a countdown timer, followed by
the main USB Cable Tester screen.
You can check the contrast voltage
at VR1's wiper. Our unit reads around
1V with a fresh battery.
If you see a "Ready for cable." message after seven seconds, construction
is correct so far, and your USB socket
soldering has no detectable faults. The
Battery value should be between 4.2V
and 4.8V. You can compare this with
a multimeter voltage reading between
TP1 and TP2; if the reading here is
roughly correct but the displayed
value is not, the circuit has a problem.
If all is in order, you can progress
to the remainder of the construction
below.
Problem?
If there is no LCD backlight, there's
likely a problem around transistor
Q1. If you can light the backlight by
grounding the LED cathode (pin 16) of
the LCD, then it's definitely the PCB
components and not the LCD.
If you get a message on the LCD listing the UFP or DFP, these messages
will point to USB socket pins that
might be shorted. Refer to the circuit
diagram and overlay to find those pins.
Disconnect the power supply, make
repairs and test again until you get the
"Ready for cable." message.
Remaining components
Fit the three remaining capacitors.
The two 1000μF and one 10μF electrolytic capacitors all have their positive (longer) leads facing to the right,
according to the PCB silkscreen.
Slot the two remaining USB sockets (CON3 and CON7) into place.
Tack a couple of leads and ensure
that the parts are flat against the PCB
and squarely aligned to the PCB. This
Australia’s electronics magazine
will help align the sockets to the front
panel.
When the sockets look correct, solder the remaining pins and be generous with the mechanical tabs to ensure
they have the necessary strength.
There are two more diodes. Fit the
single 1N4148 near CON4; it will sit
between the two relays and is easier
to fit before them. Check that its cathode stripe aligns with the silkscreen
markings. The remaining diode is D3,
a 1N5819 near L1.
Then fit the two relays, RLY1 and
RLY2. They should have one end
marked with a stripe that will match
the line on the PCB at the end nearest
to IC1. As for any multi-lead part, solder a couple of pins and check that the
device is correctly positioned before
soldering the remaining pins.
Then fit the other 2N7000 Mosfet
(Q2) near RLY2 and Q3, the larger
TO-220 P-channel Mosfet, near L1. Its
marked face should be towards L1 with
the tab closest to the cutout in the PCB.
Ensure Q3's leads are pushed down
against the board so that it doesn't foul
the enclosure lid.
Options
The remaining parts are optional
and only really needed for calibration
(which isn't required). However, as we
noted in the first article, you can also
use S1 to wake up the USB Cable Tester without plugging in a cable. This
could be handy if you are often testing
just one end of a cable.
The UART header, CON9, is only
needed to enter calibration mode via a
USB-serial module. S2 can be used to
reset the microcontroller and quickly
jump in and out of calibration mode.
JP1 and JP2 are used to calibrate out
the resistance of the internal wiring
and traces. Our HEX file is calibrated
with values suitable for the parts we
are supplying, so there is little need
to do this if you are building it from
our kit.
siliconchip.com.au
Screen 3: each calibration value is entered in decimal. The
value can be accepted by pressing Enter (CR, ASCII code
13) or cancelled by pressing ESC. You can clear the last
keypress with delete or backspace.
The other two calibrations are for
the microcontroller's internal 1.024V
reference voltage and current sense
shunt resistance. The internal reference is specified to be accurate within
±4%, so the USB Cable Tester will be
perfectly functional without calibration, but it will be slightly more accurate if this is done.
The current sense resistor should
be within 1% and won't need adjustment. The measured voltage is around
100mV with 1mV resolution, so the
shunt resistance only needs to be
adjusted if you can't use the specified
shunt value.
Values from 100mW to 500mW
should work, although we have only
tested the specified 220mW value.
Lower values will give less accuracy, while higher values reduce the
headroom to measure voltage drop
in cables.
Since the optional parts are supplied in our kit, you might as well fit
them all if you already have them. Fit
CON9 with the pins facing up; this
will allow a pair of jumper wires or
similar to be connected between the
USB-serial converter and the PCB.
Fit the JP1 and JP2 headers but leave
the jumper shunts off for now, or plug
them onto just one pin of the header.
S2 fits flat against the PCB as it is
only used for setup and calibration.
It shouldn't be accessible during normal use. Snap it into the pads and
ensure it is flat against the PCB before
soldering.
If you want to make S1 available
for use after calibration, you need to
drill the extra hole shown in Fig.4
and mount S1 above the PCB, near
the top panel.
To align everything, attach the main
PCB to the enclosure using one screw
in each corner. Use lengths of tinned
copper wire to attach S1 to the PCB.
Align S1 to the inside top of the front
panel with some tape or Blu-Tack,
then, after placing the lid on top, tack
solder one or of the wires in place.
This just needs to be enough to
locate S1. Remove the tape and the lid.
With the better access this provides,
add more wires to secure the switch
on all four corners.
If you don't need external access
for S1, it can be simply soldered flat
against the PCB like S2.
This completes the soldering for
the USB Cable Tester. Double-check
your work, then plug the LCD into
its header.
Calibration
If you wish to perform calibration,
connect a USB-serial converter to
CON9 using female-female jumper
wires. If you are using a CP2102 type
(like us), the pin marked TXD on the
converter connects to R on the PCB.
GND on the converter connects to "−"
on the PCB.
Only one data line needs to be connected as the USB Cable Tester displays its prompts and responses on
the LCD instead of the serial terminal.
Screen 5: while the value is being saved to EEPROM, it is
also displayed as a final check before returning to the main
Calibration screen.
siliconchip.com.au
Screen 4: there is a final confirmation prompt before an
entered value is committed to EEPROM. To answer the
prompt, enter either upper or lower case "Y" or "N".
Open a serial terminal program
(eg, TeraTerm) and connect to the
USB-serial converter at 9600 baud, 8
bits, no parity, one stop bit (8N1). It
won't matter if your USB-serial converter has 3.3V or 5V signals. The 1kW
resistor will limit the current flow,
and IC1 will recognise logic levels in
this range.
Now power up the USB Cable Tester PCB. When the prompt shown in
Screen 1 is visible, press the ESC key
on the serial terminal. If communication is working correctly, you should
see Screen 2.
If not, check your wiring and reset
the micro with S2 to get the prompt
to press ESC again.
At Screen 2, you can press 1, 2, 3
or 4 on the terminal to change the
displayed value, as seen in Screen 3,
after which you are prompted to confirm the change (Screen 4) with "Y"
or "N". If you press "Y", you will see
something like Screen 5.
To calibrate the VREF value, measure the supply voltage between TP1
and TP2 and compare this with the displayed voltage shown at top right. The
internal voltage reference is in inverse
proportion to the displayed voltage.
So if the displayed voltage is 1% too
high (for example), increase the VREF
value by 1% of its current value. With
the internal reference specified being
accurate to within 4%, you should
not need to change this up or down
by more than 40 points.
Another way to calculate this is that
Screen 6: with JP1 and JP2 fitted, only the Tester's internal
resistance is reported. The value at the bottom of the screen
is the contact resistance value. A similar screen is seen
when a power-only cable is plugged in for testing.
Australia’s electronics magazine
December 2021 91
Screen 7: once calibration is complete, the main idle screen
is shown unless a cable is plugged into the ports. The
battery condition is reported and the sleep timer counts
down 10 seconds before entering low-power sleep mode.
an error of 0.01 in the displayed voltage (ie 10mV) is equivalent to about
2.1 VREF steps. So if the displayed
value is 4.68V instead of 4.65V, add 6
points to the VREF value.
The nominal shunt value should be
accurate enough. You can measure the
shunt resistance any time the relays
are inactive (all the time in calibration
mode) and there are no cables plugged
in. Measure between TP1 and TP3.
To calibrate the relay contact resistance, use option 3 to set this to 0mW.
Then exit calibration mode by pressing Ctrl-C on the terminal or resetting
the microcontroller.
Attach jumper shunts to JP1 and JP2.
This will simulate a power-only cable
being connected, and you should get a
display like Screen 6. Note down the
resistance value shown, then remove
the shunts.
Reset the micro again and go back
to calibration mode with ESC on the
terminal. Save the noted value as the
contact resistance and exit calibration.
If you reattach JP1 and JP2, you should
see a value very close to zero.
At this stage, you can try out the
USB Cable Tester on any USB cables
you have lying around. See the Usage
section for further information.
Screen 8: a typical test result on a USB-C to USB-C cable
shows what is expected for a fully USB 3.2 compatible cable
with two SuperSpeed lanes, meaning that it has the USB 2.0
D+/D− pair as well as the SuperSpeed wires.
Final assembly
Power down the unit by removing the cells, detach the LCD from
its header and reattach it to the lid as
described earlier.
Put the front panel PCB over the
USB sockets on the main PCB and
slot the pair of PCBs into place in the
base of the enclosure. Secure the main
PCB to the enclosure using the eight
self-tapping screws.
There are solder pads on the inside
of the front panel PCB, so the panel
can be affixed to the main PCB by soldering these pads to the USB sockets.
The battery holder may have screw
holes, but to avoid marring the underside of the enclosure, we recommend
gluing it with neutral-cure silicone or
construction adhesive. If you do use
screws, fit self-adhesive rubber feet to
the underside of the box to prevent the
screws from scratching any surfaces.
Slot the rear panel supplied with
the case in place, then fit the cells.
Carefully position the enclosure lid,
feeling that the LCD header locks in
place. The LCD backlight may illuminate if the unit has not gone to sleep,
but there won't be a meaningful display since the LCD controller will not
have been properly initialised.
Allow the unit to go to sleep (the
LCD backlight will go off), then plug
in a cable (or press S1) to wake it up;
this should reinitialise the LCD, and
you should see one of the cable reporting screens (or the idle screen). If this
is the case, all is well, and you can
secure the two halves of the case with
its two included screws.
Usage
Screens 7-11 show the USB Cable
Tester in use. Screen 7 is the idle
screen which shows the battery condition and time until the unit enters
low-power sleep mode. It is present
when the unit is awake, but no cable
is detected.
Once a cable is inserted, you should
see the full diagnostic display, as seen
in Screen 8. The first line shows a
broad pass/fail assessment of the cable.
The second line identifies the USB
rating and the number of short circuits
(+) and open wires (-) that have been
detected. For an OK result, these are
both zero. The third line shows more
detailed information depending on the
test results, listing the wires involved
in any short or open circuits detected.
The text may scroll if it doesn't fit on
one line.
The header on the LCD screen aligns with two 6-pin sockets on the main PCB.
92
Silicon Chip
Australia’s electronics magazine
siliconchip.com.au
Screen 9: the Cable Tester will elicit a variety of information
about a faulty cable, including what it thinks it ought to be
and what problems it might have. Here, an open GND wire
means that the cable will not function, even for charging.
As shown in Screen 11, the results of
the UFP and DFP tests are summarised
so that single-ended tests may be carried out. This is done by unplugging
one end of the cable at a time, leaving
just the UFP or DFP connected.
It's common that the DFP and UFP
tests will detect that GND is shorted
to the shield. This is the case for some
USB-C cables and doesn't seem to
cause any problems.
The final line summarises the results
of the current pulse test. Values around
200mW can be expected for cables in
good condition. Up to around 500mW,
they could work fine, especially for
light loads; higher values indicate a
cable that may cause problems.
You can test cable combinations,
such as when a cable is supplemented
by a USB extension cable. However, as
we noted, high-speed signal integrity
is not tested by the USB Cable Tester.
If you want to check a USB extension cable, first test a cable with a
plug that will fit into it on one end
(ie, A-type or C-type) and a B-type or
C-type on the other; ideally, a USB 3.2
SuperSpeed type, although you can
still do the test if you don't have one.
Verify that cable is good and note
its type and resistance. Then plug that
cable into the extension cable and test
the combination. Subtract the resistance reading noted earlier from the
new reading to measure the extension
cable's own resistance
Screen 9 shows what might be seen
if the cable has a fault; the first line
indicates this. The second line lists
the nearest 'working' cable type to
what has been detected and also the
number of faults present; in this case,
'1-' means that this is most likely a
USB 2.0 cable but with one conductor open circuit.
The third line indicates that the
open wire is the GND conductor, so it
is unlikely to work at all. The "High
resistance" message is only shown
when the cable is incapable of carrying
siliconchip.com.au
Screen 10: with USB-C cables being reversible, it's necessary
to test them with both insertion orientations. If this screen
is seen, the current orientation does not connect the D+/D−
pair and you should try another orientation.
the lowest 100mA test current.
The display in Screen 10 needs
some explanation. USB-C leads
only have one D+/D− pair (the wires
required for a legacy USB 2.0 connection) but can be plugged in one of two
ways, and some cable orientations do
not detect this pair.
In this case, the USB 3.2x2-2.0 indication is shown. That means that two
of the SuperSpeed lanes needed for a
USB 3.2 connection are detected, but
the USB 2.0 wires are not. For these
cables, you must try each USB-C plug
both ways around (rotated 180°).
If only one end is USB-C, run the test
one way and flip it to try the other. If
you have USB-C at both ends, flip one
end, flip the other, then flip the first
end back; this will test all four plug
orientation combinations.
You should get a USB 3.2x1 or
USB3.2x2 result for only one of these
tests, with the USB 3.2x1-2.0 or USB
3.2x2-2.0 indication for the remainder.
That is, unless your cable has an extra
D+/D− pair, which is non-standard,
but it could still work on some devices.
If all the combinations show USB
3.2x1-2.0 or USB 3.2x2-2.0, there is
a problem with the D+/D− pair either
being missing or open-circuit. The x1
designation means one SuperSpeed
lane is present, while x2 means two
lanes, which is only possible with a
USB-C to USB-C cable.
Screen 11 shows a typical UFP-only
test result. If short circuits are detected
in both the UFP and DFP simultaneously, but no continuity is detected
between the two ends, then the UFP
and DFP screens will alternate. This
either means that your cable has failed
very badly or (more likely) you have
two different cables plugged in.
For Screen 11, one end of an OTG
cable has been plugged in. The fourth
line shows a specific message for this
case – it has detected that the GND and
ID wires are connected. Only short circuits are shown on this screen, as usually, there should be no connections
between pins.
If four or more pins are listed, they
might not all be shorted together, but
they will all be shorted to at least one
other pin. Up to 11 wires can be displayed, so there might be more than
those shown if the screen is full.
Also remember that you must
always connect a cable between one
of the UFPs and one of the DFPs. For
example, a normal USB-A to USB-C
cable can be plugged into the two
DFP sockets, but this will not give
a meaningful result; the USB-C end
should instead be plugged into the
UFP socket.
Conclusion
With this comprehensive and easyto-use piece of test gear, you can now
sort through all your old USB cables
and see whether they are worth keeping. With a 30μA sleep current, the
USB Cable Tester will happily sit for
years on the shelf, always ready.
For a final flourish to your USB
Cable Tester, you can carefully apply
some white acrylic (or similar waterbased paint) to the etched text on
the front of the LCD bezel. Wipe the
excess away with a damp cloth and
SC
allow to dry.
Screen 11: a
typical use for the
single-ended cable
tests is checking
if OTG cables
correctly ground
the ID pin. Here
we see that is that
case, with a specific message provided on the bottom line.
Australia’s electronics magazine
December 2021 93
|