AN2502 Freescale Semiconductor / Motorola, AN2502 Datasheet - Page 51

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
ptyrec:
sb1rec:
sb2rec:
MOTOROLA
TXA
ADD
TAX
PSHH
PULA
ADC
PSHA
PULH
STHX
MOV
PULH
RTI
BRCLR PEN,rSCCR,sb1rec
PULA
EOR
EOR
AND
BCLR
ORA
STA
BCLR
BSET
BRA
BRCLR SB,rSCCR,sb2rec
PULA
LSLA
EOR
AND
BCLR
ORA
STA
BSET
BSET
BRA
PULA
BRSET FE,rSCSR1,rxfinished
LSLA
EOR
Using Two Channels of the HC08 TIM to Achieve a Full-Duplex Software SCI
#BITLO
#BITHI
TCH0H
#$50,TSC0
rSCSR2
rSCCR
#$01
PE,rSCSR1
rSCSR1
rSCSR1
PTYRX,rSCSR2
STBRX,rSCSR2
nextRXtime
#$02
#$02
FE,rSCSR1
rSCSR1
rSCSR1
PTYRX,rSCSR2
STBRX,rSCSR2
nextRXtime
#$02
Freescale Semiconductor, Inc.
For More Information On This Product,
; Add 1 bit time
; Store new calculated time into
; channel registers
; config. channel 0 as output
; compare with int enabled
; Pin under port control.
; Return from interrupt
; If Parity disabled, branch
; to 1st SB reception
; Program goes here if the parity bit
; is being received. CCR is poped from
; stack and stored in the accumulator
; Calculate Parity Error
; (A.0 = 1)? -> PE=1
; ELSE -> PE=0
; Indicate next reception
; to be 1st Stop Bit
; Branch to calculate next output
; compare time
; Branch to 2nd Stop Bit reception if
; SB=0
; Pop CCR and store it in the acc.
; Calculate Framing Error
; flag
; (A.1 = 1)? -> FE=1
; ELSE -> FE=0
; Indicate that the next received bit
; is the second stop bit
; Calculate next output compare time
; If FE=1, rx done
; Calculate Framing Error
Go to: www.freescale.com
AN2502/D
Software
51

Related parts for AN2502