The first thing I did when I progressed from Arduinos to programming Atmel 8-bit microcontrollers in the raw was build a programming and prototyping board.
[BTW, for once, this is not going to be a multi-post project. I’m putting a bit of background here, but will put full, constantly updated details on the GitHub page.]
Arduinos make it easy for you – just plug in the USB cable and you’re good to go. But it’s actually not that difficult to program ATMEGA microcontrollers without all the USB wizardry. If you have a programmer device (many people use Arduinos for this purpose; I have the Atmel-ICE), you just need to hook up the MISO, MOSI, SCK and RESET lines. It’s simple enough and you can do it on a breadboard (that sounds like a t-shirt slogan in the making).
With the DIP version of the ATMEGA328P, and the ATTINY85, I decided to go one further and built programming rigs using protoboard, which I mounted alongside breadboards for easy prototyping. ZIF sockets make it simple to slot in a chip, program it and then transfer it to a target project. Or I can leave the chip in place for experimental purposes. It has worked very well.
For the SmartParallel project, though, I decided to go with the ATMEGA328PB version of the microcontroller in the TQFP-32 form factor. This was mainly for space reasons on the board. So I needed a new programming and prototyping rig.
You can buy TQFP-32 adapters for cheap on Ebay. They come with carrier boards that adapt the adapter to a couple of different standard DIP footprints.
I threw together a breakout board on stripboard. It works fine, but it’s ugly as hell. You can’t see it, but there are loads of wires on the underside. That’s because the pins relating to the various ports are not all contiguous. PE0 and PE1, for instance, are on pins 3 and 6 (with VCC and GND in between) while PE2 and PE3 are on pins 19 and 22, on the opposite side of the chip. I wanted all the pins for each port neatly arranged together. The result was a load of flying wires and some soldering that can only be described as, um, enthusiastic.
And so, in these days of cheap PCB fabrication, it was obviously time to do something a little classier.
Like I said, full details will be on GitHub, but here are some features of the board:
- You can use an external crystal or not. The crystal plugs into female headers. There are jumpers to enable/disable the crystal and 22pF capacitors connecting the crystal’s contacts to GND.
- The standard TX0 and RX0 pins, along with GND, are further broken out to a serial port header. This is six-pin, to match the connectors used on FTDI USB-to-serial cables. Two more pins headers are provided for the RTS and CTS signals. If you want to use these, you can simply hook up short jumper cables between these headers and the GPIO pins of your choice.
- The standard SDA and SCL signals are further broken out to additional headers, which are accompanied by VCC and GND pins, to make attaching I2C devices easy. The board has 10kΩ pullups on both lines and these can be enabled or disabled using jumpers.
- The AVCC input is tied to VCC via a 10µH inductor, with a 0.1µF capacitor to GND – precisely the low-pass filter recommended by Atmel if you want to use the microcontroller’s analogue features but don’t want to bother with a separate analogue power supply.
- There’s a reset button, with the reset line pulled high.
This is what the schematic currently looks like.
And this is a view of the board in KiCad.
As I write this, I’ve just placed an order for the Rev1.0 boards, so it’ll be a couple of weeks before they get here.
[UPDATE 31/07/2019] Just a quick note to say that the PCBs arrived and I made up one board. So far it has worked like a charm.
Here’s a shot of it being used for the prototype of the SmartParallel board. (Click on the photo for a bigger image – apologies for the crap smartphone pix.)
And a closer look.