AN2502 Freescale Semiconductor / Motorola, AN2502 Datasheet - Page 45

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
oc_highorlow:
oc_high:
txinprog:
nextbittime:
MOTOROLA
TXA
ADD
TAX
PSHH
PULA
ADC
PSHA
PULH
STHX
CLC
ROR
ROR
BCS
MOV
PULH
RTI
LDA
EOR
STA
MOV
PULH
RTI
BRSET PTYTX,rSCSR2,sendingPTY
BRSET STBTX,rSCSR2,sendingSTB
CLC
ROR
ROR
TPA
LDHX
CPHX
BEQ
PSHA
LDHX
TXA
ADD
Using Two Channels of the HC08 TIM to Achieve a Full-Duplex Software SCI
#BITLO
#BITHI
TCH1H
rSCTSRH
rSCTSRL
oc_high
#$58,TSC1
rSCSR2
#$02
rSCSR2
#$5C,TSC1
rSCTSRH
rSCTSRL
rSCTSRH
#$0000
txfinished
TCH1H
#BITLO
Freescale Semiconductor, Inc.
For More Information On This Product,
; Set time for next OC
; after 1 bit time
; Store the calculated time in the
; channel register for next output
; compare
; Copy next transmission
; bit into carry flag using the two
; shift registers
; If carry cleared, configure the
; channel as clear output on next
; compare
; return from interrupt
; Program goes here if the bit to be
; transmitted is a logic "1", and the
; parity is recalculated in the
; transmit temporal parity bit TPTY
; If carry set, configure channel as
; set output on next compare
; return from interrupt
; Check if sending parity
; Check if sending stop bits
; transmitting data bits
; Copy CCR into A
; If transmit data register
; zero, data transmission
; is done
; Exit from interrupt
; send next bit depending on carry
; Add 1 bit time for next output
; compare
Go to: www.freescale.com
AN2502/D
Software
45

Related parts for AN2502