C161U
The Bootstrap Loader
Preliminary Data Sheet
360
02.2000
PRELIMINARY
PRE
LI
M
INAR
Y
- E
XC
ER
PT
-
second receive loop may directly use the pre-initialized interface ASC to receive data
and store it to arbitrary user-defined locations.
This second level of loaded code may be the final application code. It may also be
another, more sophisticated, loader routine that adds a transmission protocol to enhance
the integrity of the loaded code or data. It may also contain a code sequence to change
the system configuration and enable the bus interface to store the received data into
external memory.
This process may go through several iterations or may directly execute the final
application. In all cases the C161U will still run in BSL mode, ie. with the watchdog timer
disabled and limited access to the internal code memory.
Exiting Bootstrap Loader Mode
In order to execute a program in normal mode, the BSL mode must be terminated first.
The C161U exits BSL mode upon a software reset (ignores the level on P0L.4) or a
hardware reset (P0L.4 must be high then!). After a reset the C161U will start executing
from location 00’0000H or the external memory, as programmed via pin EA.
Choosing the Baudrate for the BSL
The calculation of the serial baudrate for ASC from the length of the first zero byte that
is received, allows the operation of the bootstrap loader of the C161U with a wide range
of baudrates. However, the upper and lower limits have to be kept, in order to insure
proper data transfer.
The C161U uses timer T6 to measure the length of the initial zero byte. The quantization
uncertainty of this measurement implies the first deviation from the real baudrate, the
next deviation is implied by the computation of the S0BRL reload value from the timer
contents. The formula below shows the association:
For a correct data transfer from the host to the C161U the maximum deviation between
the internal initialized baudrate for ASC and the real baudrate of the host should be
f
CPU
32
S0BRL
1
+
()
-------------------------------------------
BC161U
S0BRL
T6
36
–
72
-------------------
=
T6
9
4
--
f
CPU
B
Host
---------------
=
,