2 – bootloader operation, 1 – jtag bootloader protocol – Maxim Integrated DS4830A Optical Microcontroller User Manual

Page 182

Advertising
background image

DS4830A User’s Guide

182

22.2 – Bootloader Operation

Once in bootloader mode, the JTAG and I

2

C interfaces both use the same commands. How these commands are

implemented will be different between the two interfaces. Table 22-4 shows an example command and parameters.
The next two sections will detail how to implement these commands using either the JTAG or I

2

C interface.


Table 22-4: Example Bootload Command
Byte(s)

Command

Data In

NOP

Data Out

Return

Input

Command

Data In

00h

00h

00h

Output

X

X

X

Data Out

3Eh


Byte Name

Description

Command

All bootloader commands begin with a single command byte. The upper four bits of this command
byte define the command family (from 0 to 15) and the lower four bits define the specific command
within that family.

Data In

Data bytes that are input to the bootloader that are required for the command. The number of Data
In bytes varies for each command. Some commands do not require any Data In bytes.

NOP

The NOP byte is only used for JTAG mode. This is a byte of 00h that is clocked into TDI, while
TDO is ignored.

Data Out

Data Out is any data that is returned by the bootloader. The number of Data Out bytes varies for
each command. Some commands do not output any Data Out bytes.

Return

A return value of 3Eh is output by the bootloader at the start of first command and following the
successful completion of every command thereafter. If the Return byte is read prior to 3Eh being
loaded by the bootloader, the read will return the data that is currently in the shift register. The
value 3Eh is only loaded into the shift register once. Any subsequent reads will return invalid data.
In JTAG bootload mode, status bits will tell when ROM loader is sending valid 3Eh.


22.2.1 – JTAG Bootloader Protocol
The JTAG port consists of a shift register. As data is clocked into TDI, data will be clocked out of TDO. Each “byte”
on the JTAG port is actually 10 bits. The two least significant bits are the status bits described in Table 22-2. The
data that is input to the device on the TDI pin should have the two status bits set to 0. The following steps are
required for each command.

1) Transmit the Command byte on TDI. Ignore the returned data on TDO.
2) Transmit any Data In bytes on TDI. Ignore the returned data on TDO.
3) Transmit the NOP byte of 00h, on TDI. Ignore the returned data on TDO.
4) Possibly poll returned data until command execution completes.
5) Transmit 00h on TDI for each Data Out byte. Read the Data Out byte on TDO.
6) Transmit 00h on TDI and verify that the Return byte output on TDO is 3Eh.

Some of the bootloader commands, such as the erase and CRC commands require extra time to execute. For these
commands, the two status bits can be used to verify the state of the bootloader. After issuing any of these
commands, the NOP command can continuously be sent to the bootloader. If the returned status bits are 10, the
bootloader is still busy processing the command. If the status bits are 11, the bootloader has completed execution of
the command. The first byte that was returned with status bits 11 will be the first byte of valid returned data from the
bootloader.

Advertising