AN2502 Freescale Semiconductor / Motorola, AN2502 Datasheet - Page 32

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
rxinprog:
nocarry:
rxfinished:
32
PSHA
PULH
STHX
MOV
PULH
RTI
CLC
BRCLR
SEC
ROR
BCS
LDHX
TXA
ADD
TAX
PSHH
PULA
ADC
PSHA
PULH
STHX
MOV
PULH
RTI
BCLR
BSET
MOV
MOV
PULH
RTI
Using Two Channels of the HC08 TIM to Achieve a Full-Duplex Software SCI
TCH0H
#$50,TSC0 ; config. channel 0 as output
RPIN,PTD,nocarry
rSCRSR
rxfinished
TCH0H
#BITLO
#BITHI
TCH0H
#$50,TSC0 ; config. channel 0 as OC with
RPF,rSCSR ; Clear reception in progress flag
SCRF,rSCSR
rSCRSR,rSCRDR
#$48,TSC0 ; IC, Falling edge, with ints. enabled
Freescale Semiconductor, Inc.
For More Information On This Product,
; compare with int enabled
; Pin under port control to use the
; output compare function just as a
; timing interrupt.
; 6........ [1 CYCLES]
; program goes here if there is a
; reception in progress. The carry
; flag is cleared.
; 7........ [2 CYCLES from instruction
;
; PIN CHECK LATENCY IS:
; 3 + 9 + 2 + 4 + 5 + 1 + 2 = 26 Cycles
; of pin check latency
; Copy pin state into carry flag
; Rotate memory to save the received
; bit into the receive shift register.
; If carry=1 after rotation, means
; that next Tx bit is the Stop Bit.
; Program goes here if there are still
; bits to receive.
; Add 1 bit time
; interrupts. Pin under port control
; In this version of the SCI, the
; stop bit is not checked, since
; there is no error detection.
; Indicate that there's a valid data
; on SCIDatarx
Go to: www.freescale.com
fetch to the pin reading]
MOTOROLA

Related parts for AN2502