Chapter 8. Putting Together a System

During the course of this book, we’ve investigated what goes on inside your processor. Now, before you can build a system, we need to consider what goes on in other components of your system. Communicating with the other components is a start to this. The next step is to get a feel for common peripherals, data handling methods, and design patterns for adapting your system to different needs.

Ultimately, the information you need for using peripherals is in their datasheets, but there are enough commonalities that you can get a feel for what to look for.

However, putting together a system goes beyond connecting each piece; you have to start looking at the system as a collection of parts working together. The last part of this chapter gives some tips on data handling and putting together algorithms.

Key Matrices

You’ve already seen buttons with a simple I/O interface in Chapter 4. However, if you have  a bunch of buttons (maybe a keyboard), you don’t need one I/O line per button. You can create a matrix of input lines to get a lot more out of your I/O than you expect. There are two ways to implement a key matrix: a row/column scan is useful when you need the peripheral to be cheap, whereas Charlieplexing (aka tri-state multiplexing) is more expensive but minimizes the number of I/O lines needed.

With a row/column scan, you can implement an M × N matrix with M + N lines. So if you want to implement a 12-digit number pad, you could do a 3 × 4 matrix ...

Get Making Embedded Systems, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.