Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
8xC196EA microcontroller user's manual.1998.pdf
Скачиваний:
52
Добавлен:
23.08.2013
Размер:
8.29 Mб
Скачать

8XC196EA USER’S MANUAL

16.4.3 Code RAM Data Transfer Example

The following example, illustrated in Figure 16-9, reads two words at address locations 480H and 482H from the code RAM:

1.Shift in SDU command 06H to select the code RAM address access instruction.

2.Shift the high byte (04H) of the address, followed by the low byte (80H) of the address into the CR_ADDR register.

3.Shift in SDU command 10H to select the code RAM word read instruction.

4.The SDU asserts CRBUSY#, indicating that it is processing a code RAM command. Wait for CRBUSY# to be deasserted, indicating that the data is ready.

5.Shift in SDU command 10H to read the next word. CD_ADDR will automatically increment. (As this command byte is shifted in, the high byte of data0 will be shifted out on CROUT.)

6.Shift in SDU command 28H to put the SDU into an idle state. This shift causes the low byte of data0 to be shifted out on CROUT.

7.Shift in SDU command 00H to reset the SDU and terminate the data transfer. This shift causes the high byte of data1 to be shifted out on CROUT.

8.Shift in SDU command 28H to put the SDU into an idle state. This shift causes the low byte of data1 to be shifted out on CROUT.

 

1

2

3

5

6

7

8

CRIN

Command

Address(H) Address(L)

Command

Command

Command

Command

Command

 

CR_ADDR

 

Read

Read

SDU Idle

SDU Reset

SDU Idle

CROUT

 

 

 

Data0

Data0

Data1

Data1

 

 

 

 

Byte (H)

Byte (L)

Byte (H)

Byte (L)

 

 

 

 

4

 

 

 

CRBUSY#

A3319-01

Figure 16-9. Code RAM Word Read Sequence

Figure 16-10 is an example of a code RAM byte write sequence.

16-12

SERIAL DEBUG UNIT

CRIN

Command

Address(H)

Address(L)

Command

Data

Command

Data

Command

 

CR_ADDR

 

 

Write

Byte

Write

Byte

SDU Reset

CRBUSY#

A3320-01

Figure 16-10. Code RAM Byte Write Sequence

16-13

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