Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Embedded Controller Hardware Design (Ken Arnold, 2000).pdf
Скачиваний:
223
Добавлен:
12.08.2013
Размер:
1.35 Mб
Скачать

96EMBEDDED CONTROLLER

Hardware Design

The same technologies that were developed for memories have been applied to programmable logic and microcontroller chips. Each memory technology has unique advantages and limitations that the designer must be aware of.

The wide variety of storage concepts and technology are central to the design of microcontrollers, and are categorized and described in this chapter.

Memory Taxonomy

There are many classes of memory devices, and the emphasis is placed here on those that are of significance to the designer of embedded systems. As a result, most of this chapter is dedicated to solid-state semiconductor memory chips rather than magnetic and optical storage devices.

The most significant distinction between memory devices is how they are connected to the CPU. There are two ways of connecting memory to the CPU:

Primary memory the CPU is directly connected to the memory

Secondary memory: connected to the CPU indirectly

Figure 4-2 illustrates the differ-

 

 

 

 

 

 

Secondary

 

 

 

 

 

 

 

Memory

 

ence in the way the two types

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

are connected to the processor

 

 

 

 

 

 

 

 

 

bus. The CPU is only able to

 

CPU

 

Primary

 

 

Secondary

 

 

 

 

Memory

 

 

 

directly access information

 

 

 

 

 

Memory

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Control

 

 

stored in primary memory. All

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

instructions and data must be

 

 

 

 

 

 

 

 

 

transferred to primary memory

 

 

 

 

 

 

 

 

 

first before the CPU can process

 

 

CPU has direct

 

CPU accesses

them. An example of primary

 

 

 

 

 

access to data

secondary memory

memory is semiconductor RAM.

 

 

 

in primary

indirectly through

 

 

 

memory

memory control device

The term RAM is frequently,

 

Figure 4-2: Primary versus secondary memory.

but improperly, used to refer to

 

 

 

 

 

 

 

 

 

 

primary storage. RAM only specifies the access mechanism (described below) but is often misused to imply the primary read/write semiconductor storage from which the CPU fetches instructions and data. Random access methods may be used in either primary or secondary memories, but are most commonly used for the primary storage, which is why RAM has been associated

97CHAPTER FOUR

Memory Technologies and Interfacing

with primary memories. Because the CPU must access instructions and data quickly, primary memory must have very fast access time, on the order of tens to hundreds of nanoseconds or approximately 10-8 to 10-7 seconds, compared to secondary (disk) memory with memory access on the order of milliseconds (10-3 seconds).

Unfortunately, semiconductor memory, which is used for primary storage because of its high speed, is much higher in cost, size, and power per bit of storage than secondary memories. Semiconductor memory is currently the most practical mechanism for storing programs and data that are available for immediate use by the CPU. This is because the primary program and data memory must operate on the order of the speed of the processor memory cycles. Otherwise, the memory speed limits the overall system speed, because the CPU would have to be forced to wait until the memory is ready. One or more CPU clock cycles would have to be added to each memory access in order to slow the CPU down to match the speed of the memory. These delay cycles are referred to as wait states because the processor must wait for one or more clocks before the memory data is available to the CPU.

Secondary Memory

A separate intermediate device usually controls secondary memory, which is not directly accessible to the CPU. The device manages the transfer of information between the storage device and the processor bus. When the data stored on a secondary memory device is needed by the CPU, it must first be moved to primary memory via the controller before the CPU can access it. Examples of secondary storage include magnetic and optical disk and tape that are used for large information stores because of their low cost per bit combined with high density and low power. Because of these differences, typical microcomputer architectures have about an order of magnitude larger secondary memories than primary memories. Secondary memories such as disk drives are most appropriate for storing large programs and data sets that must be maintained over a period of time. Secondary memories like magnetic tapes are often used for archival or backup storage because of their very high density and low cost. Another major advantage to magnetic and optical storage is that it is non-volatile.

Figure 4-3: Random access memory (RAM).
One Bit
of Memory
Row
Select
Column
Select
7
6
5
4
1
Rows
3
(5) 0
2
1
1
One of Eight Decoder
0
Row
Select
0 1 2 3 4 5 6 7
Columns
One of Eight Decoder
RAM is unique because the access
time is essentially independent of where the data is stored. The ran-
dom access method can be likened to the rows and columns of a spreadsheet, or the “pigeon hole” style boxes in an old desk. The
specific memory location of interest is selected by a unique row and
column address as shown in Figure 4-3. The row and column access can be used to select bits on a memory chip as well as chips on a memory board. Random access memory sizes are specified as 2n x m, where 2n refers to the number of
unique locations or addresses and m is the number of bits stored in each location. A typical memory with 15 address lines and 8 data lines would be specified as a “32K x 8” or 32 kilobytes, since 215 is 32,768 or 32 kilobytes. Another memory might be described as “4M x 1,” meaning four million locations each containing one bit. Eight 4M x 1 memories can be wired in parallel to provide four megabytes of data for an 8-bit processor, or 16 can be paralleled to provide eight megabytes of data organized as 4M x 16.
1
0
(3) 1
Random Access Memory
98 EMBEDDED CONTROLLER
Hardware Design
Volatility
Non-volatile memories, such as magnetic disk and tape, maintain the information stored in them even when the power is removed. Volatile memories, however, do lose the information they hold when power is removed from them. The primary storage read/write RAM in a PC is volatile, which is why it must be reloaded with the operating system software (referred to as bootstrapping and loading the operating system) when the power is restored. In embedded controller designs, non-volatile memory is used to store the programs and constant data, and volatile memory is used to store the variables and temporary data.
Column Select
Figure 4-4: Direct access memory.
Disk Format

99CHAPTER FOUR

Memory Technologies and Interfacing

Sequential Access Memory

Sequential access memory has an access time that is dependent upon the location of the data that is to be accessed. This is best illustrated by using the most common sequential access device: a magnetic tape. The information is stored in a serial fashion onto the tape, and the only data that can be accessed at any instant is the data stored on the tape in contact with the read/write head. Thus when the head is positioned at the beginning of the tape, the entire length of the tape must pass by the head before the last item can be accessed.

Direct Access Memory

Direct access memory which is a sort of combination of random and sequential access methods, is used on disk drives to provide an intermediate access time to fill the gap between high-speed random and low speed sequential access devices.

The storage medium is disk shaped, and contains a magnetic film for standard “hard drive” or fixed magnetic disks. Optical disks use an ultra-thin optical metal film that can be written once with a high intensity laser or read back using a low power laser. Optical disks that can be erased and re-written use a magneto-optical film whose optical properties (light polarization angle) can be changed using a low power laser and a magnetic field.

In each case, information is stored on concentric rings, called tracks on the disk. The information is stored sequentially on each track as it is on tape, but the read/write head

can be moved to select

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

the appropriate track.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Disks with multiple

 

 

 

Highest

 

 

 

 

 

 

 

Track Zero

 

 

 

recording surfaces also

Numbered Track

 

 

 

 

 

 

 

 

(Outermost Track)

 

 

 

 

 

 

 

 

(Innermost Track)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

have multiple heads

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Rotation

 

 

 

to read each surface,

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

so they are randomly

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

accessible by head and

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

track, and sectors are

 

Data

Gap

ID

Gap

Data

Pre-

Pre-

ID1

Gap

Data1

Gap

ID2

Gap

Dat2a

 

Index

Index

sequentially accessed on

 

 

 

 

 

 

 

 

 

Gap

Gap

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

each track. Figure 4-4

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Index Mark

 

 

 

 

 

 

 

 

 

Sector

Sector

Sector

 

Sector

illustrates this.

 

 

 

 

 

 

 

n-1

n

 

 

 

 

1

 

 

2