IMG_20141116_121934.jpg

Not too long ago I was fortunate to win a free PCB coupon from Dangerous Prototypes during one of their Tuesday give aways. I ordered the USB Infrared Toy PCB because I had almost started to design something similar using an AVR chip before discovering this device.

Preparation

Although the bill of materials is listed on the Dangerous Prototypes Wiki, it took me some time to order the parts I needed. Part of the problem was some confusion over the actual version of the board. The board has V3 printed on the silk screen. On the Dangerous Prototypes website there is a version 3 listed, but the design incorporates a 3.3V regulator for which my board does not have a spot. After some time examining schematics and comparing to the PCB I realized that my board was just a version 2 design with the layout adjusted to match the same form factor as the Bus Pirate.

I put together my own BOM spreadsheet to help keep track of what I ordered and had on hand. I had previously ordered a SMD resistor and SMD capacitor kit off of eBay and had many part values available. There was only a couple resistor values I did not have, but due to my earlier confusion I ordered the wrong one for R4. The two important resistors, R4 and R5 control the current going into the IR LED. Using a modification of the spreadsheet linked from the Infrared transmitter section of the design notes I was able to come up with a value of 5.6 ohm for R4 and 3K ohm for R5. This will put 125 mA through the IR LED, but this should not be a problem unless the IR LED is constantly active.

The Kobikon USB Mini connector referenced from the Dangerous Prototypes Parts List is obsolete. However, I found a similar enough part, a Molex 67503-1020. Its feet do not quite land perfectly on the solder pads, but it does make contact with data and power pins in the correct locations.

Assembly

I have not done that much SMD assembly previously despite having built my own reflow oven. Putting this board together was a chance to gain some more experience. If it's true that we learn mostly through our mistakes, then I learned a great deal. However, my preparation allowed me to put the board together without needing to correct for many things.

I started off by gathering all of the parts and checking them off my BOM as I put them into an anti static bag to bring them to the garage where I do my assembly. I also wrote notes on the BOM paper for the directional components to keep me from having to think too much during assembly. I went so far as to draw out how the components should be placed to try and make it fool proof. When I started my assembly, I organized all the parts in the order they are on the BOM to make them easy to find when needed. I also used some acrylic board holder jigs and masking tape to secure the board.

I used solder paste from a syringe that I keep chilled in a little Peltier cooler to keep it from drying out. I noticed the paste was not sticking to pads easily so I waited a bit for it to warm up. Things got better after waiting about 30 minutes, but I still found the paste stubbornly refusing to stay where I put it. Due to this I put down more paste than I wanted for many of the smaller components. The diodes D2 and D3 have such tiny pads that I had to use a spare syringe needle to cut off the paste coming out of the tube since there was not much of anything for it to grab onto. I found that I could also use the extra needle to clean excess off the board in places, with the downside of scraping the solder mask slightly if not careful.

I found that the components liked to stick to the side of the tweezers, probably due to electrostatic attraction. So, dropping them on top of the paste did not work out at first. But I found coming down with the tweezers and touching the board slightly helped. Somehow I was able to drop the PIC microcontroller chip perfectly on the first try. Which is a good thing, because I did not want to redo the paste there.

After visually inspecting the board under a magnifying glass and correcting some minor issues I was ready to pop the board into the oven. Knowing Murphy's Law I was very careful about taking the board out of the jig and placing it onto the tray for the oven. I imagined my clumsy hands knocking things out of place and that was enough to slow me down. As I eagerly watched the board during the reflow process I noticed something moving around. There were some air bubbles in the paste that came out during the soak period and moved around some of the components. Luckily, they sat themselves back down, mostly in the right place. When I took the board out of the oven I did another inspection. I noticed that two of the capacitors were touching each other at one end. Lucky for me, after consulting the schematic, they touch on a side that goes to ground for each. The extra paste had left some specks on the solder mask that truly made this a dirty PCB.

Programming

IMG_20141116_220945.jpg

Putting this device together myself means I needed to send the bootloader to the PIC 18F2550 myself. The only problem was that I did not have my own PIC programmer at the time. However, I did borrow an old Matrix Multimedia HP-488 development board from a friend. It was in his junk box and has seen better days. I was not sure if it would work when I saw it being pulled from beneath other boards. It seems to be the earliest revision of the board and has the date 2005 written in the silk screen.

The first thing I tried was to see if it would work with MPLAB. It did not. Under Linux, I noticed that instead of a proper manufacturer or device name listed, when it was detected, it had some non numeric characters as its name. I decided to jump over to Windows and try my luck there. Matrix Technology Solutions as the company that made the HP-488 now calls itself did have a driver available for the board. However the driver has not been updated for some time and is not signed, which Windows 8 does not like. I had to go through the ordeal of rebooting Windows in the special mode that lets you install untrusted drivers. All the while, Windows is updating things and slowing my life down. When I did get the driver installed the board appeared to be recognized.

The HP-488 documentation talked about a program called PPPv3 that could be used to upload HEX files. I found an old copy but it would not work with the PIC that had been left in the socket on the board. Additionally, it had no clue about newer chips like the 18F2550. Eventually, I downloaded FlowCode from Matrix TSL's website. I played around with it and discovered that it calls a program called mLoader to upload images to the chips. Running mLoader without any options launched a GUI. So I had finally figured out which program to use.

I used jumper wires to connect the appropriate pins on a socket to the programming header on the IR toy. When I used mLoader to try and send the boot loader HEX file I got an error about about there not being enough voltage on the board. I am a PIC newbie but I remembered reading that some chips need 14v on the MCLR/Vpp pin to enable programming and the 18F2550 is one of them. I also realized why the HP-488 documentation kept talking about it being best to use an external power supply. The development board itself has no way to supply the necessary 14V unless it is being handed to it already. Thinking that the board might be able to handle some voltage greater than that and regulate it down to 14 V I tried a 24 V wall wart I found. However, this popped a electrolytic capacitor and broke the wall wart. I got the board working again after replacing the capacitor.

I don't have a variable bench power supply yet, just an ATX bench power supply that only gives me 12 V. So I built a 15 V supply using an old laptop power supply providing 20 V input to a LM317. I idiotically had the positive and negative terminals swapped for awhile leading to much head scratching and another busted capacitor. I finally figured it out after some bouts of angst.

Finally, I was ready to get the damn bootloader on the chip. I came back in the house, plugged in my new 15 V supply and was happy to not hear anything pop or go up in smoke. I rewired the socket to the IR toy and hit send. The boot loader uploaded successfully except for a warning message about not being able to verify the flash. After jumpering PGC and PGD on the IR toy and plugging it in via USB I was happy to see the LED light up and hear Windows detect the device, meaning the boot loader was working.

My time in Windows was thankfully over and I was able to reboot back into Linux. I then uploaded the latest firmware and then did the self test. I saw V222 returned and was happy I had a working device. Now I just need to figure out what I want to do with it!