Hardware Construction
First, we will look briefly at some traditional techniques suitable for building one-off boards and prototypes, using the dice circuit in Figure 10.1. Then a slightly more elaborate general purpose demonstration board will be designed and laid out in prototype form, and some programs provided to demonstrate its features and the related programming principles.
Printed Circuit Board
The PCB is the standard method for making electronic circuits. In its basic form, it starts life as a sheet of insulating glass fiber-reinforced epoxy resin, with a layer of copper on one side. The circuit connections are made by printing or photographically transferring a pattern of conducting tracks and pads onto the copper.
The layout for a simple PIC circuit is shown in Figure 10.2. It has a PIC 16F84A, push button, seven-segment display, buzzer and associated components. It can be programmed to operate as electronic dice, generating a random number between 1 and 6. The pattern of the copper tracks is shown, as well as the ‘silk screen’ printing, which is applied to the component side of the board to show where to place the components.
The layout is reversed, as it will be printed onto a translucent mask, which is then used to create the pattern of connections on the copper side of the board. The copper layer is coated with
a light-sensitive material, which is exposed to ultraviolet light through the mask. In the exposed areas of the board, the photosensitive material becomes soluble and is removed by a caustic solvent, exposing the copper below. This is then dissolved (etched) in an acid bath, leaving behind the copper layout where it was protected by the etch-resistant layer. The components are then fitted to the top side of the board, and the leads and pins soldered to the pads.
Once the layout has been designed, it can be used for batch production of the application hardware. Specialist companies are now often used to manufacture the boards direct from the file output of the PCB design software, as the cost of short production runs is now lower, owing to the application of advanced manufacturing techniques. The final product is shown in Figure 10.3.
Another simple single-sided layout is shown in Figure 10.4(a) on the edit screen of ARES PCB software. This package allows the ISIS schematic to be imported and converted to a layout for printing or export to a manufacturing system in a standard format (usually a Gerber file). Before transfer from ISIS, each component needs a suitable pin arrangement attached, depending on the actual component to be used. For example, the physical size of a resistor depends on its power rating, which consequently affects the pin spacing. Switches have a great variety of pin outs, or may be mounted off the board so suitable terminals must be provided. The ARES library provides standard pin-outs, or they can be created if necessary for non-standard components.
The netlist is then exported to ARES, and the list of components appears in a window at the left of the edit screen (Figure 10.4a). The components may be selected and placed individually on the layout edit screen and their positions adjusted for the most compact arrangement (auto- placement is also available). Initially, the connections are shown as direct lines between pins (‘rat’s nest’). These are converted into tracks when the auto-router utility is invoked. Final adjustments to the track layout are completed manually. If necessary, wire links may be used on a single-sided board to achieve a viable layout. A double-sided board simplifies the track arrangement a great deal, but plated through-holes or connecting pins are then necessary. When the layout is complete, a three-dimensional preview of the populated board can be generated (Figure 10.4b). The use of ARES is described in more detail in Appendix E.
The Microchip LPC demo board is an example of a double-sided board commercially produced in large quantities. Using both sides of a board allows it to be more compact overall, and simplifies the track layout. In general, tracks are oriented in a common direction on each side, perpendicular to the other side. More complex boards, such as the PC motherboard, have multiple layers sandwiched together to provide the large number of connections required by the system busses. Holes are plated through to make the connections between different layers, and a printed silk-screen layer carries the component labeling (or legend) on the top side. High-resolution printing techniques in the commercial production process allow a finer track width (where the current is small) and, overall, a more precise, compact layout.
Most production designs now use surface-mounted components, which are smaller and do not require through-holes for mounting, but are all soldered to the surface layer simultaneously by flow soldering. The surface-mount version of the PIC 16F887 can be seen on the Microchip 44-pin board. Full details of these boards can be downloaded from www. microchip.com, with the layouts provided in the user manuals. Both boards have prototyping areas so that simple peripheral circuits can be added without having to design a test board from scratch.
An alternative method for making simple prototype boards, which has recently become viable for the hobbyist, training organizations and small businesses, is the PCB mill. This is essentially a small 2.5D (dimensions) milling machine. An engraving tool is mounted on X, Y and Z (limited travel) axes and programmed to outline the copper tracks and pads to isolate them from the rest of the copper layer (Figure 10.5). This avoids the use of corrosive chemicals, and is viable for small-scale production.
Even with the current user-friendly ECAD packages, the PCB layout can take some time to create, and a considerable amount of skill is needed to use the software. Therefore, we will also look at how to prototype our hardware using traditional methods, which do not require specialist software or PCB fabrication equipment.
Breadboard
Breadboard (plugboard) has sets of miniature sockets laid out on a 0.1 inch grid which will accept the manual insertion of component leads and tinned copper wire (TCW) links (Figure 10.6a). It has rows of contacts interconnected in groups placed either side of the center line of the board, where the integrated circuits (ICs) are inserted, giving multiple contacts on each IC pin. At each side of the board, there are long rows of common contacts, which are used for the power supplies. Some types of breadboard are supplied in blocks that link together to accommodate larger circuits, or are mounted on a base with built-in power supplies.
The layout for a simple circuit is shown in Figure 10.6(b), with a PIC 16F84A driving a light- emitting diode (LED) at RB0 via a current-limiting resistor. The only other components required are a capacitor and resistor to form the clock circuit, but we must not forget to connect the !MCLR (Master Clear) pin to the positive supply, or the chip will not run. The chip could now be programmed to flash the output at a specified rate.
Breadboard circuits can be built quickly, with no special tools required, other than a supply of insulated wire (recycled telephone cables are ideal) and wire cutters. However, the connections
are relatively unreliable, so bad connections are likely in more complicated circuits. Therefore, a method of producing prototype circuits with more reliable soldered connections might be preferred.
Stripboard
Stripboard (veroboard) requires no special tools or chemical processing. The components are connected via copper tracks laid down in strips on a 0.1 inch grid of pinholes in an insulating board (Figure 10.7a).
The components are soldered in place and the circuit is completed using wire links on the component side soldered to the tracks on the copper side. The tracks must be cut where necessary to isolate the connection nodes in the circuit using a hand drill. The components are generally placed across the tracks, so that each pin connects with a separate track. The tracks must be cut between the rows of pins in each dual in-line (DIL) chip. Care is required to avoid dry joints (too little solder) or short-circuits between tracks due to solder splashes and whiskers (too much solder). A manual drawing may used to draft the layout, if necessary, but experienced constructors will often build the circuit ad hoc, with maybe some additional wastage of board area.
Figure 10.7(b) shows how the simple PIC circuit can be laid out for construction on stripboard using general purpose drawing tools, such as those provided with Word®. In the word processor, the drawing toolbar needs to be switched on, and page layout view selected. In the Draw menu,
the grid should be switched on and set to 0.1 inch; this allows layouts to be drawn actual size, since this is the spacing between standard in-line pins. The circuit can then be drawn using suitable line styles, text boxes and so on. When finished, use the Select Objects tool to select the whole drawing and Group it in the Draw menu. This prevents text cursor movement from disrupting the drawing, and the whole diagram can be repositioned on the page if required.
Naturally, the circuit can also be hand-drawn in the traditional manner.