AN2502 Freescale Semiconductor / Motorola, AN2502 Datasheet - Page 47

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
; Set the bit at the left of the MSB depending
; on the Character Length Selection and Parity Enable bit (M & PEN)
; to know the end of the transmission.
; For example for 8 data bits and no parity enabled:
; rSCTSRH = #%00000001
;
; rSCTSRL = #%databits
__07BIT:
__09BIT:
_conf_OC:
_storeinCH1:
MOTOROLA
CBEQA #$02,__07BIT
CBEQA #$10,__09BIT
MOV
BRA
CLR
BSET
BRA
LDA
AND
ORA
STA
BCLR
BSET
LDHX
TXA
ADD
TAX
PSHH
PULA
ADC
PSHA
PULH
BRCLR SB,rSCCR,_storeinCH1
TXA
ADD
TAX
PSHH
PULA
ADC
PSHA
PULH
STHX
LDA
AND
STA
MOV
Using Two Channels of the HC08 TIM to Achieve a Full-Duplex Software SCI
#$01,rSCTSRH
_conf_OC
rSCTSRH
7,rSCTSRL
_conf_OC
rSCTSRH
#$01
#$02
rSCTSRH
CH1F,TSC1
SCTE,rSCSR1 ; Set transmitter empty flag to allow
TCH1H
#BITLO
#BITHI
#BITLO
#BITHI
TCH1H
rSCSR2
#$0D
rSCSR2
#$58,TSC1
\______ Will indicate end of Tx
Freescale Semiconductor, Inc.
For More Information On This Product,
; 08 BIT SELECTION
; 07 BIT SELECTION
; 09 BIT SELECTION
; Clear Channel Flag
; another data to be queued
; Read current channel value
; Add 1 bit time for next compare
; Add 1 more bit time
; for next compare
; to handle 2 stop bits of the current
; data being sent
; Store calculated data into the
; channel register
; Reset Flags for next transmission
; Clear TX Flags in rSCSR2
; config. channel 1 as OC
Go to: www.freescale.com
AN2502/D
Software
47

Related parts for AN2502