Sunday, 26 October 2014

Stung by Chinese clone chips?

FTDI recently kicked off a whole argument about how to deal with "chip pirates" and manufacturers who clone their controllers. FTDI's response was rather crude - using an exploit in their own badly written firmware, which only writes values to eeprom one byte after the one being written (so to write to location zero, you need to write a value to location zero, and then write a value to location one - the latter value is ignored) their updated software driver started to "brick" devices using cloned FTDI chips.

It took only a couple of days before the manufacturer backed down, but their heavy-handed approach resulted in a flood of complaints following #ftdigate. Many of the complaints make the valid point that the only person being penalised was the end-user, who may well have bought their FTDI-based products in good faith (the issue of them being complicit in conducting criminal damage, as described in UK law, was never addressed, despite FTDI being a UK-based company). Their decision to not deliberately destroy devices using FTDI chips (the update did not discriminate between cloned and non-cloned chips, it just relied on the FTDI firmware being a bit shonky and failing to apply the brick-this-device approach in the updated driver) was welcomed, but hasn't actually dealt with the issue of cloned IC chips.

All of this was just a matter of discussion, ethics and principle for us at Nerd Towers. We'd never been directly affected with a problem of cloned chips not working - despite buying many devices and gadgets from overseas over the years, and even having a few hundred gadgets manufactured by a Chinese factory back in 2010.

All that seems to have changed, with the latest development on our electronic board game!

A few days ago, we received some manufactured PCBs from 3pcb.com (who we highly recommend btw) and soldered up a board. We used the BuildBrighton toaster oven to reflow the SMT components and were little surprised this weekened to discover that the boards refused to be programmed.

So this morning, we soldered up another microcontroller onto another board (we didn't bother with the hall sensors this time, just get a chip on a board to try out programming it with some firmware). Using the tried and trusted soldering-iron and rake-out-the-excess-paste approach we had an AVR atmega128 in the centre of one of our new boards in just a few minutes.

After plugging the programmer in and trying to flash some firmware to the chip, the AVRDudess software reported that the chip could not be recognised - on either of the manufactured boards.

To make sure we had all the wires in the right holes, we connected the same programmer to our original, hand-etched, prototype board. Sure enough, it detected the chip as an ATMega128. So there's obviously a difference between the two boards....

The manufactured boards use exactly the same design as the hand-etched board: it was only after making sure the hand-etched board worked that we pulled the trigger and actually ordered some from a manufacturer. To avoid any problems, we sent exactly the design we'd used to make our own board. Surely it couldn't be that?

After a couple of hours with the continuity tester, comparing our manufactured boards to the homebrew hand-etched one, we could find no difference: the PCBs are essentially the same. The microcontrollers are soldered the same, continuity between the pins of the mcu and the pads on the pcb are the same on all boards. The only other difference could be the microcontroller itself...


Before making our home-etched boards, we ordered a few atmega128 chips from Farnell. We only ordered a few, since they are relatively expensive. But they could be with us the next day, so it was worth spending the money to get them quickly, and prove the board actually worked. In the meantime, we ordered a batch of thirty chips from an online supplier (at about a quarter of the Farnell price). It didn't matter that these might take longer to arrive, but we wanted to get at least one working board, in order to get our pcb order in.

Above is a photo of the homebrew board with the chip, from Farnell.

As we'd used up all of our Farnell-sourced chips, we soldered our overseas-based chips (we can't remember whether they came from eBay or AliExpress - some investigation may be needed!) onto the manufactured boards.


The labelling on the non-Farnell chips is slightly off-centre. And much brighter/easier-to-read than on the Farnell-sourced chips. Could it be we've be sold some (non-working) clone chips?

The only way to find out, is to wait for our fresh order from Farnell to arrive, and to try soldering a Farnell-sourced chip onto a manufactured PCB, just to be sure. But we're 99% certain that the problem now lies with the actual microcontroller, not the PCB or the method of soldering. Which makes us a little nervous about sourcing components in bulk from overseas in future.
It looks like it's not only FTDI who would like to take action against the chip-cloning industry!