Page 22 - Embedded Microprocessor Systems Real World Design
P. 22
maximum baud rate, but careful examination of the data sheet may reveal that not
all modes of operation are available at the maximum rate.
Determining whether a particular processor can keep up with the interface
requirements is not always easy. Unfortunately, there is no magic formula to deter-
mine this. I have frequently resorted to writing part of the code for an interface
just to be sure that the processor has enough capacity.
Memory Requirements
Determining the memory requirements is an essential part of embedded system
design. If you overestimate the memory required, you may select an unnecessarily
expensive solution. If you underestimate it, you risk project delays while the system
is redesigned. Since memory comes only in sizes that are addressable with digital
bits, such as 8K x 8, 32K x 8, and so on, you need not estimate memory require-
ments down to the last byte. You do need to ensure that you have enough memory,
however.
RAM RAM is fairly straightforward to estimate. The number of variables plus the
sum of all internal buffers, FIFOs (first in, first out), and stacks is the amount of
RAM required. Many singlechip microcontroller ICs are limited to less than 1024
bytes (lK, or 1 kilobyte) of internal memory. If the memory goes beyond what is
internally available, then external RAM must be added. However, this requires the
use of 1/0 pins to address the added memory and often defeats the purpose of
using a single-chip controller.
One caution is important: Some microcontrollers have restrictions on RAM
usage, such as the need to use part of the internal RAM for banks of internal reg-
isters. For a couple of examples, look at the 8031, which has 128 bytes of internal
RAM. The 8031 has four register banks that use 32 bytes of that, leaving 96 usable
bytes of RAM. If your application needs only one or two register banks, the rest is
available for general use. The 8052 processor has 256 bytes of general-purpose
RAM, but the upper 128 bytes are accessible only by using indirect addressing. The
Atmel AVR90S8515 has 32 general-purpose registers, but only 16 can be used with
the immediate data instructions.
The amount of RAM required also will vary with the development language used.
Some inefficient compilers use enormous amounts of RAM.
ROM The amount of ROM required for a system is the sum of the program code
and any ROM-based tables required. Examples of ROM tables are step motor ramp
tables, data translation lookup tables, and indirect branch tables. The tables usually
are straightforward to estimate. The difficult part is estimating the code size. Esti-
mates of code size become more accurate with increasing experience, usually
gained by being wrong. However, it is important to remember that being precise is
System Design 7