Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
8XC196Kx,8XC196Jx,87C196CA microcontroller family user's manual.1995.pdf
Скачиваний:
65
Добавлен:
23.08.2013
Размер:
3.97 Mб
Скачать

8XC196Kx, Jx, CA USER’S MANUAL

15.5.4 Regaining Bus Control (8XC196Kx Only)

While HOLD# is asserted, the device continues executing code until it needs to access the external bus. If executing from internal memory, it continues until it needs to perform an external memory cycle. If executing from external memory, it continues executing until the queue is empty or until it needs to perform an external data cycle. As soon as it needs to access the external bus, the device asserts BREQ# and waits for the external device to deassert HOLD#. After asserting BREQ#, the device cannot respond to any interrupt requests, including NMI, until the external device deasserts HOLD#. One state time after HOLD# goes high, the device deasserts HLDA# and, with no delay, resumes control of the bus.

If the device is reset while in hold, bus contention can occur. For example, a CPU-only device would try to fetch the chip configuration byte from external memory after RESET# was brought high. Bus contention would occur because both the external device and the device would attempt to access memory. One solution is to use the RESET# signal as the system reset; then all bus masters (including the device) are reset at once. Chapter 13, “Minimum Hardware Considerations,” shows system reset circuit examples.

15.6 BUS-CONTROL MODES

The ALE and WR bits (CCR0.3 and CCR0.2) define which bus-control signals will be generated during external read and write cycles. Table 15-5 lists the four bus-control modes and shows the CCR0.3 and CCR0.2 settings for each.

.

Table 15-5. Bus-control Mode

Bus-control Mode

Bus-control Signals

CCR0.3

CCR0.2

(ALE)

(WR)

 

 

 

 

 

 

Standard Bus-control Mode

ALE, RD#, WR#, BHE#

1

1

Write Strobe Mode

ALE, RD#, WRL#, WRH#

1

0

Address Valid Strobe Mode

ADV#, RD#, WR#, BHE#

0

1

Address Valid with Write Strobe Mode

ADV#, RD#, WRL#, WRH#

0

0

The BHE# and WRH# pins are not implemented on the 87C196CA, 8XC196Jx devices.

15.6.1 Standard Bus-control Mode

In the standard bus-control mode, the device generates the standard bus-control signals: ALE, RD#, WR#, and BHE# (see Figure 15-9). ALE is asserted while the address is driven, and it can be used to latch the address externally. RD# is asserted for every external memory read, and WR# is asserted for every external memory write. When asserted, BHE# selects the bank of memory that is addressed by the high byte of the data bus.

15-20

INTERFACING WITH EXTERNAL MEMORY

ALE

 

 

 

 

 

 

 

 

 

ALE

 

 

 

 

 

 

 

 

WR# or RD#

 

 

 

 

 

 

 

 

 

WR# or RD#

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

BHE#

 

 

 

 

 

 

 

AD7:0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Valid

 

 

 

Addr Low

Data Out

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

AD15:0

 

 

Addr

 

Data Out

 

AD15:8

 

 

 

Address High

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

16-bit Bus Cycle

 

 

 

 

8-bit Bus Cycle

A3077-01

Figure 15-9. Standard Bus Control

When the device is configured to use a 16-bit bus, separate lowand high-byte write signals must be generated for single-byte writes. Figure 15-10 shows a sample circuit that combines BHE# and AD0 to produce these signals (WRL# and WRH#). A similar pair of signals for read is unnecessary. For a single-byte read with the 16-bit bus, both bytes are placed on the data bus and the processor discards the unwanted byte.

BHE#

WRH#

WR#

WRL#

AD0

A3109-01

Figure 15-10. Decoding WRL# and WRH#

15-21

8XC196Kx, Jx, CA USER’S MANUAL

Figure 15-11 shows an 8-bit system with both flash and RAM. The flash is the lower half of memory, and the RAM is the upper half. This system configuration uses the most-significant address bit (AD15) as the chip-select signal and ALE as the address-latch signal.

 

 

CS#

CS#

 

AD15

 

 

 

 

AD14:8

74AC

A14:8

A12:8

 

A14:8

 

 

373

 

 

 

 

LE

 

 

 

ALE

 

D7:0

D7:0

 

 

 

8K×8

8XC196

LE

32K×8

 

Flash

 

RAM

 

 

 

 

 

(28F256)

 

 

AD7:0

74AC

A7:0

A7:0

 

373

A7:0

 

 

 

 

 

 

 

OE#

OE#

WE#

RD#

 

 

 

 

WR#

 

 

 

 

Applies to the 8XC196KS, KT devices in bus timing modes 1 and 2 only.

 

 

 

 

 

 

A3078-01

Figure 15-11. 8-bit System with Flash and RAM

15-22

INTERFACING WITH EXTERNAL MEMORY

Figure 15-12 shows a system that uses the dynamic bus-width feature. (The CCR bits, BW0 and BW1, are set.) Code is executed from the two EPROMs and data is stored in the byte-wide RAM. The RAM is in high memory. It is selected by driving AD15 high, which also selects the 8-bit bus width mode by driving the BUSWIDTH signal low.

BUSWIDTH

 

CS#

CS#

 

CS#

 

 

 

 

 

 

 

A15

 

 

 

 

AD15:8

74AC

A14:8

A14:8

A12:8

A12:8

 

373

A13:7

A13:7

 

 

 

 

 

 

 

 

 

LE

 

 

 

 

 

 

 

D15:8

 

 

 

 

ALE

 

 

D7:0

 

D7:0

 

 

 

 

 

 

 

 

16K×8

16K×8

 

8K×8

8XC196

 

EPROM

EPROM

 

RAM

 

LE

(High)

(Low)

 

 

 

AD7:0

74AC

A7:1

A7:1

A7:0

A7:0

 

373

A6:0

A6:0

 

 

 

 

 

 

 

 

 

 

OE#

OE#

 

OE#

WE#

RD#

 

 

 

 

 

 

WR#

 

 

 

 

 

 

 

 

 

 

 

 

A3087-01

Figure 15-12. 16-bit System with Dynamic Bus Width

15-23

Соседние файлы в предмете Электротехника