Lot’s of More Goodness

Wow!  What an exciting couple of weeks.  Sure, most folks wont care about all the fantastic things I’m about to reveal, but at least I can count on Mom to read what I write, smile, and nod.

The first thing I want to share is a pencil box that I modified to hold some of my projects.  I made holes in the side for plugging in the cables.  Now, projects can sit on my desk safely without fear of being molested by the cats when I’m not looking.  The MT128 board is attached using plastic concrete anchors from the hardware instead of “real” standoffs.  The other three boards are attached with double stick tape.  You’ll notice that the board in the upper right hand corner is one of my home-brew AT90USB162 boards, being used as a UART bridge.

By the way, yes, I know that putting my boards in a plastic box is like running around in a thunderstorm holding up a lightning rod…especially in the winter.  I’m considering some strategies for ESD dissipation, so if you have good advice, I’m listening!

DSCN7245

DSCN7246

Speaking of AT90, I was also able to use an AT90 to program another board via ICSP, thanks to the code available from AVRopendous.  Their circuit boards are reasonably priced too, and you might consider purchasing one.  They are about $20.

That code is made possible by a fellow who is on my short list of AVR heroes.  In fact, that list consists only of Smiley from Smiley Micros and Dean Camera from the MyUSB project.

Aside from being absurdly nice, Dean is also frighteningly smart.  His new library includes a dual CDC demo.  Now, think about that…a $4 AT90USB162 chip that can simultaneously act as a programmer and a UART-USB bridge via two COM ports.  It’s a near perfect solution.  Unfortunately, I’ve been able to enumerate two ports…but haven’t gotten them to really do much of anything.  All in good time, though.

In other news, the receiver for my Futaba 6ex came in over the weekend!  Now, to see if it will interfere with the XBee modules.  Following that, I’ll be using the receiver along with the mega 2560 board I’m working on.

The Results Are In!

This evening, as soon as Evelyn was supposed to go to bed, I snuck off to the basement.  The 2560 circuit board has a lot of holes in it, so I cheated and drilled out only the holes I would need to get the board to power up for me.  There were seven vias and ten holes for the programming header.  There were also, of course, 100 very tiny pins to solder.DSCN7224

As soon as I finished soldering everything together, I raced upstairs to plug the board into my computer.  As these things go, instant success is rare, so I wasn’t surprised when the programmer failed to detect the board.  After rooting around with a multimeter, I found the problem.  This is a problem I noticed the last time I printed the board, but somehow I failed to remedy it.  The reset pin was not connected to the programming header.

A friend called this afternoon to chastise me for not simply shipping the design off to a board house to have a professional board made.  You will notice my temporary “reset” wire, connected to the programmer.  This would also be the reason I have not shipped the board out to manufacturer yet.  Once I finished the design I’ll have several professional boards printed.

image

It took three tries to get this board printed properly.  It took two tries to populate the board with the bare minimum number of components.  Two times I had to improvise a reset wire.  Finally, after working on this thing for two months, I was ready to plug it in and see if it would run for me.

After carefully attaching the board to the programmer, I gingerly plugged in the programmer’s USB cable.  My computer made the “USB Device Connected” noise, so I opened up the AVR Studio programming application.  I gingerly pressed “read signature” and waited for the failure notice to pop up.

image 

Instead, I got…a valid signature!  I almost cried.

Redemption

When we last left our hero (yeah, that’s me), he was about to try his luck with a second two layer board after his initial failure…

I did.  And I failed.  Again.  The board still didn’t etch cleanly the second time around, but it was better.  In fact, it was “good enough”.  Using a very tiny screwdriver, I separated the many traces that did not etch properly.  That time consuming process was followed by a very careful testing process, so that I would know precisely how poorly the etching job was.  Finally, after lowering my expectations to simply being able to “talk” to the chip, I attached it to the board.

This is a $17 chip, and etching a double sided, high density board is a pain in the rear.  You might imagine what I was saying to myself as I soldered the chip onto the board.  It was something to the effect of “Don’t screw up.  Don’t screw up.  Check your alignment.  Check your orientation.”

The programmer couldn’t talk to the chip.  Nothing.  Nada.  I busted out the eye loupe and checked my solder job.  Solid.  The failure seemed so peculiar, but I kept checking things with my multimeter.  Finally I realized the problem.  The chip was oriented 90 degrees the wrong direction.  You can imagine my choice language.  Unfortunately, the desoldering process toasted the board.  Those tiny traces don’t do well with multiple heat cycles.

School started up so my time has been short.  Also, I won’t lie, I haven’t been eager to get back to failing again!  This last two weeks have been really stressful, and I needed to get in touch with doing something I really love doing…like making boards.

Before starting, I got a pair of cotton gloves.  My developer solution was looking a bit dark, so I changed it out for fresh solution.  I decided to use my smaller piece of glass for exposing the board, so the glass wouldn’t flex as much.  If the mask isn’t absolutely flat, it may produce blurry results.  Finally, I printed the mask out on our inkjet printer…using the “heavy” ink setting.  I love that printer.  The ink took a long time to dry (I gave it two hours after smearing the first mask).  When I handled the exposure glass and the masks, I used the gloves.  Finally, after drilling the registration holes, I exposed the bottom side first because it’s lower density.  Any light leaking around the bottom when I exposed the top would be less likely to damage the exposure.  When I got ready to expose the board, I turned off even more lights than usual.

Usually, this degree of caution is superfluous…but this little board is so tiny that every bit counts.  That was the case this time, too.  The initial results looked good, and I bragged to Aimee that it was perfect.  After getting a good look at the board through an eye loupe…I had to agree with myself.  It was perfect!

DSCN7223

Double The Fun!

Over the Labor Day weekend, I could not bear to leave my computer at home.  While my wife read in the evenings, I worked out the design for my newest circuit board.  This board will incorporate an Atmega 2560, TQFP 100.  That’s 100 pins at 1/2 mm spacing.  Good stuff.

Now, I’ve done a TQFP 144 board…but it was just a breakout board.  This board actually has to do something.  That’s a bit more challenging.  Getting the whole shebang to work on one layer may have been possible, but not very practical.  I have big plans for this board! (Insert maniacal laughter)  These big plans necessitated a two layer board.  My first, as it turns out.

Although I have never created a two layer board, I have rehearsed the process in my mind many, many times.  The big problem is getting the registration right between the two sides.  My technique was pretty darn good.  I would glue a paper printout of the circuit to the outside of board and drill holes through the board before removing the plastic sheeting and exposing it.

Thus proceeding, I used a center punch to mark four holes and used my drill to drill them through.  Having rehearsed quite a bit, I drilled the top layer first because it is a much finer pitch.  Better to have burrs stuck to the less sensitive bottom layer.  A small problem arose when I laid the mask on the board.  The mask is mirrored so the toner can be as close as possible to the board.  The paper was also mirrored, but was glued on toner side up.  I had to flip the board and put the mask on the “burred” side.DSCN7050

When I printed the masks I printed both mirrored.  As it turns out, the bottom should not have been mirrored.  Lesson number two learned.  After exposing the top, I exposed the bottom and developed the board.  Registration was nearly perfect!  Unfortunately, I’ve been using a laser printer for my AT90USB board masks…those are 1mm spacing, not 1/2.  The 600 DPI laser was not up to the task, and my first two layer board was useless.

DSCN7048

This was frustrating for a lot of reasons.  The biggest being that I only had two two layer boards on hand.  My “play” account this pay period is already spoken for, and just the chip to put on the board is $17.  A funk permeated my afternoon.

There were a lot of questions.  Was it the laser printer?  Did I under-expose the board (I use a timer set to 11 minutes, so this wasn’t likely)?  It has been a while since I have had a failure exposing and developing a board, so I didn’t take this well.

Later in the evening, I printed another mask.  Instead of using the laser printer, I used my wife’s inkjet at 1200 DPI.  The mask was almost perfect.  Razor sharp.  At the same time I also printed a non-mirrored piece of paper for the top layer.  The same process was followed as I used on the earlier board.

After exposing both sides, the exposed board looks promising.

The Peeper

Tonight I decided to put XBee to the test.  By the time we got Evelyn in bed, it was already pretty late.  My new RC transmitter also came in today, and I had to show it my neighbor.  After we discussed our various toys and projects, it was dark out.

I recently procured an ultra light laptop for my wife, and this seemed like a good inaugural use for it.  After installing the XBee tools on it, and setting up another laptop on the front porch, I wandered down the street.

My first trip was short.  Only to the end of the block.  After changing the default transmit\receive channel and turning the manners down (basically, I told the transmitter to transmit even if the channel did not appear to be clear) it was time for another trip down the block.

So, on I walked.  When I got to the first stopping place, my signal was still great.  Half a block later, the signal was still quite strong…but it faded rapidly.  At the end of two blocks, I had just about maximized the range of the modules.  Not bad, though.  With some more tweaking, and a real “line of sight” situation, the modules could probably make about 3/4 of a mile.  I could also turn down the baudrate and see what happens (I was testing at 9600bps).  Perhaps a high gain antenna would also help.

I turned to head home and noticed that my neighbors were peering out at me from their windows.  Then, of course, they saw me looking in their windows at them.  Wandering about after dark, holding a laptop like a serving tray.  I’m sure that I appeared to define “weird”.  For a brief moment I considered explaining to them that I was testing RF modules for use in a future robot…but then I realized that my explanation might only serve to verify their worst fears!

DSCN7033_edited-1

I ♥ XBee

This evening, having just gotten my hands on another USB to TTL\serial adapter, there was but one logical thing to do…revisit my XBee experiments.

My initial trial with XBee was mixed.  I got the devices working, but they were incredibly unreliable from only a few inches away.  That was shockingly short of the expected one mile range.

This time I decided that measuring transmission distance in inches simply wouldn’t do, upped the ante.  The following photograph shows the extreme communication distance that I attempted from my secret laboratory.  Please note that the modules are separated by feet!

DSCN7030

Sadly, my results were the same.  That’s unfortunate, because I had blamed poor board design on my part for the failure.  Not so.  Transmission was slow, and characters dropped for no apparent reason.  The setup would be unusable for true data communications.

Reflecting upon my previous experience with the incredibly power hungry XBee Pro boards, I realized that the 9V battery attached to one of them might be part of the problem.  While the voltage was high, current certainly was not.  After retrieving a cage and four AA batteries from my other secret laboratory, I tried again.

Presto!  The setup worked beautifully.  Not a single dropped character, no delays nor pauses.  While I have now had two problems due to the power consumption of the XBee Pro modules, I have still not looked up how much power they consume.  Instead I’m going to continue speculating.DSCN7029

My near term goal is to use an XBee module on a remote controlled airplane.  It will transmit data from the aircraft to the ground…I hope*.  Given my recent experience with the XBee’s ravenous appetite for power, it may be necessary to build an airplane large enough to carry a car battery.

*I recently purchased the radio for my airplane, and it also operates in the 2.4 Ghz range.  It’s a Futaba FASST system, so perhaps I’ll be saved by the frequency hopping.  It is altogether possible that I will not be able to run the two devices on the same aircraft.

Via Madness

One of the things I discovered while working with the XBee boards is that I need another reliable USB-TTL serial adapter.  Since the most recent incarnation of my USB board seems “Ok”, I decided to print another one and use the chip that I rescued when I wrote about the Chip Quik.

When I finished the board, it looked really good.  Almost perfect.  It had nice traces with very little stippling due to over-exposure.  I drilled the board, populated it, and plugged it in.

My computer complained about an “unrecognizable USB device”.  Great.  I checked the traces and found one short, which I fixed.  Still nothing.  I swapped out the passive components on the board.  Still no deals.  Next, I tried a different crystal (a through hole instead of surface mount).  Finally, I pulled the chip again and replaced it with a brand new one.

It still didn’t work.  My pretty board was now a mess.  image

This was particularly crushing to me for a number of reasons.  First, I’ve had great success with these boards.  The pins are relatively large, the boards are simple, and there aren’t a lot of pins.  I have also started working on a board which will house a 100 pin TQFP chip, which added to my anxiety.  If I couldn’t make this board work, I had no chance with the next one.

The only thing I had not replaced was the USB connect.  I plugged a cable in and checked connectivity between the pins on the cable, and the pins on the chip.  One of them failed.  I put down my Sherlock Holmes pipe and grabbed my eye lupe.  When I assembled the board, the epoxy on one of the vias gave in and popped away from the board.  Held in place by the wire, it only moved a few millimeters.  After fixing it, the board immediately be gan behaving properly.DSCN7025_edited-1 copy

The lesson?  I should have tested more thoroughly before moving components around.  My gut told me that the board was the problem, but I ignored it.  The second lesson?  Glue down wire vias.

Chip Quik

Ever tried desoldering an SMD?  Did it work?  I tried once.  The heatgun that I used melted many of the plastic parts on the board, but I did get the chip replaced.  It was dangerous, and I wouldn’t make a habit of such operations.  After working with my USB boards, I recently decided to try using some ChipQuik to pull the chip from a failed board.

DSCN7009_edited-1

ChipQuik is wild stuff.  It comes with flux and some alloy.  You use it by melting the alloy onto the pins.  When it mixes with the solder, it lowers the melting point of the solder-making it possible to heat all the pins and remove the chip without damaging the board.  This stuff could have saved me $100 recently, when I destroyed a stepper driver board trying to replace a chip.

When I tried the ChipQuik on my own 32 pin chip, I expected mediocre results.  In fact, it was really surprising how well the stuff worked.  After I removed the chip, it took only a few seconds with solder wick to clean the pins.  None of the pins were damaged, and the chip is ready to be installed in another failed attempt at board design.

XBee Observations

Now that I seemed to have squared away some nagging problems with my USB development board, I was ready for a new and exciting challenge: wireless communication.  In case you have never heard of XBee, you really should hop over to www.digi.com and do some reading.

After not nearly enough research, I decided to purchase a pair of XBee DSCN7011_edited-1pro modules.  These little buggers are quite small, so they don’t use standard headers.  This turned out to be a blessing in disguise because they also expect 3.3v for power, and communication.  The board I wanted to use to talk to the XBee module was powered by USB at 5V.  I knew that something would have to be done about the mismatch in voltage, so I did some digging about.

A company called SelmaWare created the perfect board for interfacing with an DSCN7015_edited-1XBee, at a reasonable price.  The AppBee-Sip cost me about $12 for two bare boards, shipped.  The parts required to populate the boards cost almost nothing from DigiKey.  After getting my modules and soldering the parts to the board, I powered one up and tried to talk to it.

Nothing.  Nada.  Not even flashing lights.  After re-examining the boards, I realized that I had soldered the LEDs in backwards.  Sure, I could have checked the schematic…but why, when I could simply guess wildly?

After fixing the LEDS, I tried again.  The lights blinked when I typed.  I tried the escape code “+++” and got ABSOLUTELY NO RESPONSE!  By now I was pretty irate.  I took the parts with me on vacation (different people unwind differently, ok?), and took another look at them.  After some consideration, I tried forcing my USB board to 9600 BPS.  Nothing.  Finally I realized that the Pro version of the module is pretty power hungry.  Toss in the level shifter, LEDS, and regulator…it might simply be that USB wasn’t providing enough power.

I tried a battery pack.  Still no response, so I tried my other USB\TTL USART board.  Voila!  It worked!  As it turned out, one of my TTL\USB boards is not able to receive data, and I needed to use an external battery.  The very next night I had the two boards alive and talking to each other wirelessly.

It might be interesting to build myself an AT90USB board at 3.3v, and then plug the XBee board right in without the extra hoolabalu.  It might work out, but I’ll need to review the spec sheets first.  In the meantime, I’m pretty impressed with how well these modules worked.  Next I’ll try testing their range and see how close I can get to that “1 mile” range.

AT90USB Redeux

In June I wrote about some problems I ran into with a USB dev board.  The board seemed unusually sensitive.  When I would get my finger near a button, it would trigger.  Although it isn’t thoroughly tested, the board below is my newest AT90USB development board.  It features a surface mount crystal (my first), and the ground outline around the board.  I also included pads for decoupling capacitors on the two buttons.

While I have not had time to completely test the board, it already seems to be less "twitchy".  While I would love to attribute this to my grounding changes, that probably isn’t the case.  A friend informs me that RF coming from the processor probably is not terribly concerned with my silly ground.  At the same time, I did shorten some leads…and the longer, more problematic leads are right next to the grounded zone.

You might be asking a really good question right now.  Why not just use a bone fide ground plane?  This is a single layer board.  While it does not have many features, it does quite well with only one layer.  If (or when) I introduce another layer, it will also be a signal layer.  As a result, I am using this opportunity to experiment with various RF management strategies.

DSCN7017_edited-1