AN2502 Freescale Semiconductor / Motorola, AN2502 Datasheet - Page 43

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
; rSCTSRH = #%00000001
;
; rSCTSRL = #%databits
_07BIT:
_09BIT:
conf_OC:
MOTOROLA
STHX
LDA
AND
CBEQA #$02,_07BIT ; If the user selected 8 data bits
CBEQA #$10,_09BIT ; If the user selected 9 data bits
MOV
BRA
CLR
BSET
BRA
LDA
AND
ORA
STA
BCLR
BSET
LDHX
TXA
ADD
TAX
PSHH
PULA
ADC
PSHA
PULH
Using Two Channels of the HC08 TIM to Achieve a Full-Duplex Software SCI
rSCTSRH
rSCCR
#$12
#$01,rSCTSRH
conf_OC
rSCTSRH
7,rSCTSRL
conf_OC
rSCTSRH
#$01
#$02
rSCTSRH
CH1F,TSC1
SCTE,rSCSR1 ; Set transmitter empty flag,
TCNTH
#BITLO
#BITHI
\______ Will indicate end of Tx
Freescale Semiconductor, Inc.
For More Information On This Product,
; the transmission shift register
; Mask the configuration flags in
; the accumulator
; Check M & PEN configuration bits to
; see the data length
; with parity bit, the final number
; of data bits is 7
; with no parity, the final number of
; of bits is 9
; If the user selected 9 data bits
; with parity, the final number of
; data bits is 8
; 08 BIT SELECTION
; 07 BIT SELECTION
; This bit is set to indicate the end
; of data bits reception to the ISR.
; This bit position depends on the
; data bits length
; 09 BIT SELECTION
; Set bit to indicate end of data
; bits reception
; Clear Channel Flag
; indicating that a new data to be
; transmitted can be queued.
; Read current count
; Add 1 bit time for next compare
; to send start bit
Go to: www.freescale.com
AN2502/D
Software
43

Related parts for AN2502