8 BOOTSTRAPPING
The
Note that the GAL which controls the bootstrap load operation is also responsible for turning on the LED. In its default implementation, the LED is lit once the RSTOUT# signal is activated. For specific applications, the user may alter the operation of the bootstrap logic by changing the GAL equations.
Once the bootstrap loader is invoked the serial port S0 is used to communicate with the C167. The host must first send a 0 byte with 8 data bits, 1 stop bit and no parity bits. The C167 responds with the byte A5h . Then the host expects 32 bytes of code to be downloaded to internal RAM starting at address 0FA40h and run.
Since 32 bytes is not enough to initialize and configure the C167 and then download a user program, a secondary loop is used. This loop is a short piece of code that is placed starting at address 0FA60h, so that when the 32 bytes of primary code are executed, the program continues with the secondary loop. The approach is described in more detail below.
The 32 bytes downloaded are, in hexadecimal,
E6 F0 60 FA
9A B7 FE 70
A4 00 B2 FE
7E B7
B4 00 B0 FE
86 F0 BB FC
3D F6
CC00 CC 00 CC 00 CC 00
which correspond to the following short code.
; origin is 0FA40h
mov | R0, #0fa60h |
W0: |
|
jnb | S0RIR, W0 |
movb | [R0], S0RBUF |
bclr | S0RIR |
movb | S0TBUF, [R0] |
cmpi1 | R0, #0fcbb ; read 604 bytes |
jmpr | cc_NE, W0 |
nop |
|
nop |
|
nop |
|
nop |
|