Powering Up Your Home-Brewed Computerby John Catsoulis, author of Designing Embedded Hardware
Creating new computer hardware is a process of precise engineering and design. It involves careful selection of chips and then a thorough analysis to ensure that those chips will work (and interact) in the way in which you intend. Once the design is complete, the first prototype must be built, and built in a logical (pardon the pun) and systematic manner, such that any design or construction faults are easily found.
A virgin computer, the engineering term for such machines, has a lot of unknowns, and these need to be discovered step by step. While this process is heavily based on engineering ground rules, there's an art to doing it effectively. It's an art that is slowly (and sometimes painfully) learned by the novice. In this article, I want to share with you some of the basic techniques that I have acquired over the years. Here's how I go about producing a small computer system.
Read the Technical Data
First, obtain data sheets and books for all major components in the system. These provide detailed information not only on the functionality of the components, but also their electrical characteristics. They also provide programming information vital for software development.
Read the technical data from beginning to end. This may seem arduous, as these documents can be lengthy and are not, shall we say, in the best-selling-novel category of reading. Think of it as a character-building exercise that will develop your patience and stamina for the debugging sessions that lie ahead. It is important that you understand how the devices work. When you are debugging your system, you have to know what to look for to know whether different parts of your computer are functioning, and the only way to gain this information is by reading the data thoroughly. Don't assume anything about the functionality of the devices. Read and check everything carefully, including voltage levels, basic timing, and anything else that may be relevant to the system.
Once this is done, you should then work out a basic schematic of the system. The schematic shows how devices are connected together functionally. It should include your initial design of the basic computer, including processor, logic, external memory (if used), and whatever peripherals are needed. The outputs of a given chip will be driving the inputs of other chips. It is important to ensure that the timing of these output signals match the requirements of the other chips. A signal that arrives too late, or ends too soon, will result in a nonfunctioning computer. Therefore, you should do an analysis of your design and confirm the timing of your system. This can be a real pain, but it is necessary and will save you a lot of time later on, when it comes to debugging your system. Faults are easier to fix before a computer is built than afterward.
Design Your Schematic
When designing the schematic, also consider the system's power consumption and power requirements. Will it be battery powered, or will you plug it into a wall socket? What sort of connectors are required to connect this computer to the outside world? Also think about any hardware that you can add that will aid in debugging. These may not be part of the primary application, but their inclusion could save you a lot of time (and pain) during the debugging process. I always add in an LED that shows when the system is powered. Two other such "tools" I always add are a bank of status LEDs and a serial port, whether or not they will be needed in the end system. The LEDs can be driven under software control to provide valuable status information. For example, a bank of LEDs can indicate the system's progress through a power- up sequence, long before the rest of the computer is operational. A serial port extends this even further; at its basic level, it can be used to output status and debugging messages to a terminal or host computer, providing precious insight into the flow of software execution.
Beyond this, a simple command interpreter (or better, an interactive language such as Forth, gives you control of the computer hardware. To be able to interactively execute snippets of code, or "manually" tweak control registers, can be an incredibly useful debugging tool, if used intelligently.
Lay Out Your PCB Design
Once you have your schematic and timing analysis completed, then you begin laying out your printed circuit board (PCB) design. When laying out a PCB, consider not only what connections have to be made, but all the physical, electrical, and noise environments in which your system will be operating. You need to consider the physical size of the system and where it will live. Will it be enclosed in a case, or will it need mounting in some special assembly? Does it need holes for mounting screws? What is the best way to place components within the circuit board so as to optimize signal routing within the system? Will the system draw a lot of current, and therefore have a lot of heat to dissipate? If so, how will you cool the machine? How will electrical noise (crosstalk, EMI, ground bounce, etc.) affect the computer, and will it require shielding? Add anything that may help debugging, such as a test point that allows you to easily monitor a particular signal using an oscilloscope or logic analyzer. Another useful thing that seasoned engineers add is a simple pad that is connected to ground. This provides a convenient place to anchor the ground lead of an oscilloscope probe.
When the PCB design is completed, you must carefully check it over, making sure that there are adequate clearances between tracks, pads, vias, and fills. Also ensure that the hole sizes are correct for the components that will be mounted. If a pin is too large for a hole, then the component can't be mounted on the PCB. It is useful to print out the PCB design, because sometimes faults will stand out easily on paper that you simply won't notice when staring at a computer screen. After you've checked everything thoroughly and you're happy with the design, then send it to a PCB fabrication house for manufacture.
Once the PCB has been fabricated and you get it back, check it carefully to ensure that all pads and tracks are intact and properly etched. It is not unusual for problems to occur in the fabrication process, and it is better to find these problems before you solder on the components than after. With the power turned off, do a continuity test between the ground pads and the ground pin on the power connector. This ensures that good ground connections are present where they should be.
Pages: 1, 2