beautypg.com

2 – i2c bootloader protocol, 2 – i, C bootloader protocol – Maxim Integrated DS4830A Optical Microcontroller User Manual

Page 183: Ds4830a user’s guide

background image

DS4830A User’s Guide

183

22.2.2 – I

2

C Bootloader Protocol

After entering the I

2

C bootloader, all I

2

C communication takes place on the default I

2

C bootloader slave address 36h.

When writing data to the DS4830A, slave address 36h (R/

W bit = 0) is used. To read data from the DS4830A I

2

C

bootloader, slave address 37h (R/

W bit = 1) is used. The I

2

C bootloader does not return the status bits that are

available from the JTAG bootloader. The following I

2

C steps are required to send each command

1) Send an I

2

C start, followed by writing slave address 36h(R/

W bit set to write).

2) Write command byte.
3) Write any Data In bytes.
4) The NOP byte is not required for the I

2

C interface. Sending a NOP byte when using the I

2

C bootloader will

place the bootloader into an unknown state. Instead, an I

2

C Restart needs to be issued, followed by writing

slave address 37h (R/

W bit set to read).

5) Possibly poll returned data until command execution completes.
6) Read and ACK all Data Out bytes.
7) Read and NACK the Return byte, verify that 3Eh was returned.
8) Send an I

2

C STOP.


Some of the bootloader commands, such as the erase

and CRC commands require extra time to execute. For these

commands, the I

2

C port can be continuously polled to determine when the command completes. This polling is done

by reading the returned data bytes after sending slave address 37h. The I

2

C bootloader will return data B7h while it

is currently busy. When data other than B7h is returned, the bootloader is returning valid data. An example of polling
for the “Master Erase” command is shown in Figure 22-2. After sending slave address 37h, the I

2

C bootloader will

output B7h until the command has finished execution. The I

2

C master needs to continue reading and returning

ACK’s until 3Eh is returned. The master then NACK’s this byte (3E).

Command

02h

A

S

Slave Address(W)

36h

A

Polling

B7h

A

A

A

Return

3Eh

S
R

Slave Address(R)

37h

A

N
A

P

Polling …..

B7h

KEY

S = START
SR = REPEATED START
P = STOP

A = ACKNOWLEDGE
NA = NOT ACKNOWLEDGE
SHADED = SLAVE TRANSACTION

Polling …..

B7h

A

Figure 22-2: I

2

C Bootloader Polling


Refer to Application Note 5602:

In-System Programming Using I

2

C Bootloader Commands

for ISP using the I

2

C

bootloader.