I am continuing with the schematic and board layout for my new controller board. If you are interested, click here to read part 3.
As you might have read last time, I was able to get a hold of the proper parts for the 68HC912D60 board. Since the last article, I have some interesting things to discuss regarding Motorola.
The biggest news for us: Motorola has finally setup Digikey as a distributor for their semiconductor products. This is really great news for us, as we will now have a reliable and small order friendly outlet to get our favorite Motorola parts. I am hopeful that the new Digikey catalog will be flush with new parts!
I had a very productive conversation with the Motorola Vice President of SPS sales. She and I spoke on the phone for nearly a half hour. She had contacted me after reading Part 2 of this series on designing a new controller board. Apparently, I said some things that hit a nail somewhere. After speaking to her for a half hour, I am quite hopeful that at least one executive at Motorola understands the importance of helping hobbyists and students learn about engineering. She also has a firm grasp on the idea that investing time into helping us smaller guys will pay bigger dividends in the long run. If more people know about Motorola parts, then they are likely to use them in future projects. I spent a great deal of time stressing how we like the parts they are designing, but the supply issues are really killing interest. She has some ideas on fixing this. Having Digikey is a great first step. I asked for the ability to place small orders directly with Motorola, and also asked for help getting samples directly from the company.
I will check back in a month or so to see if anything comes of this!
We are getting closer to having the HC912D60A, which has 5 volt flash. If you recall, the current 912D60, with its 12 volt flash programming voltage, is going away and being replaced with a new design. I should be getting samples of the new parts in a week or so. Hopefully, these will be out in October or sooner.
It has been a little while since my last article. I have been busy! I have both a schematic layout and a board design to share with you this time. I even have the first two prototypes done.
The board design was done using Eagle, which is a PCB software that I have been using recently. Eagle was also used to generate the drawings for this article. Using Eagle for this task has worked out well, though it did require a fair amount of hard experience on my part to make everything work out correctly.
The following discusses some of what I considered to be highlights and things of interest in the board design.
Click for larger view
The first thing I had to do in creating the schematic was to create a few custom parts that don't exist in the standard libraries of Eagle. One part, for example, is the 68HC912D60. I was able to reuse the footprint of the 68HC812A4 which is in the libraries, but I had to create my own symbol for it.
When creating your own parts in Eagle, I highly recommend creating your own library file for your custom parts. While this is kind of a pain, it will work out better in the long run because modifying the existing libraries creates upgrade problems in the future. Your changes will be overwritten by any new libraries that Cadsoft produces.
I would like to take a few paragraphs to point out some of the high points about the D60 design, and also things I did to create the board in the way that I wanted.
One of the first things I found different about this part is a new layout for the crystal design. Most crystal designs are the same: A crystal, two caps, and a resistor. On the D60, the suggested crystal design is different, and one that you should take note of.
As you can see by this schematic snippet, the crystal design layout is a little different. It still has the 22pF caps, but there is no resistor, and the wiring is a little different. Note that the Vss (or GND) symbol in Eagle is a little different.
You also might note that the D60 uses an 8mhz crystal. This is a change from the 16mhz used by the other HC12 parts. You can increase the clock speed back to a 16mhz equivalent by using the onboard PLL circuit. I won't go into that here, but it is a possibility.
One of the custom parts I created is a cut jumper. A cut jumper is an element on your board that enables or disables some feature, or allows for modification of the wiring on the board. I used the cut jumper in several places on this board to allow you to modify the operation of the board if desired, while keeping a useful default if you wanted it.
The first step was the creation of a symbol. The above snippet shows you the cut jumper symbols in action on the board. They have two pins, and the normal state is for the two pins to be connected.
The next step is the creation of a package. The package is the layout of what appears on the physical board. I wanted a couple of features on my cut jumpers. First, if you cut the jumper, I wanted a small pad that you could solder to. Second, I didn't want to have through holes. This allows me to place the cut jumpers on the bottom of the board without worry about running into components on the top. Third is that I didn't want to have the solder mask covering the element to cut.
I implemented my cut jumpers by using surface mount pads. I selected pads because they have a solder mask defined, which made it quite easy to implement. I started by copying a '1206' surface mount package. This is a standard size package that you will find used on capacitors. It is the package on the left in the above pictures. I stripped off the capacitor specific elements, and added a third pad across the other two, creating a 'short'. You can see the cut jumper as the package on the right. The final product looks like:
As you can see, using the 1206 package allows me to pack in several cut jumpers into a small area. Notice how the solder mask is missing from the jumper. The solder mask, in case you were wondering, is the green coating on the board. You can see that it covers the traces, which appear black, but anything that is through hole or a solderable part is left exposed. Take a look at JP4. If you were to cut the jumper by putting a cut into the center pad, you would be left with two unconnected pads. To these, you should easily be able to solder a 30 gauge 'wire wrap' wire, and create a jumper to anywhere else on the board.
The above photo is of another SMD pad. It shows the metal which has been reflowed in solder. You can also see where the solder mask has been applied, and where it has outlined each of the pads.
Your next question: Why use these cut jumpers? Here is an example. On the back of the D60 board, I have included a serial EEPROM which is connected to the SPI bus. By default, this is the sole entity on the SPI bus, so it is wired to the SS (Slave Select) line.
The SS line is connected to the CS\ line on the serial EEPROM, and is connected through JP7. If I decide at a later time I wish to use the SS line for something else, I can cut JP7, and wire the CS\ line to another pin using a jumper wire. The serial EEPROM's have two other control lines, the WP\ and HOLD\ lines, that I have wired up in a 'default' mode. However, if you wish, you can cut these jumpers and wire them up so they are controlled by software instead.
In summary for this section, cut jumpers allow you to put optional functionality on your board with a default setting. Its a great way to add the ability to customize your board by the end user.
I put connectors on for each of the major ports on the part. Each port has 8 lines, plus a Vdd and a Vss (a.k.a. +5v and GND). Pin 1 is always Vss, and pin 2 is always Vdd. I used a 2x5 header connector for each. Below, you can see a snippet of the schematic layout for each of the ports. You can also see the bypass capacitor that I added to most of the connectors. On the right, you can see the physical implementation. Notice that I used surface mount capacitors on this board. It saved space and holes in the board.
There were, however, a couple of ports I decided not to put explicit connectors on for. PORTE, for example, has mostly special purpose pins, such as the MODA/MODB, and IRQ lines. I didn't feel that this particular port was a good choice for installing a special connector.
I gave a bit of thought into PortCAN which is the Controller Area Network. I decided that rather than dedicate space to this port, I would allow the user to plug into a breadboard for that. You need some support chips for the CAN anyway, so a specific connector didn't make sense to me.
PortT is the timer port, and I have put each of these pins onto two separate connectors. The first is a 2x5 that has all of the timer pins available. The second group are a series of 1x3 headers that you can either plug a servo motor into (signal, Vdd, and Vss are provided on each of the eight 3 pin connectors), or you can plug digital sensors into these connectors. In addition, a separate power supply is available as an option on these connectors. You need the separate power supply if you are planning on running more than a couple of servo motors from this board.
On the bottom of the board, I decided there should be several empty SMT layouts to support putting user defined parts. On this board, I put a pair of SO16 and SO8 layouts, and a TSSOP20 layout. Each of the pins on these blanks will have a small connection pad that will allow you to solder wire wrap style wire to other parts of the board.
To create these spare parts, I copied blank packages from other libraries, then created new symbols that were used to match up to the package. Inserting this new symbol created a surface mount package on the PCB. I also created a small symbol called a pad. This pad is connected to each pin, and creates a small solder pad on the board. As you can see in the symbol, a 16 pin part uses 16 of these pads. They overlap a little on the symbol. However, the resulting packages are useful for soldering wire wrap wire to and jumpering off to another part of the board.
For example, the TSSOP20 can be used for mounting a DS1306 Real Time Clock. This can be added to the bottom, and some spare holes can be used to mount a 32khz crystal.
In addition, several empty through holes where left on .100" centers. You can either use these as breadboard holes, or you can use them as additional connectors for plugging into a breadboard.
This section is going to discuss the layout of the board and some of the interesting features of the board. The layout, which fits into a 2.8" x 3.0" area, is designed to be as compact as possible, yet still allows for all of the features I thought were important.
Layout of a board like this requires time and patience. You also need to have on hand some samples of each part, a good measuring device, and hopefully some way to lay the parts out. My original goal was to layout all of the through hole components on a .100" (100 mil) center grid. Some of the parts, such as the crystal, switch, and some of the caps, don't matter. However, all of the connectors are on this grid. It makes it possible to have all of the connectors lineup with a breadboard.
The other advantage was being able to physically layout all of the connectors on a breadboard during the design. This way I was able to insure that enough space existed between each of the connectors and other components. There are mating connectors that need to be plugged into these connectors.
There are a couple of exceptions to this 100 mil center rule. The 8 'servo' connectors (IOC0-IOC7) are on a 150mil grid from each other. I had to do this to fit the board onto the 2.8" x 3.0" size. At 100 mil, they were too close together. At 200 mil, they consumed too much vertical space. This is one of many tradeoffs that had to be made.
The rest of this section discusses some of these tradeoffs and design decisions.
The backside of this board has a MAX3221 to handle the RS232-TTL conversion for one of the serial ports. This is an optional part of the design, meaning it doesn't have to be installed. I needed to put on a 9 pin DB-9 serial port connector. Rather than consume board space for a right angle connector, I decided to use a solder cup connector.
Turns out that Eagle has a layout provided for this particular trick, so I was able to use a stock layout. The idea here is that the solder cup DB-9 connector is inserted so the top 5 pins solder to the top side of the board (Shown in RED), and the bottom 4 to the bottom side of the board (shown in BLUE).
The final physical incarnation looks like the photo above. This is a nice way to handle this part of the layout.
Since we have several empty SMD layouts on the backside of the board, I needed to add the ability to wire these to spare connectors and to spare parts, such as caps, resistors, crystals, etc. Therefore, when I was done with the routing and the other layout duties, I added spare pads in quite a few places. These spare pads are on 100 mil centers, and will allow the end user to add additional connectors and/or parts.
Shown above filled with white, these spare pads are not connected to anything, yet! There are somewhere around 60 or so of these extra holes available.
For this particular board, I decided to handle the routing using a combination of the autorouter and manual routing. Eagle has a very good autorouter. However, there are times when the autorouter just doesn't 'see' the solutions as well as a human eye. In particular, I decided to route the D60 part to the main bus connectors by hand. I was able to do this so that the routing consumed only the top layer (shown in red). After doing that, I had the autorouter handle the rest of the board.
Autorouters such as Eagles can do 100% routes of the board. While they may be quite functional, they often times need manual rework.
A case in point is how it decided to route some of the lines for the Analog to Digital converter.
As you can see in the above picture, one of the pins for the A/D converter took quite a tour of the board on its way to the connector. While this may indeed work, it isn't the best way to handle this routing. Since many of the rest of the A/D pins are routed directly, this single channel is going to be subject to much more noise than the other channels. Therefore, I need to fix this particular routing before I have the production run made.
It turns out that I may need to revise my schematic and change the PORTAD0 and PORTAD1 connectors to split the two ports. This is a byproduct of how the pins are laid out on the 912D60. It turns out to be difficult to route these in a good way given how the come out of the chip. We shall see about the outcome.
Ok, so the board layout and schematic are finished, and I also have the first two prototype boards built. So far, everything is working well. Here are what the prototypes look like:
I had these done by Advanced Circuits ( www.4pcb.com ) as part of a special deal they were promoting to existing customers. The boards cost $33 each, but they came complete with silkscreen and solder mask.
Here are a few items I found while creating boards using Eagle that you might want to know about.
CAD programs sometimes have different ways of specifying drill sizes. The Eagle libraries, for example, specify the size of the drill BEFORE plating. This would be the physical drill that is used by your board house.
An important thing for you to know up front is what your board house expects. Some want the drill size, others want the finished hole size. If you are not sure, you should ask! Advanced Circuits wants the finished hole size. They will add about 5 mil to this for the drill size. Once the hole is drilled, the plating will fill in about 4 to 5 mils worth of space, leaving you with about the right sized hole.
Most board houses would like you to mark your boards corners on the top layer. This involves drawing short little lines in each corner so they can tell where your board ends. Apparently, having the lines in the silkscreen layer doesn't cut it. I have had several boards delayed from missing corner marks (I always forget!).
There are several different board finishes available. I wanted to have a solder reflow on my boards. This enabled me to hand solder SMT parts, such as the capacitors and IC's using the existing solder. This is something you will have to specify when you get your own boards made. It may cost a little more, but it is well worth it if you have surface mount parts to be hand soldered. You get a much better connection.
I have a few things left to do, and several things I would really like to write about.
I need to correct the routing for the A/D ports, and to finish electrical testing for this board. As is, it seems to work pretty well, and I am happy enough to call it a product really soon.
I am planning seperate articles on generating boards using Eagle, previewing them using GC-Prevue, and more details on what you need to send to your board house. That will be upcoming in the next few months.