AN2502 Freescale Semiconductor / Motorola, AN2502 Datasheet - Page 50

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
AN2502/D
nocarry:
; Program goes here if receiving data bits
notogPTY:
nextRXtime:
50
BRCLR RPIN,PTD,nocarry
SEC
TPA
PSHA
LDA
AND
CBEQA #%00001000,ptyrec
CBEQA #%00000100,sb1rec
CBEQA #%00001100,sb2rec
BCC
LDA
EOR
STA
PULA
TAP
ROR
ROR
BCC
BCLR
BSET
BCLR
LDHX
Using Two Channels of the HC08 TIM to Achieve a Full-Duplex Software SCI
rSCSR2
#%00001100
notogPTY
rSCSR2
#$01
rSCSR2
rSCRSRH
rSCRSRL
nextRXtime
FE,rSCSR1
PTYRX,rSCSR2
STBRX,rSCSR2
TCH0H
Freescale Semiconductor, Inc.
For More Information On This Product,
; 8........ [2 CYCLES from instruction
;
; PIN CHECK LATENCY IS:
; 3 + 9 + 4 + 5 + 2 + 5 + 1 + 2 = 31
; Cycles of pin check latency
; Copy pin state into carry. The pin
; check latency is measured from the
; beginning of the interrupt to this
; instruction
; Some operations are going to be done
; with the accumulator for fast
; execution, thus the CCR register is
; pushed onto the stack
; The software branches depending on
; PTYRX and STBRX status flags. These
; flags indicate the state in which the
; program is in.
; Branch if receiving parity
; This bit is received to check the
; parity error condition
; Branch if receiving 1st SB
; Both stop bits are received to check
; the overrun error condition
; Branch if receiving 2nd SB
; Toggle temporal Rx Parity if
; the received bit is a logic '1'
; Store new temp Rx parity RPTY flag
; Pop flags. Rotate reception shift
; register with carry. Carry has the
; logic value of the received bit
; With carry set or cleared, rotate
; memory if carry set after rotation
; means that next Rx bit is the Pty
; Init Framing error flag
; Indicate next reception is the
; parity bit
; Load current channel value
Go to: www.freescale.com
fetch to the pin reading]
MOTOROLA

Related parts for AN2502