Listing 3. MC68HC711E9 Bootloader ROM
M68HC11 Bootstrap Mode, Rev. 1.1
Freescale Semiconductor
225
162 BF62 E72D
STAB
SCCR2,X
Rx and Tx Enabled
163 BF64 CC021B
LDD
#DELAYF
Delay for fast baud rate
164 BF67 ED16
STD
TOC1,X
Set as default delay
165
166
* Send BREAK to signal ready for download
167 BF69 1C2D01
BSET
SCCR2,X $01
Set send break bit
168 BF6C 1E0801FC
BRSET
PORTD,X $01 *
Wait for RxD pin to go low
169 BF70 1D2D01
BCLR
SCCR2,X $01
Clear send break bit
170 BF73
171 BF73 1F2E20FC
BRCLR
SCSR,X $20 *
Wait for RDRF
172 BF77 A62F
LDAA
SCDAT,X
Read data
173
* Data will be $00 if BREAK OR $00 received
174 BF79 2603
BNE
NOTZERO
Bypass JMP if not 0
175 BF7B 7EB600
JMP
EEPMSTR
Jump to EEPROM if it was 0
176 BF7E
NOTZERO
EQU
*
177 BF7E 81FF
CMPA
#$FF
$FF will be seen as $FF
178 BF80 2708
BEQ
BAUDOK
If baud was correct
179
* Or else change to ÷104 (÷13 & ÷8) 1200 @ 2MHZ
180 BF82 1C2B33
BSET
BAUD,X $33
Works because $22 -> $33
181 BF85 CC0DB0
LDD
#DELAYS
And switch to slower...
182 BF88 ED16
STD
TOC1,X
delay constant
183 BF8A
BAUDOK
EQU
*
184 BF8A 18CE0000
LDY
#RAMSTR
Point at start of RAM
185
186 BF8E
WAIT
EQU
*
187 BF8E EC16
LDD
TOC1,X
Move delay constant to D
188 BF90
WTLOOP
EQU
*
189 BF90 1E2E2007
BRSET
SCSR,X $20 NEWONE
Exit loop if RDRF set
190 BF94 8F
XGDX
Swap delay count to X
191 BF95 09
DEX
Decrement count
192 BF96 8F
XGDX
Swap back to D
193 BF97 26F7
BNE
WTLOOP
Loop if not timed out
194 BF99 200F
BRA
STAR
Quit download on timeout
195
196 BF9B
NEWONE
EQU
*
197 BF9B A62F
LDAA
SCDAT,X
Get received data
198 BF9D 18A700
STAA
$00,Y
Store to next RAM location
199 BFA0 A72F
STAA
SCDAT,X
Transmit it for handshake
200 BFA2 1808
INY
Point at next RAM location
201 BFA4 188C0200
CPY
#RAMEND+1
See if past end
202 BFA8 26E4
BNE
WAIT
If not, Get another
203
204 BFAA
STAR
EQU
*
205 BFAA CE1068
LDX
#PROGDEL
Init X with programming delay
206 BFAD 18CED000
LDY
#EPRMSTR
Init Y with EPROM start addr
207 BFB1 7E0000
JMP
RAMSTR
** EXIT to start of RAM **
208 BFB4
209
****************************************************
210
* Block fill unused bytes with zeros
211
212 BFB4 000000000000
BSZ
$BFD1-*
000000000000
0000000000