AN2502 Freescale Semiconductor / Motorola, AN2502 Datasheet - Page 17

no-image

AN2502

Manufacturer Part Number
AN2502
Description
Using Two Channels of the HC08 TIM to Achieve a Full-Duplex Software SCI
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
Baud Rates
MOTOROLA
Using Two Channels of the HC08 TIM to Achieve a Full-Duplex Software SCI
As soon as the full data is transmitted (including start bit, data bits, either no or
one parity bit, and either one or two stop bits), an end of transmission
subroutine is fetched if enabled
The following code listing shows the name of the subroutine to be fetched after
a transmission is completed.
**********************************************************************
* Program Goes here after a transmission if TIEN = 1 in the rSCCR
**********************************************************************
SCITXEMPTY:
; ENTER YOUR SCITXEMPTY CODE HERE
The user must be aware that any code executed in this subroutine will affect
MCU performance because the code will be executed in the interrupt service
routine.
The baud rate is determined by the frequency of the timer module. The
BITHI:BITLO is 1 bit-time, and the BIT1HI:BIT1LO is 1.3 bit-times.
BITHI:BITLO = (TIM Freq.) ÷ (Baud Rate) BIT1HI:BIT1LO = (BITHI:BITLO) ×
1.3 – pin check latency. The pin check latency is the number of cycles from the
beginning of the reception interrupt service routine to the instruction that
checks the state of the pin. From the following code listing of normal mode, the
number of cycles of the interrupt entrance and the instructions are shown.
GetByte:
RX_isr:
rxinprog:
Freescale Semiconductor, Inc.
For More Information On This Product,
Table 8. Transmission Completed Subroutine Enable Bit
BRCLR
RTI
PSHH
BCLR
BRSET
CLC
BRCLR
Go to: www.freescale.com
SCR,rSCSR
TIEN
CH0F,TSC0
RPF,rSCSR,rxinprog ;[5]
RPIN,PTD,nocarry
1
0
:
:
:
:
:
:
(TIEN
Subroutine disabled
Subroutine enabled
Configuration
= 1) in rSCCR.
;[.r...]
;[9 due to interrupt entry]
;[2]
;[4]
;[1]
;[.r...]
AN2502/D
Modes
17
*

Related parts for AN2502