Download Microcontrollers 8-Bit Single-Chip Microcontroller

Transcript
XC864
Bootstrap Loader
15.3.2
The Selection of Modes
When Fast LIN BSL routine enters Phase II, it first awaits for an 8-byte Header Block,
from the host which contains the information for the selection of the modes, as shown
below.
Block Type
00H
Data Area
Mode
(1 byte)
(Header Block)
Checksum
Mode Data
(5 bytes)
(1 byte)
Description:
00H: The block type, which marks the block as a Header Block
Mode: The mode to be selected. Mode 0 - 6 are supported. See Table 15-2
Mode Data: Five bytes of special information to activate corresponding mode.
Checksum: The checksum of the header block. XOR of all 7 bytes.
•
•
•
•
15.3.2.1 The Activation of Modes 0 and 2
Mode 0 and Mode 2 are used to transfer a user program from the host to the XRAM and
Flash of the microcontroller respectively. The header block has the following structure:
The Header Block
00H
(Header
Block)
00H/
02H
(Mode 0/
2)
Mode Data
Start Addr Start Addr
High
Low
(1 byte)
(1 byte)
Block_
Length
(1 byte)
Checksum
Not used
(2 bytes)
Mode Data Description:
Start Addr High, Low: 16-bit Start Address, which determines where to copy the
received program code in the XRAM/Flash1)
Block_Length: The whole length (block type, data area and checksum) of the following
Data or EOT Blocks.2) 3)
Not used: 2 bytes, these bytes are not used and will be ignored in Mode 0/2.
1)
2)
3)
Flash address must be aligned to the wordline address, where DPL is 00H/20H/40H/60H/80H/A0H/C0H/E0H. If
the data starts in a non-wordline address, PC Host needs to fill up the beginning vacancies with 00H and
provide the start address of that wordline address.
When the Block_Length is defined in Header Block, the subsequent Data or EOT Block must be of this length.
To redefine the Block_Length, it must be accompanied by a new Header Block.
The minimum and maximum Block_Length is 34 bytes and 99 bytes respectively for Mode 2, since Flash is
written by wordline (32 bytes) each time.
User’s Manual
Bootstrap Loader, V1.1
15-25
V1.0, 2008-06