I have all the parts for my small run of ArduNet boards in except for one. Apparently, I ordered the .1uF decoupling caps in the 0201 size instead of the 0603 size I wanted. I’m not sure how I did that? But it was certainly my error, not Digi-key’s. I have nothing but good things to say about Digi-key. It’s easy to order parts, they pack that order FAST, and the parts ship right to your door. Even with the mickey mouse quantities of parts I order, they have a service department that looks out for you. Case in point, I have a wonky address. It’s on a Rural Route (I’m strategically located deep in the Missouri Ozarks, everywhere around here is a Rural Route.) If you don’t know how Rural Routes work, I’ll tell you. It’s not like a normal address… the format is “RRx BOX y” and then “City State Zip” on the next line. “x” is the number of the route and y is the box number on that route. Rural Routes cross highway and road numbers, You can have a “Rural Route 1″ that covers… say… Highway 10, County Road 2, and County Road 3. The delivery driver just has to know what the actual mapping is.
Anyway, here’s the issue. The Postal service has a standard format they want people to follow. In the case of the Rural Route, it’s “RRx BOX y” with nothing after the box number. You can have a letter immediately after the box number, like “RR1 Box 100a” But not arbitrary text like “RR1 Box 100 Jill’s house” Here’s the problem. There was already no space between the numbers when my address was established a decade or so ago (Not by me, the property was split into 2 and a second address created.) Instead of just adding “a” to the existing number, the mail carrier added a 1/2 to the number, so it’s “Box 100 1/2″. Whoops. That looks like “extra crap” after the box number to the scanning system, and it’s balked at. I have no end of problems with this. Web sites try to “fix” my address for me, or give me limited shipping options. I hate that. So… to make a long story only slightly shorter, Digi-key has a nice web site, it suggests the “proper” address, but allowed me to easily use what I typed instead with no shipping restrictions. One of their service reps even called me to verify that I received my order and to make sure they had my address right. Nice!
Sorry about the rant! I just had to get that off my chest.
So! I have enough of the missing part to make a couple of boards, which works because I need to make one by hand first (without using the stencil) to verify the design and board layout. I need to do it without the stencil because I want to build the board in stages, first the power supplies, then the CPU, finally the UART chips. Testing the installed parts at each stage. I also upped the ante by using lead free solder.
Wow. lead free solder does NOT want to melt. I had to really boost the heat, and even then it was clear that flow isn’t nearly as fast as leaded solder, and it hardens a lot faster. MUCH harder to work with. But I need to develop the skills, so I used it.
The solder I’m using is from Sparkfun, Solder – 1/4lb Spool (0.020″) Special Blend It’s good stuff, I like it for the small diameter (.020) and the water soluble core. Used in conjunction with the flux pen, Liquid Flux Pen – Water Soluble you have an easy to clean board when you’re done. I also use a pair of tweezers to maneuver the parts, I got it at Sparkfun too: Tweezers – Curved but I only have one pair, I often feel I need another tool to manipulate the small SMD parts, so I think I’ll order some more of them. These tweezers have tiny, tiny tips and are quite precise. The times a second pair would come in handy is when you have to flip a part over, hold a part down because flux got on the tweezers and the part is sticking to it, or when you have to rotate a part to get it to fit better on the footprint. Which… is pretty much all the time, really.
Most of my discreet parts are 0603 size. The best way I’ve found to do those is to position the board such that the part is sideways before me, then flux the left most pad (My soldering iron is on the left side, as I’m left handed.) Then I add a tiny bit of solder the the pad I just tinned and reflux both that pad and the other. then I position the part with the tweezers, and while holding it down, reflow the solder with the soldering iron, allowing the part to settle onto the pad. Spin the board around so that the other pad is on the left, and solder the other pad with the soldering iron and solder. The part will be held by the first connection and won’t move or tombstone.
Once the 0603 parts are on, I solder on the larger caps and voltage regulators.
At that point I broke out the Reflow Skillet, which is just a rectangular electric skillet I got from Target. You want to pick one that goes as hot as possible, mine goes up to 420 degrees Fahrenheit. That seems to be enough. Sparkfun has a lot of tutorials on SMD soldering and one on using the Reflow Skillet… read them. They’re good stuff. Heating the board up in the Reflow Skillet at this point allows the solder to melt and allow the parts to ‘pop’ into alignment with the pads through the surface cohesion of the molten solder, it’s really nice to see the parts all line up! They were looking pretty scary after I soldered them!
So now I have the discreet components and the regulators on, but no other ICs. I soldered the power connector on and applied power to the board. Good! The regulators work, but the power LED (LED1) does not light up. There’s 5 volts across it, indicating it’s installed backwards. Oops. Checking the other LEDs by jumpering 3.3v to the LED’s current limiting resistor reveals that the green ones are fine, but all the red ones are all backwards. I’m glad I built only one board! I had to replace all 3 red LEDs with new ones, installed the right way, now they all work.
Next step! Install the CPU and it’s support connectors and load the bootloader. I switch to the hot air rework station for this. It’s possible to solder an ATmega chip with a soldering iron, but I’ll never be able to connect the upcoming UART chips that way. Your skills may be better than mine, I have to use the hot air. Anyway, the ATmega goes on, along with the 6 pin ISP connector and the 6 pin FTDI connector.
The next step is to load the bootloader. In theory? You can use the Arduino IDE for this. I, however, have NEVER gotten this to work. It refuses to use the Atmel ARVISP mkII due to driver incompatibility, and I’ve never gotten the “Arduino as ISP” method to work. I have no idea why, I have tried and tried. So I use Atmel’s AVR Studio to load bootloaders. I downloaded AVR Studio 5 (Geeze! Did Microsoft pay Atmel to bloat up the thing with Microsoft products? It’s HUGE!) All I want to use is the AVR programming tool, it’s under the Tools : AVR Programming menu. Specify your programmer (I use the AVRISP mkII) and you’re in.
This is, in my opinion, the easiest way to verify the chip works and get a bootloader onto it. Once you have AVR Studio 5 installed (You will likely have to upgrade the firmware in the AVRISP mkII) connect the Arduino to power, connect the ISP connector and go to Tools:AVR Programming.
Select the Tool, Device, and Interface on the upper left of the dialog. For this board, it’s “AVRISP mkII”, “ATmega328P”, and “ISP” respectively.
To verify that the chip even works, click the “Read” button under “Device ID”. The ID number of the device should appear. Click the “Read” button under “Target Voltage” and it should show you the exact voltage the ATmega is running under. If you can’t even get this far… there’s something seriously wrong with the part or the board.
There are 3 sections that need to be programmed for the bootloader to work, the bootloader itself, which is programmed in the “Memories” section, the Fuses, which are programmed in the “Fuses” section, and tje Lock bits, which are programmed in the “Lock bits” section. The “Fuses” section is where you can really mess yourself up… there is one fuse, SPIEN (SPI Enable) that enables the SPI part of the chip. It’s default is SET, but there is nothing stopping you from unsetting it and programming the chip that way… of course, the SPI is what is programming the chip, so if you disable it you prevent yourself from loading a bootloader onto it. Oops! Be careful. If you do that, you render the chip unusable. (Well, you can use “High Voltage Programming” to recover it, but that’s a bit hard to do with an SMD part.)
Program the Fuses first. Select “Fuses” and enter 0xFD, 0xDA, and 0xFF into the Extended, High, and Low registers respectively. That should set the following Fuses:
BODLEVEL 2V7, SPIEN checked, BOOTSZ 1024W_3C00, BOOTRST checked, and SUT_CKSEL EXTXOSC_8MHZ_XX_16KCK_14CK_65MS. All the rest of the fuses are unchecked.
Program the fuses with the “Program” button and reread the Device Id. The chip should still work. If it doesn’t, you’ve either bricked it by resetting SPIEN or have a bad oscillator.
Next, the bootloader itself. Under “Memories” you need the following file to be loaded under the “Flash” entry:
Where the file is will depend on where you put it when you installed the Arduino IDE. Use the “…” button to brouse around and find it. Press “Program” to program the bootloader.
Finally, the Lock bits to protect the bootloader from accidental erasure. Go to “Lock bits” and enter “0xCF” in the LOCKBIT register. That will set BLB1 to LPM_SPM_DISABLE, and NO_LOCK in the other two fields. Click “Program”. You’re done!
You can now run the Arduino IDE and program the board using a USB to FTDI adapter. Here is where I ran into a problem. I had added c16, a .1uF cap to the reset line as per an Atmel Application Note to provide ESD protection on the reset line, but that’s not compatible with the auto-reset feature of the FTDI interface. I had to remove c16 from the board.
The next step was to solder the UART chips and their connectors onto the board and test them using the ArduNet self diagnostic. (If you connect an ArduNet cable between the two UARTS, it will verify each UART against the other.) Success! Both UARTS work. All that practice I got soldering and desoldering UART chips on the first prototypes paid off!
Finally, I soldered all the remaining headers onto the board.
All that remains is to clean the board. That’s easy! All the flux is water soluble, so all I need is a hot water bath. Filling the Reflow Skillet with water and turning it on to low works great for that. With the water just below boiling, and holding the board with a pair of needle nose pliers at one of the mounting holes, a toothbrush makes fast work of the flux remaining on the board.
Here’s a picture of the hand soldered board. It came out great!
There is one fairly big problem with the board, and I can’t believe I didn’t see this coming… the UART and power connectors reach all the way up to the Shield board, making it problematic to have through hole parts on that section of the Shield. Oops! I’ll just have to deal with that.