Mini ATmega328 board (decomissioned)


Note: This project was never revised beyond these early steps, but is continued through its spiritual successor, MechEtroller.

11/10/12

With Metal Scooter sitting partially finished back on the West Coast, a new project has been overdue for a while now. So here it is:


Still covered in flux from soldering 


I've always found digital electronics and microcontrollers interesting, but without a lot of experience in anything beyond simple circuits, Basic Stamp 2s and Arduinos, I've always been afraid to try and dive into more complex stuff. So as a small step in an attempt to broaden my electronics knowledge, I've decided to start with trying to make a shameless Arduino knockoff. Actually, more of an Arduino nano knockoff, because to make things more interesting I wanted to incorporate the surface mount ATmega 328p chip. The mini board design was inspired by the many internet examples of shrunk down Arduino projects (like the really impressive one I used as a model here). This will be nowhere near as good as those, but it is super simple and much cheaper than buying commercially.

The board was laid out in Eagle first, primarily using parts of the useful SparkFun library. I referred to the 328 datasheet and other schematics posted online for most of it. It only has a reset switch, crystal, power LED, and important resistors and capacitors right now. This board is too small to have an USB FTDI converter, so instead it just directly takes an FTDI input cable through the boxed pins on the picture above. It also lacks a voltage regulator, as well as TX or RX line LEDs. I found the trace routing process tricky for a beginner with this little room, so I ultimately had to end up increasing the board size slightly, and rely on Eagle's auto-routing feature for parts. Here was the final product


After obsessively checking over the connections to make sure that everything was correct, I set an order to OSHPark for the price of $5.40 (for three!). All but one of the components were ordered from Sparkfun (because they didn't carry it). Fast forward a slow two and a half weeks later, and everything had arrived.

The board on the right has been fake-populated for reference

The boards looked awesome, so I started the soldering process as soon as possible. I'm fairly proficient at through hole soldering, but knew that SMD would be a different story. This was reinforced when I looked at the size of the mega:

On my pinkie finger
It didn't help that I hadn't picked up on the sizing designations for SMD parts until after the order was sent. Some of the pieces truly made the 328 seem easy. Luckily, the RPI embedded hardware club held an SMD soldering tutorial exactly when the parts arrived. I attended and was able to practice putting together an Arduino nano clone. Whereas that was using other people's soldering flux and leaded solder though, I had to assemble my board with lead-free and no flux (because I didn't buy any from Sparkfun like I should have). Soldering it together was tough with no magnification, but it seemed to get easier as I went, and by the end I had everything on.

For programming, I ripped off the pogo-pin board idea from a number of people on the internet, and used it to connect an ICSP programmer. The first time I plugged it it, the green power LED lit up. Excited by this minor success, I tried to burn an Arduino bootloader to the chip. This is where things started going wrong. Because of the simplified Reset button circuit, I needed to hold down the button to start the programming. Unfortunately, due to a schematic error that I later discovered, holding down the Reset button caused both the button and board to heat up alarmingly fast. It looks like I missed a resistor in the design, and in doing so created a direct short between the power and ground when the button is depressed.

Sketchy pogo-pin programmer setup
To try and fix this, I scratched out a tiny spot on the board to the point where the copper was visible. I cut the offending trace, and soon the component will get soldered in. Even though the board isn't working yet, I'm hopeful that it will only be one (or many) hacks away from functioning. Expectations were honestly pretty low that it would work the first time, but I have enough parts for at least one more board right now, and if the first works I'll definitely be ordering a version two. Either way, I'll update with more info when I get farther.

No comments:

Post a Comment