When I started this blog I meant to do so mainly in order to document my own projects. I found that when I wanted to re-use parts of one of my projects I sometimes couldn't remember why I had made certain decisions. So I needed to document my work. And if anyone else could benefit from it, why not publish all in a blog?
But I never intended to bore anybody with my opinions on anything. This post is an exception, because I think I came across someone's project (or product) I really like. It is open source, so you don't have to buy anything. Also, I won't post any links to a store, etc.
How I flash my Firmware on 8-bit Atmel Controllers
I made my first steps in the old days, when PCs used to have a serial port. And my first programmer was a ponyprog serial programmer. It worked well, but some time later I decided to buy the STK500 from Atmel. This allowed me to use all existing programming modes and to directly flash from the AVR Studio. For a very long time, this was my main development tool. And it still sits on my desk. But it has disadvantages. It isn't really mobile. It needs a mains power supply. And nowadays you need a USB-to-serial converter to connect it.
I sometimes write programs on my netbook. So the way to go these days is to use a USB based programmer. There are lots on offer. But I found one that suits my needs really well. It is based on the USBasp project. This is an open source USB programmer, which is small and simple. It gets powered and controlled by the USB port. It uses standard components (e.g. an ATmega8), so you can build it yourself. A piece of perf board will do, really. Although various optimised layouts are available for download, if you want to make a PCB. Kits are available, too.
But what really surprised me was the fact that some Chinese companies manufacture USBasp compatible hardware. They are sold through the well known channels. And you can get them for almost no money. I bought two different devices for under 3 € each. And this includes shipping!
I don't know how they can sell them at such a low price. As an end user I would pay more than 4 € for the components, let alone shipping. This was an offer I could not resist, so I ordered two different versions, apparently from different manufacturers.
And this is what I got after waiting for a couple of weeks:
Both programmers are about the size of a standard USB memory stick, but with an ISP connector at the end. Both came with a standard 10-pin ISP cable. The upper device in these pictures is apparently from a manufacturer called LCSoft Studio, the lower device by a manufacturer called betemcu.
Both work and both work well, but there are a few differences and details worth mentioning.
I do prefer the LCSoft version. And here is the reason why: It sticks closer to the original USBasp schematic and it is more flexible. What do I mean by that? Firstly, both designs include a low-drop 3,3 Volts regulator. This is not part of the original USBasp design, but can be found in various improved versions of the schematic. The main advantage is that you can power your target device through the ISP cable and you can use the programming interface at the right voltage levels.
But the betemcu part has a resistor to select the Voltage. I believe that you have to remove it in order to switch to 3.3 Volt operation.
What you can not do however is to disable the power supply. This can be inconvenient or even destructive, if the power pin on the target's ISP connector is already connected to a power supply.
The LCSoft part has a three-way jumper, so you can easily choose between 3.3 / 5 Volt operation and you can disconnect the power pin.
See the detail here:
The Voltage jumper is marked in orange. But this version has two more jumpers. They were not actually populated, but this is easy to do. Jumper two is marked green in my photo. It connects the ATmega8's reset pin to the ISP header. What is this good for? Actually, this is quite clever. All ISP header pins are connected to the controller (MISO, MOSI, SCK and optionally: RESET). So it is possible to re-program the firmware on the programmer itself by using a second programmer.
The third jumper (marked red) is really obsolete. It was used in earlier versions of the firmware to reduce the programming speed in case your target systems speed was below 1.5 MHz. In newer versions this is controlled by software.
A minor flaw of the LCSoft ISP cable can be seen in the picture above. By convention, the ribbon cable's pin 1 should be marked red. This is the other way round in the cable I got. But electrically, everything is fine. Be careful though, if the header on your target board is not keyed!
Reprogramming the betemcu part is also possible. However there is no jumper, but a solder bridge. Again, here is a photo:
You needn't necessarily solder a wire across those contacts. I held a piece of wire in place during programming. That worked just as well. But I do prefer the LCSoft solution with a proper jumper.
One final difference is that the LCSoft part actually connects the ATmega's UART lines (TX/RX) to pin 4 and pin 6 of the ISP header. This was done in the USBasp project for future extensions (like debugging). On the betemcu device, those pins are connected to GND.
So from a hardware point of view alone I would recommend the LCSoft variant of the programmer.
Perhaps it is worth mentioning that both programmers have a fuse on the power supply line, but I doubt that would save your motherboard if really try something stupid. And both parts have the projects two status LEDs.
In part 2 I will take a look at the available software options for this programmer.