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

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

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

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

Добавлен: 13.06.2025

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

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

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

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 mini­ mum 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.


138EMBEDDED CONTROLLER

Hardware Design

We’ll now look at three typical design problems and show how to use the techniques described in this chapter to solve them.

Design Problem 1

For the same three paths in Figure 6-3, find the maximum allowable clock rate, given the slowest EPROM from Table 6-2. Use the specs for the -30 part which has a 300 nS access time and the same address latch specs in Table 6-3. Consider the 8031, EPROM, and 74ALS373 latch specs as discussed in the sections describing Paths A, B and C.

Solution: In this case, we are given the component timing, and we need to solve for the minimum clock period (T = 1/maximum clock frequency).

Path A:

The CPU allows TAVIV = 5*T-100 nS

The EPROM uses Taa = 300 nS

The limiting condition is TAVIV = Taa, so:

5T-100 = 300

5T = 400 T = 80 nS

Path B:

The CPU allows TAVIV = 5*T-100 nS

The EPROM uses Taa = 300 nS

The latch uses TPHL D->Q = 16 nS

The limiting condition is Taa + Tlatch = TAVIV, so:

TAVIV = Taa + Tplatch and TAVIV = 5T-100, so:

5T-100 = 300 + 16

5T = 416 T = 83 nS

Path C:

The limiting condition is TPLIV = Toe of the EPROM, so:

The EPROM Toe from the table is 120 nS

The equation is TPLIV = Toe

139CHAPTER SIX

A Detailed Design Example

Solving for T, we have:

3T - 100 = 120

3T = 220

T = 220/3 = 73 nS

Of all three paths, the longest period is due to Path B at 83nS, so it is the limit to the clock rate for the specs considered here.

Paths A and C are not constraints for this case.

So Path B is the limiting case when /OE is connected to /PSEN, and the maxi­ mum clock frequency is 1/83nS = 12 MHz.

Note that Path B is just at the spec limit for 12 MHz operation (1/83 nS = 12 MHz), so the maximum clock is 12 MHz, even for a faster EPROM.

Also notice that if /PSEN was instead connected to /CE, (Path C), the TPLIV spec would be the limiting factor: TPLIV = 3T-100 = Tce of the EPROM. The EPROM Tce from the table is 300 nS. Solving for T, we have:

3T-100 = 300

3T = 400

T = 400/3 = 133 nS.

For this case, 1/133 nS = 7.5 MHz would be the maximum allowable clock rate.

Design Problem 2

You have an existing processor design, and you need to define what the mini­ mum acceptable specs are for the program EPROM to determine which vendors and part numbers will work in the system. Assuming a clock rate of 12 MHz for the 8051, determine the following specs for the memory chip to be used with it, assuming the same address latch used in the previous examples, and find the maximum acceptable values for:

Tce max (chip enable acess time)

Taa max (address access time)

Tod max (output disable time, referred to as Tdf in the EPROM spec)

Assume /PSEN is connected to the EPROM /CE and EPROM /OE is grounded.


140EMBEDDED CONTROLLER

Hardware Design

Solution: In order to determine the required Tce, we need to calculate the memory spec based on the CPU speed. Since /PSEN is connected to the EPROM /CE, the relevant CPU spec is TPLIV. From the 8031 program memory timing table, TPLIV = 3T-100 nS, where T is TCLCL, the clock period. The answer for Tce is in the table for 12 MHz as 150 nS, but it could be computed for an arbitrary clock as:

Tce max = 3*83.3-100 = 150 nS

Taa is different, because the latch delay must be included. In this case the relevant CPU spec is TAVIV, which is 320 nS at 12 MHz. Subtracting the worst case latch delay, Tphl D->Q is 16 nS. Therefore only 320-16 = 304 nS is available to the memory as Taa. The general solution is TAVIV = 5T - 100, so:

Taa = TAVIV-Tplatch = 5*83.3-100-16 = 301 nS

Note that the Taa result is slightly (3nS) different from the value computed using the table. This is not unusual because the specs are not necessarily consistent, nor are they precise to a few nS. Many of the specs are based on statistical estimates of the production population, and are themselves only approximations. Often these specifications are guaranteed but not tested on every device.

Tdf is the time the EPROM takes to turn off its output drivers. This relates to the time the CPU allows for the EPROM to turn off its tri-state driver outputs after /PSEN goes inactive. If this spec is violated there will be bus contention between the CPU and the EPROM for the time of the overlap. The relevant CPU spec is TPHDZ. At 12 MHz, 75 nS are available to the EPROM to disable its outputs. The general form is TPHDZ = T-10 or 73 nS, again slightly different from the table value.

Design Problem 3

For a specific EPROM spec, find the maximum allowable clock rate, given the slowest EPROM from Table 6-2. Use the specs for the -30 part which has a 300 nS access time and the same address latch. Consider the 8051 specs for TPLIV, TAVIV, and TPHDZ.

Solution: In this case, we are given the component timing, and we need to solve for the minimum clock period ( = 1/maximum clock frequency).

141CHAPTER SIX

A Detailed Design Example

The equation for TPLIV = 3T-100 = Tce of the EPROM. The EPROM Tce from the table is 300 nS. Solving for T, we have:

3T - 100 = 300

3T = 400

T = 400/3 = 133 nS.

The EPROM Taa = 300 nS, Taa = TAVIV-Tplatch and TAVIV=5T-100, so:

300 = 5T - 100 - 16

5T = 416 T = 83 nS

The EPROM Tdf = 105 nS, and Tdf = TPHDZ = T-10, so:

105 = T - 10 T = 115 nS

Of all three specs, the longest period is due to the EPROM Tce and TPLIV spec, 1/133 nS = 7.5 MHz. If the /PSEN signal is connected to the -30 EPROM’s /OE pin however, then:

EPROM Toe = 120 nS TPLIV = 3T - 100 = 120 3T = 220

T = 73 nS

With /PSEN connected to /OE the TPLIV spec is not the limit.

The next slowest is due to TPHDZ, resulting in a minimum clock period of 115 nS, corresponding to a maximum clock frequency of 1/115nS = 8.696 MHz.

For the -30 EPROM in Table 6-2, Tdf will be the limiting specification when the access time is fast enough. Tdf is 105 nS, which is greater than the 75 nS available at 12 MHz, resulting in as much as 105 - 75 = 30 nS of bus contention! That is a serious conflict, and should not be allowed to occur.

Note that the access times were well within specifications for 12 MHz operation. If we looked only at the access time specs there is no problem, so the system might appear to work. However, bus contention may occur at the 12 MHz frequency, so the correct answer is 8.7 MHz.


142EMBEDDED CONTROLLER

Hardware Design

If we change the EPROM to the -25 version, it is possible to clock the CPU at its limit of 12 MHz without exceeding any of the other specs. This example shows why it is important to consider ALL the specs, since it is not always the obvious specs that are the limits.

Completing the Analysis

Once the preliminary timing analysis is complete, the next step is to evaluate the noise margin as well as the DC and AC loading for the design. The results of this will determine if any of the signals are incompatible or overloaded, requiring changes to the circuit design or component selection. Of course, any changes made to the design (changing components, adding pull-up resistors, etc.), will require the timing to be re-evaluated. Once again we find that the interactions may cause us to do our design in an iterative fashion. This is part of the reason we don’t want to perform a complete timing analysis from the beginning.

Once the preliminary timing, noise margin, and loading analyses indicate that the design is correct, it is necessary to review all the remaining specifications for all the ICs used in the design. This is not as difficult as it might seem. Most of the hard work is done as part of the preliminary analysis. Also, many of the device specs are simply not applicable to a given design. Examples of these specs include alternative SRAM memory write cycles. A given processor will always use one particular memory write sequence (i.e.: address stable first, then /CS active, then /WE goes low). As a result, the other write cycles and specs can be ignored. Still other specifications are just for information, such as the 8051 TCY spec, which simply informs us that an instruction cycle takes 12 clock cycles on the standard 8051. There will be some other specs that will apply to our design, such as the setup and hold times for some devices. In some cases the specification is a non-constraint, such as the 8051’s TPHDX, input instruction data hold time after /PSEN goes high, specified as 0 nS. A zero hold time indicates that the driving device may remove the instruction at the instant when /PSEN goes inactive. Any device will meet that constraint, since it cannot predict in advance when the /PSEN line will change. Other specs will often have a huge margin as can be seen by inspection. The ’74ALS373 address latch, for instance, requires a minimum enable pulse width that is on the order of 10 nS. The CPU puts out an ALE pulse that is TLHLL = 140 nS wide, so there is obviously lots of margin in that case.