XC2200 Derivatives
System Units (Vol. 1 of 2)
Startup Configuration and Bootstrap Loading
User’s Manual
10-19
V2.1, 2008-08
SCFG/BSL, V1.3
Note: The identification byte D5
H
does not directly identify a specific derivative. This
information can, in this case, be obtained from the identification registers.
10.6.2.2 Enhanced UART Bootstrap Loader
The enhanced UART bootstrap loader transfers program code/data via Channel 0 of
USIC0 Module (U0C0) into PSRAM.
Data is transferred from the external host to the XC2200 using asynchronous eight-bit
data frames without parity (1 start bit, 1 stop bit). The length of the code/data is not fixed
as in the
Standard UART Bootstrap Loader
but can be arbitrary up to the PSRAM total
size minus 256 bytes. Also the code execution can start from arbitrary PSRAM address,
as well as the initial baudrate can be changed - e.g. increased for faster transfer of long
code/data blocks.
The initial steps of this bootloader are the same as of the
. XC2200 first scans the RxD line to receive a zero byte, i.e. one start bit, eight 0
data bits and one stop bit. From the duration of this zero byte it calculates the
corresponding baudrate factor with respect to the current CPU clock, initializes the serial
interface U0C0 accordingly and switches pin TxD to output. Using this baudrate, an
identification byte (DA
H
) is returned to the host.
The next steps in this mode are to process the so-called Bootloader Header as follows:
1. XC2200 sends the current PDIV divider from U0C0_BRGH register - the 10-bit value
is sent in 2 bytes
Note: In this bootloader, the multi-byte values are sent in high-to-low order.
2. XC2200 receives and sends back to the host a Header_Code (1B)
3. XC2200 receives and sends back to the host number of bytes to be transferred
Code_Length (3B)
- the allowed range for this number is between 1 and the PSRAM size for the device
minus 256 bytes
4. XC2200 receives and sends back to the host the start address STADD for code-
execution (3B)
- the segment address (highest STADD byte) must equal E0
H
for XC2200
5. XC2200 receives and sends back to the host a value for PDIV divider (2B, bits[9:0]
effective only)
- if the new value is different from the current - the new one is written into
U0C0_BRGH register and a zero confirmation byte is sent back to the host with
baudrate already changed
6. XC2200 receives and sends back to the host a Trailer_Code (1B)
a) if both the Header_Code and Trailer_Code are equal to the XC2200 identification
byte (DA
H
) - the Bootloader sends to the Host a zero byte and continues further;
b) if the above condition is not true - the Bootloader sends an identification byte (DA
H
)
to the host and restarts Header processing again from point