Author Archives: martinjonestechnology

Replacing the screen of a Wileyfox Swift phone

For the last couple of years, my wife has been using a Wileyfox Swift phone. For a budget smartphone, it’s had a few niggles but has generally been very good. A few weeks ago we and the phone got caught in an almighty rainstorm and the phone got wet. Leaving it to dry overnight didn’t help: it just made a funny fizzing noise when we put the battery back in.

I took it apart and discovered that water had got trapped in various places, not least the internal connectors to the display, cameras and so on. Some tracks on the display ribbon had completely corroded away overnight! Lesson one: if a phone gets wet, take it apart to dry it out properly. Don’t wait and see what happens.

IMG_20171007_213923.jpg

I dried out everything else with warm air and tried the phone again. It seemed to work, giving a little vibrate when I switched it on and showing the charging LED correctly. But there was nothing on the screen. Since the damage to the display connector was plain to see and nothing else seemed to be wrong, I thought I’d try changing the screen.

A replacement screen was only £25 from a Chinese supplier on eBay. It arrived quickly, very well packed with a dinky little bag of tools too, but absolutely no instructions. I couldn’t find any on the web, either. Lots of stories about Wileyfox’s screen replacement policy, but no description from anyone who’d actually done it. Well, here’s how I did it. Or, more precisely, how I’d do it again next time – I did the dismantling in the wrong order which made it unnecessarily difficult. Many of these photos were actually taken while I was reassembling the phone.

First, unclip the back of the phone in the usual way as if to change the battery or SIM card.

IMG_20171008_193146.jpg

Take out the battery and undo all the little screws which hold the inner case on. I think there are nine of them and one of them is behind a sealing sticker. Use a spudger or fingernail to gently unclip the inner case from the phone’s frame, and the insides will be revealed. Notice here the red spotty sticker – a tell-tale that the phone has been wet.

IMG_20171008_192819.jpg

This much dismantling is enough to see whether the phone will work with the new screen. The screen connector is at the top left, labelled ‘BY’ in the photo. Flip up the brown tab with a fingernail and the flexible PCB will come out. It’s easy enough, though a bit fiddly, to plug in the replacement screen, wedge the battery in place and switch on.

IMG_20171007_214101.jpg

Joy! It works. The repair is worth continuing with. Now, remove the battery and gently unclip the black plastic assembly at the bottom right.

IMG_20171008_192756.jpg

The whole phone is a miracle of industrial design and packaging, but the way the display is fitted is kind of awkward. It has a flex PCB which goes all the way from the bottom of the display up the inside of the phone to the motherboard connector, and runs behind the big identification sticker. Even more odd is the arrangement in the bottom left hand corner: a chip which I believe is the touchscreen controller sticks up on a bit of flex PCB through a hole in the phone’s frame, folds back on itself and has another connector which connects it to another part of the display flex PCB, so the whole thing forms a kind of knot around the frame.

To remove the screen successfully, it’s easiest to remove the motherboard first. There are various connectors to remove:

  • display connector at top left, if you haven’t already done it
  • selfie camera connector also at top left (flip up the black tab)
  • another connector with a white flip-up tab by the SIM sockets

Remove the two screws holding the PCB and gently unclip it – it has clips on the left and right edges. Now there are two connectors to remove from the underside of the board:

  • tiny ribbon plug which goes to the USB socket. This will probably just drop off itself, but it’s really fiddly to put back.
  • U.FL-type antenna connector on the right hand size. Carefully prise it off with fingernails or tweezers.

The vibrator motor is attached by soldered connections on another flex PCB. I left it attached, but it might be possible to unclip it from the frame or desolder the connections. Be careful, it’s fragile.

IMG_20171008_192208.jpg

Note how the screen flex PCB  goes underneath the sticker. It turns out that it also runs underneath the USB flex PCB. Peel off the sticker (a bit of gentle heat helps to soften the glue) and peel back the USB flex PCB. I had to score the screening tape between the two flexes.

IMG_20171007_223816.jpg

Now the screen flex PCB is free all the way to its hole through the frame near the bottom of the sticker.

Now to untangle the fiddly bit at the bottom left. First, unplug the little connector by easing up the black tab. Mine also had a bit of yellow Kapton tape holding it down. Withdraw the flex PCB from the connector and straighten out the folded flex PCB with the chip and connector on it – it’s held in place by sitting on a little peg on the frame.

IMG_20171007_224111.jpg

Now the screen is fully disconnected. Time to remove it from the front of the phone.

The screen is bonded to the Gorilla Glass sheet which forms the front face and touchscreen. This in turn is just stuck to the phone’s frame with double-sided tape. I used a heat gun to warm the glass and soften the adhesive, and a combination of a Stanley knife and spudger to ease it away from the frame. The glass is surprisingly strong and flexible: I managed not to break it.

IMG_20171007_221326.jpg

IMG_20171007_222156.jpg

Once the tape has all softened and come off, the screen’s flex PCBs should come free with a bit of wriggling. Now clean off the self-adhesive goo. I used a spudger and car brake cleaner for this. The surfaces of the frame should be clean and smooth ready to accept the new screen.IMG_20171008_112802.jpg

The new screen needs a bit of preparation before fitting. The little connector for the touchscreen has to be disconnected:

IMG_20171008_113242.jpg

and it needs some self-adhesive tape applying, because it doesn’t appear to come supplied with any. I used little bits of carpet tape (!), shown in the photo below still with its yellow backing paper on.

IMG_20171008_191605.jpg

Now thread the screen’s flex PCBs through the holes in the frame where they should fit, being particularly careful with the folding chip thingy, and the touchscreen ribbon which is easy to get trapped and forget about. Once you’re happy that the flex PCBs are sitting in the right places, peel off the backing from your double-sided tape with a scalpel or tweezers and stick the screen in place.

Assembly is the reverse of disassembly, to coin a phrase.

Dress the flex PCBs into their final positions. Fold up the touchscreen chip and connector and pop it on to its little peg, then plug in its ribbon and lock the connector. Then lay the flex PCB to the motherboard in place, lay the USB flex PCB on top of it and re-stick the Wileyfox sticker. Don’t get cat hair on the back of the sticker because it won’t stick properly.

Put the motherboard back in, taking care to reconnect all the cables including the really fiddly one to the USB flex PCB. I found I had to manipulate it with the blade of a knife underneath the motherboard. Once the screen is reconnected, it’s time to switch on for a test.

IMG_20171008_192925.jpg

Success! Now just to put the screws back in and celebrate. The phone works again, though the rear-facing camera appears to have died. I don’t know if that’s because of the water or because I dislodged its connector and didn’t notice. One day I’ll have another look at it. Until then, this phone is now only a spare, so nobody’s too bothered about not being able to take photos with it.

IMG_20171008_193036.jpg

Repairing the display of a CAP reader

My bank in the UK requires me to use a CAP reader for some online transactions, its security compromises notwithstanding. It’s quite simple to use: I slide the bank’s card in to the slot and follow the instructions on the display and on the bank’s web site. At the end of the process it displays a number which I have to type in to the web site in order to authenticate the transaction.

The problem is, over the last few years, the displays have been gradually failing and losing rows and columns of pixels. It reached the point this morning where I couldn’t read the numbers on either of the CAP readers I’ve got, and so I couldn’t make a payment to a supplier. Getting hold of a replacement reader would take a while – I’m outside the UK at the moment – so it was time to see if they were repairable.

IMG_20170927_103354

Some of the fixing screws are hidden. There’s one underneath the label in the centre (which displays ‘void’ when it’s peeled off – never mind), two under the feet, and four inside the battery compartment, which itself is closed with one little screw.

IMG_20170927_103837

The case unclips, and then there are two black plastic pieces which form the card slot. They’re held by another six screws. That removed, we can see the PCB and display. The display is connected by a ribbon which is bonded to the PCB using a special conductive adhesive. The adhesive appears to gradually come unstuck, so the display stops working. Squeezing it with a fingernail restores some missing parts of the display temporarily.

IMG_20170927_103238

There are lots of guides on the web about repairing these things and I’d had a few unsuccessful attempts previously on other gadgets. This time I was successful, and the method I used was simple. Lay a piece of paper over the area where the ribbon is stuck to the PCB, and then apply gentle pressure with a hot soldering iron to melt the adhesive. I worked my way along in a series of squeezy dabs. The paper chars a bit, but that’s just an indication that it’s working.

Having done the whole ribbon, carefully peel off the paper. It tends to stick to the ribbon so pull it off gently so as not to pull the ribbon off the PCB.

IMG_20170927_103301

Success! The display is working again, tested using a bench power supply clipped on to the battery contacts. I tickled the leaf switch which indicates that a card is in the slot. Of course the card is not responding – it’s not there.

IMG_20170927_103331

I did both the readers I’ve got, and they both worked. I then tried an actual banking transaction which also worked, so there’s no funny security boobytrapping going on. That’s good for me, because I can repair my CAP readers, but less good for anyone who doesn’t know where their CAP reader has been.

IMG_20170927_104626

Tektronix 7A18 versus Soviet Я4C-90

In a previous article, I described briefly the Tektronix 7000 series of oscilloscopes and some that looked awfully similar from the Soviet Union. Having the technical documentation from both, I decided to do a comparison and see what, if anything, the designs owed to each other, bearing in mind that the soviet version appeared at least 7 years after the US one.

I chose the vertical amplifier plugin for comparison. The soviet one is called the Я4C-90, and looking at its specifications (2 channel, about 100MHz bandwidth) it seems very similar to the Tektronix 7A18. Here are the two side by side: my own 7A18 on the left, and a picture of an Я4C-90 from the internet on the right.

7a18-r4c90

They have a lot in common. Where Tek have used rotary switches for the trigger source and display mode, and a slide switch for the channel 2 polarity, the USSR used pushbuttons for those functions. In addition, the Я4C-90 has a 20MHz bandwidth limiting switch, like the (200MHz bandwidth) Tektronix 7A26.

I’ve cut-and-pasted sections from each of their technical documentation in order to be able to compare the designs. Let’s start at the front end: the attenuator.

Attenuator

tek7a18-attenuator

First, Tektronix. They have used x100, x10, x4 and x2 attenuators with switches arranged to bring them in to circuit for the various deflection settings, from 5mV/div to 5V/div.

r4c90-attenuator

Now the USSR. They have used x100, x10, x4 and x2 attenuators with switches arranged…oh, hang on, it’s exactly the same. Even the switch combinations are the same. And whoever drew the diagram had exactly the same idea as the Tektronix drawing office when it came to representing the switching.

Well, let’s move on to the main amplifier.

Amplifier

tek7a18amplifier

Tektronix have used a FET input stage followed by a couple of bipolar differential gain stages, with an emitter follower on the output. And the USSR? Well, the input stage is visible on the right hand side of the attenuator diagram, and it’s practically identical to the Tek one even down to some of the resistor values. They didn’t have Tek’s matched dual FETs so had to make do with two individual ones matched on test. Let’s look at the rest of the stages.

r4c90-amplifier

Oh look! Two differential bipolar gain stages, just like Tek. I can only see two noteworthy differences: the gain control acts after the second stage rather than after the first, and the USSR version doesn’t have the emitter follower on the output.

Next comes the channel switch, which selects between channel 1 and channel 2 to feed to the mainframe.

Channel switch

tek7a18-channelswitch

To get high performance here, Tektronix actually designed and made their own ICs. The channel switch, U270 in the diagram, uses a 155-0022, which appears in all sorts of places in Tek equipment where switching or addition of differential signals is needed. That’s followed by a transistor stage, Q280/Q380, which drives the mainframe. Here’s the soviet equivalent.

r4c90-channelswitch

Fancy that. There’s a special module, MC1, which does the switching. An internal circuit diagram  is also present, which looks suspiciously similar to the rather ambiguous diagram of the Tek 155-0022 chip. The soviet module is actually a 04КН009, which has been extensively reverse engineered by Erik Baigar, see his site here. Interestingly it’s a hybrid module rather than an integrated circuit, though it clearly does the same job.

Interesting here is the frequency compensation network. The Tek design has, between pins 1 and 16 of U270, a couple of RC networks, with one adjustment to get the high-frequency response of the stage right. Conventional enough.

The USSR design has a whole load more stuff in the same position, between pins 1 and 14 of MC1. In addition to three RC time constants with three adjustments (!) there’s a curious arrangement involving a thermistor R4 and a pair of varicap diodes D1 and D2, which seems to do some temperature-sensitive frequency response adjustment. It could be very creative design, but it smacks of desperation to me: the 04КН009 module is probably more sensitive to temperature variations than the Tek chip.

Bandwidth limiting

The final transistor stage before the output isn’t shown on the USSR diagram. It has a separate page to itself. It’s a little more complex than the Tektronix 7A18 because it has the 20MHz bandwidth limiting function. Now, there’s a Tek plugin, the 7A26, which has a 20MHz bandwidth limiting function. Just for fun, let’s look at the circuit diagram of its output stage.

tek7a26-bandwidthswitch

It has an extra pair of transistors and some filter components (C860/L860/L880) connected by a diode switching arrangement. What did the USSR do?

r4c90-bandwidthswitch

Well I never! An extra pair of transistors and some filter components (C34/L1/L2) connected by a diode switching arrangement. Great minds think alike.

There are differences, of course. The ones I’ve noticed are:

  • The Я4C-90 doesn’t have the probe identification ring and ‘Identify’ button that the 7A18 has.
  • The readout is implemented differently in the Я4C-90. It uses a 6-bit digital interface to the mainframe rather than Tektronix’s delightfully eccentric 2-dimensional analogue readout interface.
  • The Я4C-90 appears to use TTL logic to do the channel switching for CHOP and ALT modes, whereas the 7A18 uses a mechanical switch.

The architecture of the Я4C-90 is, barring minor details, identical to the 7A18. It’s close enough for me to say that it’s a straight copy which has been adjusted to suit the soviet semiconductor technology available at that time. If imitation is the sincerest form of flattery, the engineers in the USSR must have been big fans of Tektronix.

Soviet Tektronix 7000-series oscilloscope copies

Back in 1970, Tektronix introduced their ‘7000’ series of oscilloscopes. Their clever plug-in architecture offered unmatched performance and flexibility, and they quickly became an industry standard. They were ubiquitous in well-heeled electronics labs in the 1970s, 1980s and into the 1990s, at least in the US and UK. I’ve still got three examples in regular use because they do things that modern scopes struggle with. You want 10 microvolts/division sensitivity? Grab a 7A22 plugin. Want to see the same signal in the time and frequency domains together? No need to go and buy a shiny new ‘Mixed Signal Oscilloscope’. Just plug in a 7L12 spectrum analyzer. Need a 100MHz differential amplifier that can deal with 500V common-mode? No problem: Use the 7A13 plugin. All this stuff is more than 40 years old but still does a state-of-the-art job.

Behind the iron curtain, things developed at their own pace. In 1977, the Lithuanian ‘555’ factory produced the C1-91, and then the C1-115 and C1-122 ‘universal oscilloscopes’. On the right, here’s a picture I found on the web of a C1-115, together with, on the left, a picture of my own Tektronix 7603 taken a few minutes ago.

7603-c1-115Notice any resemblance? Same panel layout, same arrangement of plugins – even most of the knobs are in the same places. Let’s just say the soviet design seems to have been heavily inspired by the Tektronix one.

The soviet scopes don’t appear to have been as common in the east as the Tektronix ones were in the west, but there are some survivors in private hands. There’s a page describing the range on the TekWiki here, which includes links to some owners’ pages. However, there has been very little technical documentation available, and I’m fascinated by the technology: how much of it was copied, and how much was original?

Whilst looking for something else on allegro.pl recently, I came across a set of manuals for the C1-112 mainframe with Я4C-90 Y amplifiers, Я4C-91 timebase and 2K11 calibration plugin. They include circuit diagrams and other technical information. Bidding wasn’t exactly fierce and I got the lot for 5zł. The nice thing about them is that they’re in German, which is easier for a western audience to understand than Russian or even Lithuanian. Sadly they’re not quite the works of art that the Tektronix manuals are, but these even include the calibration certificates!

I’m very curious about what’s inside. In a future blog post, I hope to compare the Tektronix and soviet designs side-by-side and see what they have in common.

Super Breakout to JAMMA, Part 2: Colour

Having got the power supply working for my original 1978-vintage Atari Super Breakout PCB, it was time to get the screen looking right.

super-breakout-cabinet

At the time Super Breakout was made, video games were mostly black and white. Colour screens were expensive, and so were the relatively complex electronics needed to generate a colour image. But black and white images don’t look too pretty in an arcade, so colour was added by sticking patches of various colours of clear plastic foil on to the screen. Simple, and pretty cheesy, but effective enough to get more coins into the machine. Games like Space Invaders used the same technique.

Fast forward to the 21st century, however, and black and white screens have become rare and expensive while colour screens are standard. My arcade game testing and playing rig uses a colour screen, and I didn’t want to stick coloured plastic on it – it would make other games look very odd! I wondered: how about adding colour to the image electronically?

I had recently been given a MachXO2 pico dev kit from Lattice Semiconductor. It’s a neat little thing, with a 1200-LUT MachXO2 CPLD on it and a built-in USB interface which makes it easy to program. The Lattice Diamond development software is available to download and license at no cost. I wanted to gain experience using this series of chips, since they seem to offer much better price/performance than the older Xilinx CPLDs I’ve used on several projects. Colourising Super Breakout seemed like a neat and vaguely useful example project.

Super Breakout produces a roughly NTSC-standard composite video signal. It’s thoroughly analogue, and there’s no way it could be connected straight to the CPLD. My task was to convert the composite signal into separate sync and video signals, which could then be processed using the CPLD.

atari-monochrome-video-recovery

The industry-standard LM1881 chip separates the sync from the signal. Its output on pin 1 is directly compatible with the CPLD. Getting the video information is a bit more tricky. The video output from the Super Breakout board is about 0.7V peak-to-peak, which isn’t enough to reliably drive any kind of logic gate. I took the easy way out and used an LT1252 video amplifier with a gain of just under 5 to generate a signal large enough to feed into a 74HC132 Schmitt trigger which produces a clean logic output. It was also necessary to add a clamp, the transistor in the top right driven from the blanking output of the LM1881, which forces the black level of the video to a known voltage. Without the clamp, the definitions of ‘white’ and ‘black’ would drift around depending on the picture content, which leads to peculiar black patches and streaks in bright areas of the image.

The resulting waveforms look like this. At the top, the composite video waveform from the Super Breakout PCB. In the centre,  the sync pulse at pin 1 of the LM1881 chip. At the bottom, the digital video ready to feed to the CPLD.

Here’s the circuit built on matrix board, next to the Lattice development board. There’s some more electronics at the bottom left, but more about that in another post.

img_20170215_215403

Generating the colour signal was relatively simple: a counter, clocked at about 6MHz, reset by the horizontal sync signal, indicates the position along each line of video. Some comparisons of that counter with fixed values decide what colour the output should be. A simple AND function of the colour with the video input and – lo and behold – a coloured screen! And no plastic film in sight.

img_20170215_215256

 

 

 

PCI USB 2.0 Adapter Lessons

You get what you pay for. Buy cheap, buy twice. I’ve heard them all before. But a couple of my old-but-useful Linux PCs needed an upgrade to high speed USB recently, and I didn’t want to spend much. A quick search on allegro.pl (the Polish equivalent of eBay) turned up just what I was looking for. USB 2.0 adapter cards to fit the now-retro PCI bus, for just 20 złoty, or a bit less than four quid in old money. “Five USB 2.0 ports”, exclaimed the advert, in Polish. “Four external and one internal”. Perfect – I wanted to connect an internal card reader so the internal port was just the ticket.

The cards arrived this afternoon and I examined them. What do you get for four quid? A generic Chinese box and the card in an anti-static bag. No instructions or other such luxuries.

There’s just one chip on the card: a Via VT6212L. Wanting to know what I’d got, I looked it up. It’s still listed on the legacy section of Via’s website. The specification there, though, shows that it’s a 4-port USB controller. So how had my card got 5 ports?

A close look at the PCB tracks on the card reveals all. The internal USB port is wired in parallel with the topmost external port, so you can’t use both at once. Looking more closely, there’s a footprint for a 10-pin Molex header which would be ideal for my internal card reader, but it’s not fitted. Examining the tracks round the header, it turns out that the two USB ports it provides are connected in parallel with the top two external sockets. If you want to use the header, those two external sockets are no use!

Oh well. I can live with 4 ports, and remove or ignore the ones that won’t work. But there’s another design “feature” that came to light while I was examining how the sockets were wired up.

One of the functions of a USB port is to supply power to the device that’s connected. That’s very useful. Last time I designed anything with USB host ports on it for public use, it was important to make sure that power was monitored and limited so that a misbehaving device or damaged cable can’t affect other devices or, worse, cause overheating. All this is written into the USB specification and there are handy chips available to make it easy to implement. But they cost money.

Examining this board, it became clear that the designers took no such precautions. The 5 volt power comes straight from the PCI bus to the USB connectors without so much as a fuse, or even a decoupling capacitor. Any mishap on a USB connector can therefore receive the full force of the PC’s power supply, which can be tens of amps. Yay! A short circuit will at least crash the PC, or even result in melted cables and scorched PCB tracks.

Time for some modifications.

  • Remove the top two external USB sockets, which are wired in parallel with the internal connector
  • Remove the internal USB connector
  • Fit the Molex connector for easy hookup of my card reader
  • Cut the track carrying 5V power from the PCI bus to the USB sockets and insert a sacrificial zero-ohm resistor to act as a last-ditch fuse
  • Splash out on a few microfarads of decoupling capacitor fitted to the place marked out on the PCB but kindly left free.

Here’s a picture of the results. The board is now in service and working nicely.

Incidentally, I have just retired an old USB1.1 board which shows how it used to be done ‘properly’, in the days when anyone cared about these things.

Note the little 8-pin chip on the left hand side. That’s the one responsible for switching and protecting the power output to the USB sockets. The one fitted is a Micrel M2526, but there’s also space for a Texas TPS2052 which does the same job. Belt and braces!

Super Breakout to JAMMA, Part 1: Power Supply

In a previous post I resurrected an Atari ‘Super Breakout’ PCB from 1978. One of the rules of my collection of arcade game boards is that they should all be playable, if they’re working. To that end I try to construct adapters to make the games all compatible with the JAMMA wiring standard, so I can just plug them in to my gaming setup and enjoy them. Usually it’s just a matter of wiring: most game PCBs after about 1980 use similar power and control signals to the later JAMMA standard, but differently wired, so no electronics are needed. Plug time: the Deluxe Arcade JAMMA fingerboard is really handy for making adapters, and I sell them. They’re great value. Buy lots and give them to all your friends.

Super Breakout isn’t such an easy case, though. About the only things which can be wired directly to a modern arcade setup are the coin contacts and start button. Everything else is unusual, starting with the power supplies.

JAMMA wiring provides +5V for powering the main logic, +12V which is usually used by the audio power amplifier, and -5V which is also used on some boards by the sound generation circuitry. Super Breakout’s power input circuitry looks like this.

super-breakout-power-supply

The circuit appears to expect +10V DC, and a pair of centre-tapped AC supplies, one of 16.5V AC and one of 25V AC. The end result of it all is supplies annoyingly similar to the JAMMA standard: +5V, +12V and -5V, with an extra +20V for the audio power amplifier. I could, of course, just modify the board so that those supplies come straight from the JAMMA wiring, but that would violate another of my rules: no modifications to the original PCBs. Any conversions or adaptations must be done so that the original board, unmodified, can plug into my adapter and thence into a JAMMA connector.

Looking more closely at the circuit diagram, the situation isn’t as bad as it looks. The +10VDC just feeds the input to a regulator which generates the +5V, so it just needs to be a DC voltage large enough to allow the LM323 regulator to do its job. With a regulator this old, this ‘dropout voltage’ is about 3V, so anything from 8V DC upwards should be fine. The lower we can keep this voltage, the less power the regulator will have to dissipate as heat, so the game will run cooler. That’s got to be a good thing.

The 16.5V AC turns out to be used just to power the -5V regulator, so any negative DC voltage greater than about -8V (again allowing for the dropout voltage) will be OK. It doesn’t need to be AC at all. The 25V AC input is simply used to generate the +20V and +12V supplies, so it also doesn’t need to be AC. +20V DC will do fine.

Having figured this lot out, the power supply problem is much less daunting. Converting the +5V and +12V from JAMMA to +8V, +20V and -8V is perfectly manageable.

Various power supply modules are available at low cost from far-eastern suppliers on eBay, including the very popular 150W boost converter module. One of those is just right for converting +5V up to +8V, and a smaller off-the-shelf module can convert +12V up to +20V. Incidentally, though it would seem easier to convert +12V down to +8V, I chose not to do this: the +8V supply to Super Breakout needs to be able to deliver several amps to power all the logic, and the +12V JAMMA supply isn’t rated to handle that sort of load. JAMMA power supplies assume that the lion’s share of the load is on the +5V rail, so that’s where I’ve put it.

Deriving -8V is a bit more tricky. The commonly-available boost converter modules only handle positive voltages, and I can’t play any funny tricks with ground because the +8V and +20V supplies need to share ground with -8V. The answer is a Ćuk converter. A few components hooked on to the switch output of the +20V boost converter can deliver a negative voltage. It’s not regulated, and will depend somewhat on how hard the +20V boost converter is working, but it’s good enough to feed the -5V regulator on the Super Breakout board. Below is a picture of the arrangement. The components inside the dotted pencil outline are on the off-the-shelf boost converter (of the ‘LM2577‘ type commonly available on eBay).

img_20160917_105713

The overall arrangement looks like this, in diagram form:img_20160917_204933

and in real life, it all fits together quite neatly.

img_20160917_205012

The 5V-to-8V boost converter is the large red board at the top. The 12V-to-20V boost converter is the blue board at bottom right, and the components for the Ćuk converter are on the matrix board at bottom left. Note the red wire taking the signal from pin 4 of the LM2577 chip to feed the converter. Game on!

 

 

 

Making BeagleBone Black serial number available to user applications

The BeagleBone Black is a handy little board. It has a 1GHz ARM processor and 4GB of on-board Flash storage, and runs Linux very easily. In particular, the Debian distribution is available ready-made to just copy on to the board from an SD card. I’ve been using them in various embedded applications recently.

IMG_20160812_162532

One of the applications I’m working on at the moment will be deploying BeagleBone Black boards in hundreds of locations, and we have to manage them sensibly. When managing all these boards, it will make our lives much easier to know their identities. Happily, the BeagleBone Black is fitted with an EEPROM which contains various useful information about it, including its serial number and a copy of the barcode stuck to the board.

The EEPROM is accessible via the I2C bus. The bus itself is accessible via /dev/i2c-0 at address 0x50. As standard, Debian Linux is set up so that the group i2c has access to this device. However, the kernel device tree is one step ahead of us. A special at24 driver takes over access to the EEPROM, so any attempt to access it directly via /dev/i2c-0 just gets denied with ‘Device or resource busy’. The contents of the EEPROM are available, however, in sysfs under /sys/bus/i2c/0-0050/eeprom.

There is also a bone-capemgr driver which presents some of the EEPROM contents in a more convenient way, as a series of files elsewhere in sysfs, under /sys/devices/bone_capemgr.9/baseboard/

This is all very handy, but all the files in sysfs are only readable by root. That’s not helpful for my applications. I don’t want to be running things as root if I can possibly help it. I wanted to find a reasonably legitimate way to make the relevant sysfs files available to a group of users. We can’t just change the permissions on those files because sysfs is created dynamically, so any changes would be lost after a reboot.

The obvious way to do this would be via a udev rule so that the permissions are set up when the relevant devices are found. However, udev rules don’t seem to have a direct way to change the permissions and ownership of files in sysfs. After some experimentation I came up with a couple of rules which did what I wanted. They match on the narrowest set of keys I could work out, and run chmod and chown to set the permissions the way I’d like them:

DRIVER=="bone-capemgr", RUN+="/bin/chown root:i2c /sys$env{DEVPATH}/baseboard/serial-number"
SUBSYSTEM=="i2c", DEVPATH=="*0-0050", RUN+="/bin/chown root:i2c /sys$env{DEVPATH}/eeprom", RUN+="/bin/chmod 0640 /sys$env{DEVPATH}/eeprom"

Put those lines in a suitable rules file. I used /etc/udev/rules.d/30-bone-capemgr.rules. Then, running

udevadm trigger

Should trigger the rules and set the permissions. Because sysfs is recreated at boot time when the various devices are found and added, the rules will trigger each time and leave the permissions the way we want them.

The board serial number is to be found in bytes 16-28 of the EEPROM, and the barcode is in bytes 80-103. The hexdump utility is handy for extracting the data. For example,

hexdump -e '8/1 "%c"' /sys/bus/i2c/devices/0-0050/eeprom -s 80 -n 23

should show the barcode. Wrap that up in a script and we have a programmatic way of finding the board’s identity.

Super Breakout Saga

In the beginning, or at least in 1972, there was Pong. It was one of the first video games to become widely popular, and made Atari’s name in the games industry. It wouldn’t be overstating the case to call it seminal, even though the game itself involved only bouncing a ball between two bats. Four years later, Pong begat Breakout, which extended the bat-and-ball mechanics of Pong to knocking bricks out of a wall. Then came Super Breakout, a similar game, but more complex, with three different modes of play and even multiple bats and balls. Adding the new features needed a new, powerful ingredient: Super Breakout was one of the earliest arcade games to feature a microprocessor. This was in 1977, before Space Invaders, before Pac-Man, before Donkey Kong.

super-breakout-cabinet

I picked up this PCB several years ago on eBay. The price was keen because, of course, it was ‘untested’. We all know what that means. Broken. That’s the way I like them. It’s hard to get to know a game board that’s in perfect working order.

IMG_20160807_180709

IMG_20160807_180717

Getting this one running was more than the usual challenge. From about 1980 onwards, a few conventions about how arcade games were built and wired got established. This game pre-dates those, so the usual rules don’t apply. Power? Instead of 5V and 12V DC supplies, it wants 10V and 22V AC, centre-tapped. Video? Instead of the usual colour RGB with separate sync, it delivers black-and-white composite video, and expects a screen with strips of coloured film stuck to it. Controls? No joystick here. Not even a trackball. Just an analogue potentiometer to control the paddle, and various flashing lights and switches.

My aim with every arcade game I acquire is to adapt it to the JAMMA standard, so it’s easy to plug it in and play it. This one was going need more than just a bit of wiring.

The first job was to get the board running. I rigged up temporary power supplies and a black-and-white monitor which could handle its video output.

The most serious fault was faulty RAM chips. Super Breakout has eight RAM chips of a whole one kilobit each, totalling a spectacular 1 Kbyte of RAM. Six of them were faulty. Fortunately a kind member of the most excellent UKVAC forum had some available. Identifying the faults was made easier by the board’s test mode, which makes beep-boop-boop noises to indicate which chips it thinks are faulty.

IMG_20160807_180733

The sockets holding the program ROMs and the processor were all rubbish and had to be replaced with modern ones. Cleaning them never worked reliably. This particular version of the game uses 12 ROM chips, each holding 4 kilobits. That’s a generous 6 Kbyte of program code, but it’s also 216 pins in sockets to go wrong.

IMG_20160807_180742

There was one faulty logic gate ( a 7420) associated with the ‘game select’ and ‘serve’ switches, and the DIP switches for choosing the game options needed a squirt of DeoxIT switch cleaner. Success!

IMG_20160807_220827

With those problems attended to the board passed all its self tests and seemed to run quite happily. Now to design that JAMMA adapter.

Tektronix 549 Storage Oscilloscope, Restored

A couple of years ago, I restored this exquisite brute of an oscilloscope to working order. You can read the story starting with part 1. I never posted any pictures of the finished article, so here they are.

You can read more about the machinery at the TekWiki.

549_34a

549_front_off

549_34c

549_34b

549_rear

1a4

manuals

Switched on and working, with all four traces showing.

549_front_light

549_front_dark

I made a short movie of the storage functions working.