Sony WM-D6C Walkman Pro DC-DC converter repair

This story starts with the long drive from Cambridge, UK to Warsaw, Poland. I like to be able to listen to music to while away the hours in the car, and I decided to use cassettes. Why? Our car radio is faulty, so much of the time there’s hardly anything to listen to. It has a CD player, but almost all of my CDs are stored away, having long since been converted to MP3s. There’s a handy AUX IN jack, so I can plug in my smartphone. But there’s simply no way to operate a smartphone without looking at it, and I’m not taking my eyes off the road at Autobahn speed.

My solution? Cassettes! I’ve got lots of them, generally high quality recordings, which I’ve never digitised, so they’re not stored away. They’re easy to operate with one hand without looking at them, too. But the car has no cassette player. Sorry, had no cassette player. A little judicious eBay shopping got me a Sony WM-D6C Walkman Professional in immaculate condition for a somewhat lower-than-average price because it didn’t work.

IMG_20190101_132309

The WM-D6C is widely acknowledged to be one of the finest portable cassette machines ever made. It’s pocket-sized, if you have large pockets, and has sound quality and features that rival full-sized hi-fi cassette decks. It can also record, which is extremely unusual for a Walkman-format machine.

This particular example is a very late one. It doesn’t have the posh amorphous head of the original models, but the electronics are mostly easy-to-access surface-mount components rather than the gruesome bird’s nest of wire-ended parts that the early models had. I remember servicing an early one for a student radio station and it wasn’t a lot of fun. I think this one must have expired quite early in its life and been left on a shelf, because there’s no perceptible head wear and the casing is unmarked.

Putting batteries in and pressing play resulted in the ‘BATT’ LED coming on but absolutely nothing else. No clicks in the headphones, no motor whirring, nothing. Fortunately the service manual is readily available on line. ‘Supplement 4’, dated 2001, accurately describes my example.

Browsing the circuit diagram revealed one of the secrets of the WM-D6C’s excellent performance. Most Walkman-type cassette machines used a pair of ‘AA’ cells, so all the electronics had to run from just 3 volts. That’s common enough in 2018, but back in the day it was a real challenge, so the capabilities of the motor and electronics were compromised. The WM-D6C not only runs from four ‘AA’ cells, for a 6 volt supply, but does even better. Almost the first thing it does is step up that supply to about 11 volts. That rail then runs nearly everything, including the motor and audio circuits. A nice generous supply voltage is a good start for getting top performance, especially with 1980s-era technology.

A quick prod with the multimeter revealed the problem. This boosted supply was entirely absent. Seeing as how it powers most of the machine, that would explain the lack of results. The supply rail comes from a much-feared component, the DC-DC converter (CP304). Inscrutable in its little screening can, labelled ‘SONY’ on the right hand side of the picture of the Walkman’s entrails below, it’s often considered unrepairable.

IMG_20181002_151808

The service manual includes a somewhat misleading diagram of its innards. I think the diagram is actually back-to-front, showing the output and input swapped, because that’s the only way it makes sense. The NPN transistor makes a boost converter in a variation on the classic ‘joule thief‘ circuit, and the PNP one with works with the zener diode to regulate the output by depriving the switching transistor of bias if the output voltage rises too high.

WM-D6C DC-DC converter

The converter wasn’t too hard to remove and dismantle, given reasonable desoldering tools and a powerful iron to unsolder the can. Here’s what’s inside. There are components on both sides of the board, and a certain amount of grey silicone which is easy enough to peel off. Back in the 1980s this would have seemed intimidating in its compactness, but it’s easy to work on given modern tools.

Finding the fault was a case of looking for the ‘usual suspects’: there were two tantalum bead capacitors sitting there looking guilty.  The one on the input was short-circuit, which had killed off the 22uH inductor connected to pin 3, the large green component on the right.

I replaced the faulty components, using a higher-voltage-rated tantalum and a ceramic chip in parallel to replace the capacitor, and a surface-mount inductor with bits of wire soldered on to it. The values aren’t very critical and I just used what happened to be lying around. A quick test, giving it 6V from a bench power supply, revealed a healthy 11V or so at the output.

After reinstalling the converter and reassembling the machine (watch out for the little ‘speed tune on/off’ knob at the back) it worked! It shows signs of having had attention from the phantom twiddler. The head azimuth adjustment screw was tightened up, but good quality sound returned when it was properly adjusted. The peak level meter seems rather unenthusiastic so may need adjustment, and I haven’t checked the recording bias yet. There’s also a forest of little surface-mount electrolytics waiting to dribble corrosive ooze all over the PCB, but that’s a job for the long winter evenings. For now, it’s working. Being able to play cassettes has turned out to be unexpectedly useful. We rediscovered a tape of nursery rhymes from Domowe przedszkole, a classic Polish children’s TV programme, which granted us peace on a long trip recently!

Advertisements

Fixing printing from Quicken 2002 under Windows 10

It’s admission time. I still run the financial side of my business on Quicken 2002 and yes, it really is 16 years old. It does what I need and is reliable. Over the years I’ve developed various handy Python scripts for manipulating its QIF file format (more about those another time) so I’m quite invested in it. Quicken apparently stopped support in the UK in 2005 but I didn’t notice. Unfortunately this means that upgrading to a newer version is next to impossible, so this one just soldiers on. One day I’m sure I’ll be forced to get hip with the kids and let my accounts float off in to the cloud, but I’m not looking forward to it.

q201819111

At the end of last week, Quicken 2002 blotted its copy book by refusing to print invoices any more. This would have a detrimental effect on my business’s turnover, so it needed fixing. It wouldn’t even show the setup dialog any more. It was tricky to sort out, so I’m noting it here in case anyone else has this problem.

I was all ready to blame the problem on last week’s Windows 10 update, but a bit of digging on the web revealed that such problems can be caused by the WPR.INI file. This link: https://www.quicken.com/support/printer-setup-window-wont-open indicates that it should live in C:\ProgramData\Intuit\Quicken\Config, but my system doesn’t have that folder. There were WPR.DAT and WPR.INI files in C:\Program Files (x86)\QUICKENW but moving, renaming or deleting them had precisely no effect at all.

To find the instances of the file that Quicken was actually using, I brought the very handy Process Monitor in to action. This tool lets you see all the file and registry accesses being performed by a process. Setting a filter for the process named “QW.EXE” and then watching the log while I opened the print setup dialog box caught it red-handed.

q201819112

The file was actually in C:\Users\cmj\AppData\Local\VirtualStore\Program Files (x86)\QUICKENW\WPR.DAT. Why didn’t I guess?

q201819113

The file was nearly quarter of a megabyte in size, which seems awfully large for some printer settings. After taking a backup copy, I deleted it and re-ran Quicken. Joy! The printer setup dialog box opened again and I was able to select a printer and thence print invoices. The creaky old application lives to account for another day.

Quick-and-dirty partition resize with Acronis True Image

A little embedded Linux magic comes in unexpectedly handy. Years ago, I started using Acronis True Image to back up my office PC. Other backup packages are available, as they say, but it’s worked well enough for me. This week I had reason to use it in earnest.

img_20180619_112420

The PC is set up with two main partitions on the disk. There’s one for the operating system (Windows 10) and applications, and another with data on it, analogous to the /home partition on a Linux system. Inevitably, it turned out that the boundary between these partitions was in the wrong place. The operating system partition was full, and things were starting to fail. Time to make sure the backup is up-to-date and then to restore to differently-sized partitions.

The operation fell at the first hurdle. Acronis True Image will create a ‘recovery’ USB stick from which the PC boots. This contains a small Linux distribution (Acronis Linux) and a GUI for managing the recovery operation. My backups are on a network drive, which happens to be an Apple Time Capsule. Would the Acronis recovery system connect to the Time Capsule? Would it ever. I couldn’t even persuade it to ask for the username and password, though it could see the Time Capsule on the network.

In Acronis Linux, pressing ctrl-alt-F2 in time-honoured fashion brings up a command line. Yay! Power! A bit of digging reveals a command called asamba which can connect to SMB shares. Using that, I could connect to the Time Capsule absolutely fine and mount it to the local filesystem. So why couldn’t the GUI do it? Annoying.

My next trick was to copy the backup from the Time Capsule to a USB hard drive using another Linux PC. It took a while for the several hundred gigabytes, but it got there. Acronis recovery will read USB drives, so the next step should be easy, right? No. My USB drive happened to be formatted ext4. Though Acronis Linux is perfectly capable of mounting ext4 filesystems, the recovery GUI only acknowledges the presence of FAT and NTFS discs. Aargh!

The solution was to mount the USB drive on my Linux PC, then share it using Samba. Acronis recovery found and let me log on to the Samba share, and could thus see the drive and backups.

Changing the partition sizes was the next problem. The GUI only allows you to shrink partitions or to grow them in to free space. My disk didn’t have any free space. It was all partitioned and in use. I thought that shrinking the data partition would create free space that the operating system partition could grow in to, but I was caught out by the presence of a 500MB ‘recovery’ partition which Windows had sneaked in between the two. I don’t know what it’s for but I didn’t feel like taking the risk of destroying it. There are no tools in the Acronis GUI for deleting partitions and starting again, so I was stuck.

img_20180619_113338

Command line to the rescue! Ctrl-alt-F2 again, and there’s a perfectly good copy of fdisk available. It was a moment’s work to delete the existing recovery and data partitions, then ctrl-alt-F1 to the GUI. Restart the restore process and there’s free space available for the operating system partition to grow in to, and plenty of room to create new recovery and data partitions.

img_20180619_112939

The restore took a few hours, as expected, but was successful. The only wrinkle was that Acronis recovery had marked the recovery partition as active rather than the boot partition, so the PC complained that there was no operating system. Another trip in to fdisk to mark the boot partition active sorted that out, and now I’m typing this very text on the PC restored to working order.

Footnote: there is another Acronis restore tool intended for restoring backups to dissimilar hardware. This may have handled the partition resizing more elegantly, but I didn’t try it.

Good accuracy from a low cost Real Time Clock

One product I work on has a built-in data logger. This helps us a lot if a problem occurs: we can see the history of any faults. Every log entry is time stamped, which is important. We need to know when it’s been used and how often. However, good timekeeping is a challenge. The product has no Internet connection, it gets stored and moved around a lot, and it’s nobody’s job to check or adjust its clock, so there’s a real problem with clock accuracy.

The real time clock is based on the Microchip MCP7940N chip. The chip uses a standard 32.768kHz crystal for its timekeeping. These crystals are fickle beasts, partly because of the very low-power oscillator in the chip. The oscillator frequency, which is critical for accurate timekeeping, is very dependent on the load capacitance, which itself can vary with different builds of the PCB. The heat of soldering during manufacture also affects the crystal. I’ve seen plenty which have failed altogether, and others whose frequency has shifted significantly. Note the soldering on the crystal’s load capacitors C9 and C10 in the photo below, part of an attempt to find the optimum load capacitance on a prototype board.

img_20180530_100756

All of these issues mean that just assembling the PCB and hoping for the best doesn’t work well. The frequency of an apparently working crystal can be anything up to 100ppm (parts per million) wrong. That doesn’t sound like much, but it works out to nearly an hour’s error per year, which is pretty bad.

Fortunately the MCP7940N has a neat feature which helps a lot. One of its registers, called CAL, holds a value which speeds up or slows down the clock by a small amount, like the regulator on a mechanical clock. But how do we know what the error is, and whether it’s been successfully corrected?

The MCP7940N also has a pin which can output a 1Hz square wave derived from the oscillator. With a sufficiently accurate timer, it’s possible to measure the error in the crystal’s frequency this way.

Checking the correction is more difficult. Because the chip only works on whole oscillator clock cycles, it does the adjustment to the clock’s speed by adding or removing a few clock cycles each minute. It’s therefore necessary to measure the period of exactly 60 of the chip’s seconds to find out how long its minute is, and therefore how accurate the whole clock is.

Getting a sufficiently accurate timer is the first problem. My aim was to get the MCP7940N to be accurate to within 1ppm, or about 30 seconds per year. A useful rule of thumb in metrology is that the measuring instrument needs to be ten times more precise that the quantity being measured, so we need a timer accurate to 0.1ppm, or one part in ten million. To the rescue comes my trusty Hewlett Packard 5335A universal counter. It’s an oldie but a goodie. Mine is fitted with the optional oven-controlled crystal oscillator, an HP 10544A. I checked it and set it up against a Rubidium frequency standard about 8 years ago and it hasn’t been touched since. I checked it this month against the same frequency standard, and it still agrees to within 0.1ppm. Not bad, and certainly good enough for this job.

Measuring the initial clock error is easy enough: connect the counter to the MCP7940N’s 1Hz output and look at the error. The 5335A counter has handy built-in maths functions to make this easier, so it will directly display the difference between its idea of a second and the chip’s attempt.

To measure the corrected clock output over a minute needs a bit more trickery. The 5335A counter has an external ‘arm’ input, and can average a period reading over the length of the ‘arm’ signal. All that’s needed is to arm the counter for 60 seconds and the counter will do the rest. I couldn’t find a way to make the counter do this for itself, so I cheated and used a spare Arduino mini that happened to be lying around. All it had to do was wait for a clock pulse on a GPIO pin, take another GPIO pin high to arm the counter, count 60 clock pulses, then take the arm signal low. Simple.

The test setup looked like this. The scope is there for ease of probing (note the cable from its ‘sig out’ connector to the counter) and it also includes a Tektronix 7D15 timer/counter module connected to the chip’s output. The 7D15 is a lot less accurate (about 1ppm) than the 5335A but it’s good enough to give an idea of what correction is required. The Arduino mini is just about visible at the bottom of the photo.

img_20180427_171833

Here’s a closeup of the scope screen, showing the measured period of the clock’s 1Hz output, 999.9818ms. That’s just over 18ppm too fast.

img_20180427_171723

This the setup screen of the product, showing the 18ppm correction applied to the MCP7940N’s CAL register.

img_20180427_171715

Finally the error in the measured minute, calculated by the 5335A counter gated by the Arduino.

img_20180427_171823

It’s showing that the corrected minute is 301.3 parts per billion, so 0.3ppm, too fast. That’s as good as it’s going to get – about 10 seconds per year. With the clock set up using this process, it has a fighting chance of staying accurate in the real world.

Hacking child barriers

This post contains no electronics or software, just woodwork.

Our house is full of traps for the inquisitive toddler. There’s cat food and litter, an office full of sharp tools, a fireplace, and most tricky of all, a staircase descending from the corner of the living room guarded only by a coffee-table-height shelf.

Fortunately, there is a handy range of wooden barriers available from various sellers on allegro.pl (search for ‘bramka’ or ‘barierka’ to get started). It’s a sort of modular barrier system, with a basic unit 91cm wide, though other widths are available. The sections screw together with plastic couplings that allow them to hinge. Wall mounting brackets and feet are available, as are sections with a child-proof gate built in. They’re cheap and simple enough that hacking them for specific jobs is easy and worthwhile.

Here’s a set across the end of the living room, protecting the fireplace and cat flap to the garden. These are almost freestanding, but tied to the bannisters at one end with string and blu-tacked to the floor by the window.

IMG_20180311_144905.jpg

The steps up to the office are guarded by these two sections. I added the cat flap in one of them so that the cats can get to their food and litter tray.

IMG_20180318_152052.jpg

The stairs down from the living room are guarded by another hacked set of barriers, cut to length and with an aperture provided for our eldest son’s favourite bookshelves.

IMG_20180311_144822.jpg

I used the leftover upper and lower rails from the segment I’d cut down in length to make a rail to hold the ends of the uprights above the bookshelves. There’s a join in the middle done with one of the plastic hinge pieces and a not inconsiderable amount of wood glue.

The barrier is held up using zip ties through plastic corner blocks screwed to the underside of the wooden shelf top, so the screw holes won’t show when we eventually remove it. Felt pads on its feet stop it scratching the wooden floor.

RIAA phono preamp for Tascam M-1B Line Mixer

In the workshop I have a couple of these Tascam M-1B line mixers. They’re a very useful box: they have eight inputs, each with a level control and pan pot, which are mixed together and fed into a master volume control. There’s also a pair of headphone outputs with their own volume control driven by a headphone amplifier with enough voltage swing to drive 600 ohm headphones properly. Into the mixer I typically feed the sound output of my PC, other audio sources such as a cassette player (yes!), and a spare cable lying around on the workbench ready to connect to whatever I’m working on, or my phone. The output is connected to the workshop speakers. With this setup I can hear all the sources at once without fiddling around, switching anything or unplugging anything.

IMG_0608.jpg

Tascam M-1B Line Mixer

The workshop I set up a couple of years ago turned out to have space for a new audio source: a turntable. Great! I can listen to vinyl (not ‘vinyls’, please). I had a spare turntable on the shelf, so I put it in place. The trouble is, the turntable has a magnetic cartridge which can’t be connected straight to the line inputs on my trusty mixer. It needed amplification and RIAA equalisation. I could have just gone and bought an off-the-shelf preamplifier, but where’s the fun in that? Looking at the back of the Tascam mixer, there’s a blanking plate which looks perfect for adding a preamplifier, neatly built in. No worries about trailing cables or yet another power supply to plug in. Now to find a suitable circuit.

IMG_0609.jpg

A quick web search pulled up an application note from National Semiconductor for their LM833 audio op-amp which shows a simple preamplifier circuit. It then goes on to describes the circuit’s deficiencies and how a two-stage design can improve on it, but I decided to stick with the simple version.

I didn’t have any LM833 op-amps in the spares box, but did have some NE5532s, which are not only an excellent audio op-amp but live two to a package. Finding the passive components in the spares box also proved to be a challenge. Getting the right component values is one thing, but finding two identical ones of each proved to be impossible. However, all was not lost, so I thought. The RIAA equalisation curve needs three time constants, of 75µs, 318µs and 3180µs. I found pairs of resistors and capacitors that gave the same time constants as R1C1 and R2C2 even if their values weren’t what the original design specified. Here’s a circuit diagram with my substitutions marked in red.

riaa-schematic-modded

I built up a small piece of matrix board and tried it out. It worked, but didn’t sound quite right: there was a noticeable lack of bass. I decided to check the frequency response. The application note shows a useful table of the RIAA response at various spot frequencies, so I had something to compare my results with. I used the ARTA STEPS program with a PC sound card to measure the frequency response of my circuit. It took a bit of fiddling with the levels to get good results, since the phono preamplifier has a lot of gain, but the result looked like this.

response-first-attempt

The curve looks convincingly like the RIAA curve, but it should be +17dB at 50Hz (relative to 1kHz). In fact it’s more like +13dB in my version, so I’ve lost 4dB of bass. At the other end of the spectrum it’s more accurate: at 20kHz it’s at almost exactly -20dB as it should be. (Note, when taking readings from the plot, that the level at 1kHz is about -3dB. It’s the relative levels that are important).

What I’d neglected in my component value calculations was that the relative values of the two RC networks are also important. The National Semiconductor application note actually goes on to explain more about this, but I hadn’t read any further than the circuit diagram. Rather than delving in to the maths and risking discovering that I needed more components I didn’t have, I started playing with the values I actually did have. Here’s a plot of the before-and-after empirical results.

response-first-and-second-attempt

The green curve is the modified version. The level at 50Hz is now +17dB relative to the level at 1kHz, as it should be. Below 50Hz there’s a bit of a rolloff, but that’s not something I’m worried about – my speakers don’t go down that low and it makes for a useful rumble filter. The modified circuit is shown here.

riaa-schematic-modded-v2

I had to change both RC networks to get a good result. The time constant of one of them (11k/6n8) is still 75µs, but the other (180k/22n) is more like 4000µs than 3180µs. I suspect it’s interacting with the time constant of R0C0 to give roughly the right result.

IMG_0616.jpg

It fits neatly in to the slot in the back panel of the mixer. The toggle switch connects the output of the preamplifier to inputs 1 and 2. Switching it off leaves those inputs available for normal line-level use if desired. There’s also an earth terminal.

IMG_0617.jpg

Time for some testing. What were the skies like when you were young?

IMG_0621.jpg

The Euroquadruped, or the solution to wall wart Tetris

Having relocated from the UK to Poland, the change in mains plugs has never quite been resolved. All the equipment that came from the UK has 13A plugs on it, and all the local sockets are the CEE 7/5 type. Then there are locally-acquired bits and pieces  which generally have two-pin Europlugs. No matter how many adapter cables and extension leads I make, or change the plug or socket on, there’s always something that doesn’t fit, or won’t reach the nearest compatible socket.

Of particular annoyance are various chargers and wall warts. They’re all bigger than a standard Europlug, and there’s no standard for which way the ‘lump’ of the charger will be attached, so connecting several of them in to a multi-socket extension lead doesn’t work well. Often one charger will obscure one or more sockets in such a way that all the things you need just won’t fit, or the whole assembly becomes so big and unwieldy that things start falling out under their own weight.

It is therefore with some relief that I announce the debut of the Euroquadraped: one 13A plug with short cables to four Europlug sockets. It reminded me of an octopus but only has four ‘legs’, hence the name.

IMG_20180211_221335.jpg

Getting all four cables in to the 13A plug was a bit fiddly, but choosing a roomy plug helped. The little Europlug sockets are neat. I’ve only seen them here in Poland. The finger ring to discourage pulling on the cable is a nice touch, and doubles as a cord grip internally. They even (finally) have safety shutters on the socket holes, roughly 60 years after shutters became standard on the British 13A socket…

The great advantage of this thing is that each socket is independent of the others and can find its own equilibrium with whatever electrical carbuncle is plugged in to it.

IMG_20180211_221527.jpg

It’s trivially simple, but it’s going to save a lot of frustration in the workshop.