Friday 6 June 2014

Another Open Evening, another PCB design

Having successfully programmed the ATMega128 chip on the breakout board, it was time to get etching at BuildBrighton's Open Night again.

We've designed another PCB layout, complete with a 6-way programming header, to allow us to use our USBASP programmer and a connector with "pogo pins" to burn code to the ATMega128, even while it's soldered in place on the board. (the earlier design required the chip to be programmed before being soldered to the pcb)


Pogo pins are simply spring loaded pins, which mean you can push a pin header onto the board, and ensure that all pins are making contact with the pads equally. This is a much easier way to program a chip on a homebrew pcb, than trying to push all 64 legs down equally onto an etched board, and hope to get continuity long enough to dump code to the chip!


The first mistake (of many) was laser cutting the top layer for this new design. We're trying out round holes for the hall sensors, with a view to using die cutting rather than laser cutting for the final manufacture. Apparently round dies are much cheaper to make, and more long-lasting, than custom shapes - especially any with sharp corners. All the holes lined up perfectly with the components on the pcb....


The only thing was, we'd forgotten the hole for the mcu! The biggest, most prominent component on the board had nowhere to go. D'oh! A quick hack with a stanley blade and all was good (though pretty rough looking):


There is no hole for the ICSP header. We're not sure that this is necessary - after all, the chip will be programmed then this top layer added once the programmer has been removed. We'll be holding the programming header in place over the board - it's a temporary procedure and doesn't require any additional pins or anything soldering onto the board

Black fingernails can only mean one thing - we've been playing with ferric chloride again without wearing the latex safety gloves. Tut, tut.

Maybe we were just getting a bit impatient, but the board came out this time, less well etched than previously. Maybe it's just because we're using 0.3mm traces in places (whereas we prefer to stick to 0.5mm or above) that it seemed like a good idea to get the board out of the tank as quickly as possible! As a result, there were a few under-etched traces, that needed a good sharp knife taking to them


A bit rough-and-ready, but it least it now works. Some of the traces were also noticeably wobbly and bandly defined. Next time we'll definitely give it another minute or two, even if it looks to be completely etched!

With the chip soldered in place, it was time to test the board.
Nothing happened. We'd only gone and etched an older PCB layout, which we designed before we'd actually tested the programming of the chips on the breakout board. Double D'oh.

There is a degree of confusion amongst users online about which pins are actually used for programming the ATMega128. Usually the programmer is connected to the SPI MOSI and MISO lines (on most AVR chips). But on the ATMega128, the MOSO/MOSI lines on the programmer must be connected to the PDI/PDO pins on the chip (the SPI peripheral is on a different set of pins). However, the SCK (serial clock) and RESET pins are still used, as before. Unless you're using a programmer which supports PDI programming - in which case you need to use the PEN (program enable) pin instead.

Because of this confusion, we thought it best to actually test programming the chip before committing to a pcb design. And we did, and it worked, and everything was great. Then we went and etched a pcb which was designed for a PDI programmer, after successfully using ICSP to program the chip.


Bugger it an damnation. Our reset pin is sitting on the bottom row of pins, fourth from the left. Completely unconnected and not being used (the ATMega128 has a internal pull-up resistor on the reset pin, so it's not necessary to pull it high, externally). Pin1, the PEN pin is the top-most pin on the left hand side. We don't actually need this pin for ICSP programming.


A quick revision and we're ready to go again.
We've deliberately shortened the pin for pin1 (to stop it accidentally bridging the SCK line during soldering, as we're still making prototypes without solder resist) and flipped a few pins around on the ICSP header, to allow the reset pin to be brought up to the connections for the pogo pins.

For now we're going to physically snip pin1 off the pcb and tack a bit of wire from the reset pin to the ICSP header. That'll be a real test for the pogo pins, to see how uneven a board they can actually deal with. But, hopefully, with that done, we'll be able to squirt some code onto this chip, and then - rather gingerly - start adding some hall sensors to the rest of the board.

All being well, we're aiming for a full set of six board sections by the end of the weekend. Well, we can all dream!

No comments:

Post a Comment