Category Archives: Electronics

First experiments in radio…

Well, I knew the TDS2024B would have some influence on me, but I never realised all the extra features would send me off on a rush to find something to do with them…

Oh wait. Yes I did.

So anyway, I’ve just picked up three of the nifty little battery radios that Superdrug are selling for £3.19 each at the moment. They’re Chinese-made, branded with the model number “DM-906”, the text “DIGITAL” and not a lot else. For this price, I didn’t expect much, but apparently the thing is a proper 10-band AM/FM/SW radio, with a real quadrature detector, and a fairly traditional IF system (a few IF coils and some ceramic filters). Very nice. Not to mention cheaper than buying the filters and such separately, so a nice source of parts. A really nice guy called [Hans Summers]( (G0UPL) has a few pages about the three previous iteration of the radio on his site, among other really interesting creations. The [10MHz GPS-disciplined frequency reference]( looks quite nice – I’ve never seen it done in that way before; everyone else seems to use PLLs that take ages to finally lock in. He’s used an Atmel AVR and its internal counter. Count the number of pulses on CLKin during a second, if it’s less than expected kick the frequency up, if it’s too high then kick it down. I’m going to have to get an OCXO or TCXO and try it out…

But enough about the radio. A while ago, I built up a 198kHz frequency reference (or part of it) from a design published in EPE. The receiver section has been sitting gathering dust for the best part of three years.. until today.

Last night I found out that it was actually outputting the whole AM modulated signal, not just the 198kHz carrier. That meant it was carrying the audio sidebands too… A bit of hackery later, and I now have an SA612A hooked up on a breadboard that’s up-converting the 198kHz signal to 1650kHz, at the high end of the Superdrug radio’s AM tuning range.

And it worked. First time too. It’s kinda neat hearing Radio 4 blasting out of a cheap pocket AM radio, even if it’s not done the ‘proper’ way. And this little experiment has set off something of an interest in radio… I have no idea why, but it might have something to do with the whole ‘sound from thin air’ aspect of radio… 🙂

At some point I’m really going to have to find out what I need to do to get an amateur radio licence…

QUICK PROJECT: Improving the Freecom 25451 Rev3 DVB-T stick

I’ve finally gotten sick of the incredibly dire SMB connector on my Freecom 25451 Rev3 USB DVB-T receiver ‘stick’. The adapter that converts the SMB into a more standard Belling-Lee UHF connector (which is a horrible design as well, but a necessary evil around these parts) has been falling out, slipping and causing signal dropouts for weeks. All of this, of course, makes it rather difficult to watch any TV, let alone film4 (which is on Freeview Mux D — the mux on the Emley Moor transmitter that has the lowest transmission power).

At about this time, I decided the rat-bitten LNB cable on the Sky dish had to be replaced. This was duly done (earning me a great many cuts and scratches courtesy of the local flora) and I had a bag of half a dozen F connectors and a few metres of WF100 satellite cable left over. What better to do than fit a proper RF connector to the DVB stick?

The first step is getting the thing open. Hold the ‘451 with the “FREECOM DVB” logo badge facing upwards, the serial number label facing down, and the USB plug facing towards you. Insert a screwdriver in the gap between the top edge of the USB connector and the top section of the plastic case. Prise it apart gently until you hear a ‘snap’ as the first bit of glue gives way. Do this all the way around the ‘451, then pull it apart. Put the top cover to one side – you’ll need it later.

The next step is to remove the PCB. This is a bit easier – hold the base plastic, then lift the USB connector up and away. The SMB connector will snap out of the back when you do this.

Now desolder the SMB connector. Desolder the metal body of the connector using desoldering wick (you’ll need a lot of heat to do this — use a 50W solder station set to about 400 C). Once you’ve done that to all four pads (two on the top, two on the bottom), desolder the central pin. Remove the connector (careful, it’s hot!) and put it to one side. Clean up the solder pads by wiping the (clean!) tip of the soldering iron across them a few times.

Now prepare the cable. Cut a ~6in length of WF100 cable (the proper stuff is labelled “WEBRO WF100 CAI”). This is foam-core satellite-grade double-shielded low-loss coaxial cable, and is quite expensive, but the cost is worth it (and the foam is fairly heat-resistant). Strip about an inch of the outer insulation from both ends, without damaging the shielding braid. Pull the braid back, and separate it into four equally-sized bundles. Twist these bundles together to form four pigtails, then tin them. Remove the copper tape insulation and remove all but 5mm or so of the inner foam. The easiest way to do this is to cut half way through the foam all the way around the cable, then pull the two sections apart. Leave this section of the cable for now, and fit an F connector plug to the other end of the cable.

Put the now-bare end of the cable against the PCB, and cut the inner wire down so that it covers about three quarters of the PCB pad that was connected to the SMB connector’s inner pin. Match each of the four pigtails up with a ground pad and cut them down to match the ground pads. Solder the grounds down, then the centre wire.

Now check your soldering – make certain there are no little flakes of shielding touching the inner wire, and that the solder joints are solid and shiny. If they’re not, fix them. Also make sure you haven’t shorted out any of the pads – there’s not a lot of clearance, especially between the ground pads and the PCB components.

Put the PCB back into the case, and push it down. The co-ax cable will not sit properly in the grip that held the SMB connector – push it down firmly until it sits on the flat at the bottom. Fit the top cover and squeeze it together around the co-ax cable. You’ll note that one part of the top casing will not sit flush with the cable. Get a small file and trim it down a few millimetres so the case fits together correctly.

Now plug the USB stick in and test it. Make sure you can tune to a channel and watch TV as normal. If everything seems to work, take the bottom section (with PCB), put a few drops of superglue along the edge and squeeze the case together (I find the gel-type superglues easier to use for this). Hold it together until the glue takes hold. Leave it for about an hour (or so) to set.

There you go – one DVB-T stick with a “proper” RF connector. Fit a coupler to the F plug (of the sort used to connect two F plugs together), and make (or buy) a cable to go from your TV aerial outlet socket to the F connector on the coupler. Wire everything up, and enjoy.

Photos coming soon…

Another job done..

I’ve just spent three frickin’ hours up a ladder. Two in reasonable light, one in near pitch darkness.

What was I doing?

Rewiring the satellite dish.

I’m covered in various lacerations from all manner of prickly, sharp, pointy objects (mostly plants) and I have no thumbprint left on my right thumb, courtesy of a pair of screw-fit F connectors.

But the Sky dish works again. Well, sort of at least. 75% signal strength, 50% signal quality (it used to be 75/75). But that can be fixed by going up the ladder again tomorrow night and realigning the dish *properly* — the elevation is out a degree or so, but the azimuth is right on, going by my satfinder’s frantic beeping.

More fun for tomorrow at least.

… And nature makes a better opportunist.

Once again, one of my great plans has been foiled.

By a rodent.

For the past nine years, the house has been fitted with a satellite receiver of some make or description. First it was a Sky analogue system on the ASTRA-1 “19.2 East” constellation, then a SkyDigital system on the ASTRA-2 “28.2 East” constellation. After a failure put down to what I assumed was a dish alignment issue, the Digibox was disconnected and shelved.

So this morning I figured I’d shove a DVB-S card in my PC and see if the dish really was misaligned. Up the ladder I went, spanner in hand, ready to loosen the bolts and realign it.

A quarter-inch to the left. “Nothing”. A quarter-inch to the right. “Nothing”. A finger-push on the bottom. “Signal zero, quality zero.”

So I figured I’d eliminate the dish – I disconnected the cable at both ends and hooked a 9V battery to it on the house-side of the cable. Up the ladder I went, multimeter in tow. 2.3V. When it worked. Cable shorted inside… cable reading 470k outside.

All this, of course, pointed to a damaged cable. The cable is at ground level. I put two and two together, got five, and figured “what if a rat’s chewed at it?” Seeing as we’ve had rats in the garden before (though not near the house – mostly around the compost heap at the back), and that the cable was near to the ground, I figured it couldn’t hurt to check. I pulled out my cheap-as-chips LED torch, and climbed down from the ladder, tracing the cable along the wall. Half-way between the dish and the inlet point, I found what I least wanted to.

Four bitemarks in the cable.

One just grazing the surface, two half-way through the inner core of the wire, and one massive bite right through the cable. Said cable was as black as pitch (the core is usually white). So it’s pretty safe to assume that it’s not only ratbitten, but also pretty soaked inside as well. Which explains the zero signal report at the box.

So now I need 20 metres of decent CAI-approved satellite cable (read: CT100 or WF100, preferably the latter), new connectors, and a roll of self-amalgamating tape. And then I need to go up the ladder, re-wire the dish, and re-align it. Thankfully, only in the horizontal direction. Hmm, maybe I could point it at one of the HOTBIRD satellites instead. No! Must.. have.. BBC HD……

And the rats won’t win a second time. Because the cable’s going to run across, then down. Which leaves it open to avian predators. Though there are considerably less avians with a taste for PVC-sheathed metal than there are ground- and sewer-dwelling rodents with a taste for the same.

Of course, I could have grabbed my soldering iron and spliced some new cable in, which would have got the dish working well enough to align it, but that would have been the easy way out. And no doubt there are plenty more chew marks further along the cable…

Rats. Nature’s ultimate opportunists. Though maybe with the possible exception of dogs…

FIX: Wavy screen on Viewsonic G73fm

PROBLEM: Wavy screen – each line seems to be moved L/R by varying amounts, plus lots of audible noise (whining)

CAUSE: Main filter capacitor has failed

SOLUTION: Replace main SMPS filter capacitor (220uF 450V 85’C). Ideally this should be replaced with a good-quality (read: Matsushita-Panasonic or similar name brand) 105’C capacitor to ensure reliability. SMPS cap is largest capacitor on main PCB and stands around 1.5″ above PCB level. Part designation is C807. Located near D830 diode, L880 transformer. Note that ferrite core on D830 may need to be moved to allow new part to fit – suggested method is a C-bend in D830’s cathode lead to accommodate the ferrite.

NOTES: The SMPS filter capacitor may have expanded, with a bulge in the plastic top seal and potentially enlarged casing and torn/split plastic label. This makes the failure of this part VERY easy to detect visually, without the use of any test gear!

HOWTO: Fix the USB VID/PID on a Freecom DVB stick

A power cut scrambled the USB IDs on my Freecom DVB-T stick this morning… Freecom didn’t want to reply, the supplier just didn’t want to know (“your warranty is with Freecom, not us” – so much for the Sale of Goods Act). Anyway, here’s what I did to fix the VID/PID block on my DVB stick:

Note: this applies to the Freecom 25345-rev.3 DVB stick and may or may not work on others (e.g. the other Wideview WT220U clones with Cypress USB chipsets). Feel free to try this out, but if you bugger up your DVB stick beyond repair, you agree not to hold me liable for your cock-up. But of course, if your DVB stick is fried, you don’t exactly have anything to lose, do you? 🙂

OK, first you need the USB vendor and product ID your USB stick has adopted. Boot off a Linux LiveCD with the DVB stick plugged in by itself – that means NO OTHER USB DEVICES. Then as root run the command:
cat /proc/bus/usb/devices
Ignore all the crap about USB host adapters – what you’re looking for is a line like this:
P: Vendor=1402 ProdID=0255 Rev= 0.00
So we know the DVB stick has adopted the Vendor ID (VID) 0x1402, and the Product ID (PID) 0x0255. Shut down and reboot into Windows.

Rebooted yet? Good. Grab yourself a copy of the Cypress “CY4604 – USB Developer’s uStudio” and install it.

Now we need to do something a little fiddly. Go into C:\Program Files\Cypress\USB DevStudio\Driver, and open CyUSB.inf in Notepad. Search for this:

Note that the USB VID/PID spec line is commented out with a leading semicolon. Remove that semicolon, then do a search-and-replace over the entire file – replace VVVV with the USB vendor ID (without the 0x radix specifier) and PPPP with the Product ID you found earlier (again without the radix specifier). Save the file and close Notepad.

Now plug the DVB stick in. When windows asks for drivers, point it to C:\Program Files\Cypress\USB DevStudio\Driver – the Cypress driver will install.

Run Cypress CyConsole (Start, Programs, Cypress, USB, CyConsole). You should see the DVB stick in the device list. Select the device from the list, then go to Options -> EZ-USB Interface.

Click the “Select Mon” button, then select C:\Program Files\Cypress\USB DevStudio\CyConsole\FW\Vend_Ax.hex (this is the Cypress EEPROM Bootloader).
Click the “Load Mon” button to load the bootloader, and wait for the text to stop scrolling.

In the “Vendor Request” panel (with the “Vend Req” button on the left of it), enter the following values, in this order:
Req: 0xA2
Value: 0x0000
Index: 0x0000
Dir: 1 IN
Hexbytes: (empty)
Length: 256

Press the Clear button, then the Vend Req button. Copy and paste the contents of the log display into a text file.

Now look at the first line of the data that was returned, in my case this was:
0000 C0 02 14 25 02 00 00 08 FF FF FF FF FF FF FF FF

The first byte (C0) is the Boot Specifier – this tells the EZ-USB chip that the data in the EEPROM is a vendor/product ID pair.

The two bytes after that are the Vendor ID in low-byte/high-byte (little endian) order. The two bytes after those are the Product ID, again in little endian byte order. We need to fix these. I want my stick’s VID to be 0x14AA, and its PID to be 0x0225. That means I need to write the following data to the EEPROM:
C0 AA 14 25 02

Hit the Clear button again, and focus your attention on the Vendor Request panel once more. This time set these values:
Req: 0xA2
Value: 0x0000
Index: 0x0000
Dir: 0 OUT
Hexbytes: The data you want to write – in my case, C0 AA 14 25 02
Length: Should be 5, otherwise you’ve done something wrong.

Hit Vend Req again. Another line of text will appear at the end of the log – that’s the data that was sent to the bootloader.

Now set Dir to “1 IN” and clear the Hexbytes field. Set Length to 16 and hit the Vend Req button again. Another line will appear under the ‘data written’ line – it should look a bit like this now:
0000 C0 02 14 25 02
0000 C0 02 14 25 02 00 00 08 FF FF FF FF FF FF FF FF

As long as the first five bytes of the data are correct, you’re done. Unplug the USB stick, wait a few seconds for it to reset, then plug it back in again. Your USB DVB-T stick should now know what it is, and more importantly the drivers will recognise it again.

Floppy disc reader – stage one complete!

Yes, I know, it’s been a while since I’ve posted anything here — a few days shy of two months in fact. Hopefully this little posting will make it worth the wait 🙂

Over the last couple of years, there’s been something of a resurgence of interest in ‘vintage’ computer platforms – the old BBC Micro, ZX Spectrum, et cetera, et cetera. A lot of the people involved in saving these machines from landfill (or ‘recycling’, i.e. chopping them up and melting the remains down to salvage the metal) have been trying to archive data from the discs – system software and boot discs especially. The problem is, these discs are – in some cases – over 20 years old, and well beyond their intended service life. Not only that, but the formatting is often rather odd and can’t be read by modern PC floppy disc controllers. There is a solution already – the Catweasel disc controller. Shame it’s so expensive and hard to get hold of, not to mention the fact you need a full sized PC to actually use it – totally impractical for ‘my friend has a copy of the PRIMOS master discs and I want to archive them, but he won’t let them out of his sight’ type situations.

So I’m attempting to come up with my own solution to the problem – a portable disc reader with a USB (or RS232) interface, capable of decoding just about any floppy disc format known to man.

So far the sum total of the work I’ve done on it is getting the data separator and synchronisation word detector working. I can’t make it archive discs yet, but what I’ve done is most of the ‘hard stuff’. The only stuff left to do now is the MCU interface (and firmware) and RAM interface for reading and writing. If I manage to do this in less than two XC9572XL gate array chips, I’ll consider it a miracle.

And without further ado, here are some pretty screenshots for you to look at:
Logic trace – data separator/sync detector locking onto an IAM on a 3.5″ DSDD (720K) floppy disc:

Logic analyser trace - syncing against 720K floppy


Logic trace – data separator/sync detector locking onto an IAM on a 3.5″ DSHD (1.4MB) floppy disc:


*ANOTHER* SatPro 4600 problem

Yep, my Satellite Pro 4600 is acting up again. This time the LCD inverter (the second one I fitted) has gone intermittent. I’ve resoldered the two step-up transformers and the piezo transformer, so hopefully I’ve got the problem sorted this time. Of course, if the screen cuts out on me again, I reserve the right to scream and hurl the blasted thing out of a window.
Shopping list item #1: New laptop. Just as soon as I find one that’s Linux-compatible (read as “everything works on Linux without config file hacking or kernel patches”) and has a nice keyboard. Oh, and I like the Toshiba Accupoint ‘joystick’ mouse controller. Trackpads are awful. Of course, now I’ve said that, someone’s going to email me to tell me that I’m wrong, and proceed to insult me in the way only an obsessed Trackpad fanboy can 😀

Another DVG guide update

I’ve just updated my Atari DVG guide (the Hitch-Hacker’s Guide to the Atari Digital Vector Generator). This new release adds some information on the infamous, undocumented, ‘INS0’ instruction. Except it’s documented now. Hm.

I’ve also fixed a bad link to the Wayback Machine’s archive of Chris Pile’s Asteroids page.
Download link: vecgen.pdf

The Universal LCD Driver CPLD Lives Again!

I’m sure at least some of you have seen the graphics LCD driver code that was published on Over the past few months, I’ve been (slowly) improving it to drive more LCDs, and I think I’ve finally succeeded.

I spent a couple of hours on Saturday night reading up on the LCD controller integrated into Freescale’s DragonBall CPUs. Turns out their controller locks XSCL low when the LP line is being triggered. This seems to have been the reason why the Hitachi SP21H002-Z1A displays (which apparently came out of a Xerox WorkCentre/CopyCentre 25, 35 or 45) weren’t refreshing properly – the display driver couldn’t handle LP being strobed while XSCL was active.

So I’ve added some more logic to the HDL description (Verilog – I can’t stand VHDL) and squished my controller into a Xilinx XC9572XL CPLD. Project notes and such to come later, including a short article on guessing LCD pinouts with a multimeter. Stay tuned folks, it’s gonna be a big one!