AN2295 Freescale Semiconductor / Motorola, AN2295 Datasheet - Page 31

no-image

AN2295

Manufacturer Part Number
AN2295
Description
Developers Serial Bootloader for M68HC08 and HCS08 MCUs
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
Software-SCI Transmit Char Routine
A detailed description of the software-SCI transmit and receive subroutines is provided in this section.
They both are based on a 16-bit timer, and the output-compare event is polled in the background loop.
The source code for the two routines is shown in
variable is used. It contains the actual length of 1 bit at the current communication speed in 16-bit timer
clock cycles. This variable is initialized during the calibration phase (see
Freescale Semiconductor
INITIALIZE, FEED AND
SET BIT COUNTER
RUN 16-BIT TIMER
TXD PIN LOW
ENTER
TO 9
Developer’s Serial Bootloader for M68HC08 and HCS08 MCUs, Rev. 6
CHAR INTO CARRY FLAG
SHIFT-OUT TRANSMIT
Figure 20. Soft-SCI Transmit Char Routine
CLEAR TIMER FLAG
BITS AND TEST
TEST CARRY
TXD PIN LOW
DECREMENT
TIMER FLAG
TIMER FLAG
RECEIVED?
WAIT FOR
CLEAR
YES
= 0
SET
NO
≠ 0
Figure
TXD PIN HIGH
21. Other than a few counters, a 16-bit ONEBIT
Slave Frequency
CLEAR TIMER FLAG
TXD PIN HIGH
STOP TIMER
TIMER FLAG
TIMER FLAG
RECEIVED?
WAIT FOR
MCU Slave Software
EXIT
YES
Calibration).
NO
31

Related parts for AN2295