Specifications
Developer’s Serial Bootloader, Rev. 13
MCU slave software
Freescale Semiconductor48
;*******************************************************************************************
SCIRX:
BRRXDLO SCIRX ; loop until RXD high (idle)
SCIRXNOEDGE:
PSHH
PSHX
BCLR 7,TSC ; and clear TOF
LDX ONEBIT
LDA ONEBIT+1
LSRX
RORA
STX TMODH
STA TMODL
BSET 4,TSC ; clear timer
SCIRX1:
BRRXDHI SCIRX1 ; loop until RXD low (wait for start bit)
BCLR 5,TSC ; run timer
MOV #9,BITS ; number of bits + 1
SCIRX2: BRCLR 7,TSC,SCIRX2 ; wait for TOF
LSRA ; shift data right (highest bit cleared)
BRRXDLO RXDLOW ; skip if RXD low
ORA #$80 ; set highest bit if RXD high
RXDLOW: LDHX ONEBIT
STHX TMOD
BCLR 7,TSC ; and clear TOF
DBNZ BITS,SCIRX2 ; and loop for next bit
BRA EPILOG
Figure 31. Software-SCI receive char routine source code
8.2.3 Macros
Several macros are defined across the two code listings. They improve the readability and memory
consumption (Figure 32). The following figure represents the source code of software-SCI macros:










