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

8XC196Kx, Jx, CA USER’S MANUAL

Upon entering serial port programming mode, the device enters a waiting loop, called Monitor_Pause, in which it waits for RISM commands to arrive across the serial port. The commands are each one byte in length and have values between 00H and 1FH. A value between 00H and 1FH is considered a command unless it follows a data latch enable (SET_DLE_FLAG) command. The SET_DLE_FLAG command sets the DLE flag in the MODE register (57H). The DLE flag alerts the RISM to store the next byte in the DATA register, a 32-bit first-in-last-out (FILO) register located at 58H.

When a receive interrupt occurs, the RISM checks the data value and the DLE flag. If the data value is greater than 1FH or if the DLE flag is set, the received byte is considered data and is stored in the DATA register (58H). Each time new data is received, the DATA register is shifted left by eight bits. If the value is between 00H and 1FH and the DLE flag is clear, the received byte is considered a command. Commands are stored in the CHAR register (56H). After it executes each command, the RISM resumes Monitor_Pause, except where otherwise noted.

To access a particular address, you must first send the address across the serial port as data. Send it one byte at a time, with the high byte first (the address is always assumed to be 16 bits). The RISM stores the address data in the DATA register. Now you must transfer the address from the DATA register to the ADDR register (5CH) by sending the DATA_TO_ADDR command (0AH).

16.10.5 RISM Command Descriptions

Table 16-15 lists and describes the RISM commands. The following sections provide examples.

 

 

Table 16-15. RISM Command Descriptions

 

 

 

 

Value

Command

 

 

 

 

Description

 

 

 

 

 

 

 

 

 

00H

SET_DLE_FLAG

Sets the DLE flag in bit 0 of the MODE register (57H) to tell the RISM that the next

 

 

byte on the serial port is data that should be loaded into the DATA register (58H).

 

 

The flag is cleared as soon as the byte is read.

 

 

 

 

 

 

 

 

 

02H

TRANSMIT

Transmits the low byte of the DATA register to the serial port through the CHAR

 

 

register, shifts the DATA register right (long) by eight bits, and increments ADDR

 

 

by one.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

ADDR

 

 

DATA

 

 

SBUF_TX

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Before command

22

14

 

7A

2F

 

80

 

67

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

After command

22

15

 

00

7A

 

2F

 

80

 

67

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

16-36

 

 

 

 

PROGRAMMING THE NONVOLATILE MEMORY

 

Table 16-15. RISM Command Descriptions (Continued)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Value

Command

 

 

 

 

 

Description

 

 

 

 

 

 

 

 

 

 

 

04H

READ_BYTE

Puts the contents of the (byte) memory address pointed to by the ADDR register

 

 

into the low byte of the DATA register.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Memory Addr.

 

 

 

ADDR

 

 

DATA

 

 

2215

2214

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Before command

22

 

14

 

 

 

 

 

 

 

 

80

67

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

After command

22

 

14

 

 

 

 

 

67

 

 

80

67

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

05H

READ_WORD

Puts the contents of the (word) memory address pointed to by the ADDR register

 

 

into the low byte of the DATA register.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Memory Addr.

 

 

 

ADDR

 

 

DATA

 

 

2215

2214

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Before command

22

 

14

 

 

 

 

 

 

 

 

80

67

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

After command

22

 

14

 

 

 

 

80

67

 

 

80

67

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

07H

WRITE_BYTE

Puts the low byte of the DATA register into the memory address pointed to by the

 

 

ADDR register and increments ADDR by one.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Memory Addr.

 

 

 

ADDR

 

 

DATA

 

 

2217

2216

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Before command

22

 

16

 

2E

11

 

80

09

 

 

FF

FF

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

After command

22

 

17

 

2E

11

 

80

09

 

 

FF

09

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

NOTE: To write to an OTPROM location, VPP must be at +12.5 volts. To write to

 

 

an internal RAM location, VPP can be at either +5.0 volts or +12.5 volts.

08H

WRITE_WORD

Puts the low word of the DATA register into the memory address pointed to by the

 

 

ADDR register and increments ADDR by two.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Memory Addr.

 

 

 

ADDR

 

 

DATA

 

 

2217

2216

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Before command

22

 

16

 

2E

11

 

80

09

 

 

FF

FF

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

After command

22

 

18

 

2E

11

 

80

09

 

 

80

09

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

NOTE

 

 

 

 

 

 

 

 

 

 

To write to an OTPROM location, VPP must be at +12.5 volts. To write to an

 

 

internal RAM location, VPP can be at either +5.0 volts or +12.5 volts.

 

 

 

16-37

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