Файл: Embedded Controller Hardware Design (Ken Arnold, 2000).pdf

ВУЗ: Не указан

Категория: Не указан

Дисциплина: Не указана

Добавлен: 13.06.2025

Просмотров: 2744

Скачиваний: 0

ВНИМАНИЕ! Если данный файл нарушает Ваши авторские права, то обязательно сообщите нам.

133CHAPTER SIX

A Detailed Design Example

but in this case we use the EPROM’s output enable access time, tOE. Looking back at the EPROM specifications, we find that for the slowest (-30) part, the worst-case value for tOE is 120 nS.

TPLIV - EPROM tOE = 150 - 120 = +30 nS design margin

When /PSEN is directly connected to the EPROM /OE line, the CPU provides 150 nS (TPLIV) for the EPROM enable access time, and the -30 EPROM tOE is 120 nS, which is more than fast enough. This design change allows the CPU to run at the full 12MHz rating. The example shows how we may have to change the design in order to optimize the timing, and the iterative nature of the design process.

As in everything else, there are some drawbacks and implications for this approach that need to be considered:

The EPROM is always enabled when the /CE input is grounded, so only one EPROM can be used this way. This has the disadvantage that the EPROM draws its maximum operating power constantly.

Use of /CE to enable the device reduces power consumption, which is important for battery powered applications, especially when there are multiple devices. Enabling with the /CE input allows for the use of multiple memory chips in the system by using a memory address decoder to decode the appropriate address range. The decoder output can drive the selected memory device /CE input lines one at a time, just as we saw in the previous module on memory address decoding. That way only one of the memory devices is powered at a given time. The memories’ /OE lines would be connected to the processor’s /PSEN signal output, so that slower memories could still be used. As is the case for other specs, the speed or power consumption of the system can be optimized.

This concludes our example, but it is evident that there are many other timing specifications that must be evaluated for a given design. Fortunately, the same methods we have used here are applicable to the other timing specifications and devices used in a typical embedded controller system. This completes the preliminary evaluation of the program fetch cycle memory access times, which are often among the most difficult to meet. The next step is to analyze the data memory cycle timing.


134EMBEDDED CONTROLLER

Hardware Design

External Data Memory Cycles

Data memory read and write cycles are also examined in basically the same way, using the CPU data read cycle data and the SRAM performance specifications. The data read cycle has essentially the same three possible paths as the program read cycle, except that the CPU /RD signal is connected to the SRAM /OE input, and the SRAM chip enable is grounded.

External Memory Data Memory Read

The data memory cycle corresponds closely to the program memory cycle, as shown in the accompanying figures and tables. Figure 6-6 illustrates the timing relationship between the CPU and external SRAM data memory when the CPU

ALE

PSEN

TRLRH

RD

Port 2

ADDRESS

ADDRESS A15-A8

OR SFR P2

TAVWL

TRHDZ

TALDV

TRHDX

Port 0

TAVDV

ADDRESS

INSTR IN

FLOAT

A7-A0

FLOAT

DATA IN

FLOAT

OR FLOAT

Figure 6-6: 8031 data memory read timing.

Variable Clock

12 MHz Clock

1/TCLCL = 1.2 to 12 MHz

Symbol

Parameter

min

max

units

min

max

units

TRLRH

/RD Pulse Width

400

nS

6TCLCL-100

nS

TWLWH

/WR Pulse Width

400

nS

6TCLCL-100

nS

TRLDV

/RD To Valid Data In

250

nS

5TCLCL-170

nS

TRHDX

Data Hold After /RD

0

nS

0

nS

TRHDZ

Data Float After /RD

100

nS

2TCLCL-70

nS

TAVDV

Address to Valid Data In

600

nS

9TCLCL-150

nS

TAVWL

Addressto /WR or /RD

200

nS

4TCLCL-130

nS

TQVWH

Data Setup Before /WR

400

nS

7TCLCL-180

nS

TWHQX

Data Held After /WR

80

nS

2TCLCL-90

nS

NOTE: There are 2 to 8 ALE cycles per instruction. Clocks and state timing are shown on the timing diagram for reference purposes only. They are not accessible outside the package. TCY is the minimum instruction cycle time that consists of 12 oscillator clocks or two ALE cycles. Address setup and hold times are the same for data and program memory.

Table 6-4: 8031 data memory timing parameters.


135CHAPTER SIX

A Detailed Design Example

reads from the SRAM while Figure 6-7 shows the SRAM read cycle timing diagram. Table 6-4 gives the data memory timing parameters for the 8031, and Table 6-5 lists the SRAM’s ready cycle timing parameters. The CPU’s TAVDV spec places an upper limit on the data memory’s access time, tAA, for path A.

tRC

Address

Valid Address

tAA

tACS

CS

tOH

tOE

tOLZ

OE

tOHZ

tCHZ

Dout

High Impedance

Valid Data

Figure 6-7: SRAM read cycle timing diagram.

-8

-10

-12

-15

Parameter

Symbol

min

max

min

max

min max

min

max

Units

Read Cycle

tRC

85

100

120

150

nS

Address access

tAA

85

100

120

150

nS

/CS access

tACS

85

100

120

150

nS

/OE to Output Valid

tOE

45

50

60

70

nS

Output hold from addr

tOH

5

10

10

10

nS

/CS to output enable(low Z)

tCLZ

10

10

10

10

nS

/OE to output enable(low Z)

tOLZ

5

5

5

5

nS

/CS hi to out disable(hi Z)

tCHZ

0

30

0

35

0

40

0

50

nS

/OE hi to out disable(hi Z)

tOHZ

0

30

0

35

0

40

0

50

nS

Table 6-5: SRAM read cycle timing parameters.

A)The delay from when the CPU provides a valid address A8..15 on Port 2 until the end of the SRAM address access time, resulting in valid data from the SRAM on the data bus. The CPU requires that the data from the SRAM be available 600 nS (TAVDV) after being presented with a valid


136EMBEDDED CONTROLLER

Hardware Design

address. The -15 version of the SRAM has an address access time of 150 nS max. (SRAM tAA), so there is 450 nS of margin for this memory at this clock speed!

TAVDV - SRAM tAA = 600 - 150 = 450 nS margin

B)Even allowing for an additional 16 nS through the address latch for address bits 0..7, there is still a margin of 434 nS, so there is no problem with address access time.

TAVDV - SRAM tAA - Latch tPmax = 600 - 150 -16 = 434 nS margin

C)This is the time available to the memory after /RD goes low and when valid data is on the bus. The enable access time provided by the CPU is 250 nS (TRLDV). Since the slowest RAM, the -15 version, has an OE access time of 70 nS (tOE), there is 180 nS of design margin.

External Data Memory Write

Figure 6-8 and Table 6-6 show the SRAM write cycle diagram and timing parameters. Figure 6-9 shows a data memory write timing diagram for the 8031.

tWC

Address

Valid Address

tACS

tWR

OE

tCW

CS

tAS

tWP

WE

tOHZ

Dout

High Impedance

tDW

tDH

Din

High Impedance

Valid Data

Figure 6-8: SRAM write cycle timing diagram.


137CHAPTER SIX

A Detailed Design Example

-8

-10

-12

-15

Parameter

Symbol

min max

min max

min max

min max

Units

Write Cycle

tWC

85

100

120

150

nS

Chip Select to

end of write

tCW

75

80

85

100

nS

Addr valid to

end of write

tAW

75

80

85

100

nS

Address setup time

tAS

0

0

0

0

nS

Write Pulse width

tWP

60

60

70

90

nS

Write recovery time

tWR

10

0

0

0

nS

Write to output in high Z

tWHZ

0

30

0

35

0

40

0

50

nS

Data to Write time overlap

tDW

40

40

50

60

nS

Data hold from write time

tDH

0

0

0

0

nS

Output disable to out in highZ

tOHZ

0

30

0

35

0

40

0

50

nS

Output active from end of WR

tOW

5

5

5

5

nS

Table 6-6: SRAM write cycle.

ALE

PSEN

TWLWH

WR

Port 2

ADDRESS A15-A8

TAVWL

TQVWH

Port 0

INSTR

IN

FLOAT

A7-A0

DATA

OUT

ADDRESS

OR SFR P2

TWHQZ

ADDRESS

OR FLOAT

Figure 6-9: 8031 data memory write timing.

From the CPU specifications, the address is valid 200 nS (TAVWL) before the /WR line goes low, and the data is valid 400 nS (TQVWH) before the /WR line goes high. The RAM requires an address setup before write time of 0 nS, which is compatible with the 200 nS provided by the CPU. The RAM data setup time before the end of the /WE pulse (SRAM spec tDW) is 60 nS, which is well within the 400 nS available. The latch delay has been ignored here because it is 16 nS, which is insignificant compared to the design margin available. Also, the chip select input of the RAM is grounded, so the chip select access time does not need to be considered. The minimum write pulse width from the CPU is 400 nS (TWLWH), and the RAM requires only a minimum of 90 nS (tWP), so the pulse width is well within the spec. The RAM has a 0 nS hold time requirement (tDH), and the processor provides 80 nS (TWHQX), so the RAM hold time requirement is also met with margin.