Bailey O.H.Embedded systems.Desktop integration.2005
.pdf
180 |
Chapter 6 / Final Design |
|
|
Host System Flowcharts
The flowcharts in this section describe the host system.
Device Interface Layer
Device_Interface
Send to Embedded System
Receive from Embedded System
Assemble Packet
Unassemble Packet
Send to Host
Receive from Host
Set Interface
Calculate CRC
Exit
EBS_Send
EBS_Rec
Asm_Pkt
Dis_Pkt
Host_Send
Host_Rec
Set_Interface
Calc_Crc
Figure 6-19
The primary function of the device interface layer is to provide consistent send, receive, packet assemble, packet disassemble,
Chapter 6 / Final Design |
181 |
|
|
and interface routing on all supported platforms. All plat- form-dependent device driver code resides in this layer.
User Application Layer
User_Application
Read_State
Read Saved State
Device_Init
Initialize Device Interface
EBS_Open
Open Embedded System
EBS_Send
Send Data Requests
EBS_Rec
Receive Data Requests
Update_Display
Update UI Data Display
Process_Display
Process UI Data Request
EBS_Close
Close Embedded System
Device_Shutdown
Shut Down Device Interface
Store_State
Store Application State
Exit
Figure 6-20
The user application serves three important functions on the host system. First, it provides an orderly communications channel to the embedded system. This allows the host system to both
Chapter 6
182 |
Chapter 6 / Final Design |
|
|
monitor and control the embedded system remotely. Second, it provides a means of controlling the embedded system remotely via a user interface that looks identical to the embedded system LCD display. Everything displayed on the embedded system LCD is also displayed on the user application display when it is active. Third, it provides a graphical method of controlling the embedded system. When a mouse is clicked over a control or the computer keyboard is used to control the system, those mouse clicks and keystrokes are processed immediately and sent to the embedded system for control processing.
Chapter Summary
In this chapter we have outlined the high-level functionality of the embedded system, host device interface, and host user application. We have not gotten down to the level of defining the actual contents of each function. That will be done as we develop and refine our designs in Part II, starting in the next chapter.
Part I Summary
We’ve covered an enormous amount of ground thus far: embedded system design, device drivers for USB Ethernet, and serial communications. Dallas 1-Wire network considerations and designing cross-platform applications are just a small part of what we’ve learned. No matter how many words we read or how many charts we review, the final challenge comes in the implementation of our system, which begins in the very next chapter. Use this chapter as a point of reference for Part II as we build, test, integrate, and write the host applications for our product.
Part II
Implementation
Chapter 7: Hardware Development
Chapter 8: The BASIC Stamp 2p Prototype
Chapter 9: The PIC Prototype
Chapter 10: The PSoC Prototype
Chapter 11: Cross-Platform Application Development
183
Chapter 7
Hardware
Development
Overview
If you made it this far, we are ready to start building the first prototype boards. This chapter begins by providing a list of required tools, and then takes the reader step by step through the building of several circuit boards that will be used by all the prototypes.
Once the boards are completed, we will write test software for each board function to check our work. At the end of this chapter is a tutorial on how to make your own printed circuit boards and sources for the necessary materials, along with the artwork needed to build each board described.
I should note that wires were soldered on the top of the sol- der-type breadboards for illustration purposes. Normally the wiring would be kept on the bottom side of the board. This chapter provides step-by-step instructions for the beginner and schematics for the more experienced. For those who wish to make their own circuit boards, the full-scale artwork is at the very end of this chapter. It can also be downloaded from the Wordware web site at www.wordware.com/files/embsys or from my web site at www.time-lines.com.
185
186 |
Chapter 7 / Hardware Development |
|
|
Types of Prototype Circuit Boards
For those of you who have never built a prototype board, let’s examine the most common methods of prototyping electronic circuits. There are several commonly used methods for starting the prototype cycle for an electronics board. They are:
Solderless breadboard — Uses jumpers and predrilled insertion holes
Soldered breadboard — Uses soldered jumpers and predrilled holes
Wire wrap board — Can use a soldered breadboard or special wire wrap board
Etched circuit board — Requires software and other materials
There are many factors to consider when determining which method of circuit prototyping is used. I use solderless breadboards to get portions of a circuit working first and then develop a schematic. Then I’ll either use solderless breadboards or I’ll make printed circuit boards for each functional section. This is my way of determining functional layout. Afterward I’ll make a printed circuit board with all the functions on it. This technique allows my schematic to grow slowly as the project progresses with the end result being a completed circuit board. I always try to start with a single layer board even if it gets large. This allows me to resolve any problems by visual inspection if necessary, which can be impossible with multilayered boards. Once I have the final circuit design down, I’ll send out for a couple of professionally made circuit boards from a board house.
Chapter 7 / Hardware Development |
187 |
|
|
Solderless Breadboards
There are many sources for solderless boards. If you can wait a few days and want to save money, I suggest you order them via mail order or the Internet. Figure 7-1 shows a small solderless breadboard. The two outside rows on each side are connected along the entire length of the board. These are usually used for power and ground connections. This allows power and ground connections to be accessed from any of the internal rows. The rows that are internal to the breadboards are connected together perpendicular to the power connections. The center breaks these into two sections. This allows for different types of components to be added and tested. The board pictured below will cost between $6 and $10 depending on where it is purchased.
Chapter 7
Figure 7-1
This board is the smallest board available. There are many sizes and some have power connectors on them. I keep a variety of these boards in my shop so I can prototype portions of a circuit before moving to a circuit board. One final note: When ordering these boards be certain to also order jumper kits; otherwise, you will be spending considerable time making jumpers for building your circuits.
188 |
Chapter 7 / Hardware Development |
|
|
Soldered Breadboards
There are several styles of solder type breadboards. The first style is laid out identical to the solderless breadboard mentioned above. If you’re building a very simple circuit and want to finish it quickly, then by all means use this type of board. For our projects, however, we will use a grid-style solder type breadboard. There are numerous types and sizes of these boards available, but for our purposes we will use the Radio Shack 276-150. This particular board has two rows in the center of the board we will use for power. This is in contrast to the two outside rows on the solderless breadboard in Figure 7-1. Figure 7-2 shows the layout of the 276-150. Note the layout of the two center rows connected horizontally.
Figure 7-2
Wire Wrap Boards
The soldered breadboard can be used for wire wrapping or you can get a special wire wrap board. A real wire-wrap board doesn’t have the connections joined together since every connection is jumpered. You can also use a soldered breadboard for wire-wrap- ping a circuit by soldering headers (at 0.1" spacing) to the main
Chapter 7 / Hardware Development |
189 |
|
|
component connections. Wire wrap techniques require a very thin wire and a tool that is used for wrapping the wire around the components or wire wrap posts. This technique takes some getting used to. The benefit of wire wrap is that the circuit can be changed by simply unwrapping the wire and attaching it to a different lead or post. Doing this using a solder technique is more time consuming because you need a desoldering tool and a soldering iron to change connections. Since making changes on a soldered board is much more time consuming, you may be asking why we have chosen to use soldered breadboards. There are two reasons. The first is availability; soldered breadboards are available at any electronics store including Radio Shack. The second reason is because we don’t need special wire wrapping tools and wire, which can be very expensive.
Required Tools
Now, let’s talk about the tools we’ll need. To build the circuits in this book an assortment of tools will be required. Some of these you may already have around the house or office; others you will need to purchase or borrow. Following is a detailed list of tools used:
Soldering iron — A good 20to 35-watt soldering iron is a must. I use a Weller that has replaceable heating elements and tips. I prefer a 25-watt element and a pinpoint tip for all but surface mount work. (I use a medium screwdriver tip for surface mount work.)
Rosin core solder — I purchase one-pound spools of 60/40 rosin core solder, available at Radio Shack. In almost 30 years of working with electronics, I’ve used about five spools of solder. I also have a solder pot that I use for tinning the ends of stranded wires. I don’t suggest you purchase a solder pot. They are expensive and can easily start a fire if left unattended for too long.
Chapter 7
