AN2502 Freescale Semiconductor / Motorola, AN2502 Datasheet - Page 49

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
; For each character length are set two bits:
; one will indicate the end of the reception
; and the other is going to be used to accommodate the
; data received.
; For example, for 9 bit selection in M:
; rSCRDRH:rSCRDRL -> 10000001 00000000
;
;
___07BIT:
___09BIT:
confCH0:
rxinprog:
MOTOROLA
STA
LDA
AND
CBEQA #$02,___07BIT
CBEQA #$10,___09BIT
LDHX
BRA
LDHX
BRA
LDHX
STHX
LDHX
TXA
ADD
TAX
PSHH
PULA
ADC
PSHA
PULH
STHX
MOV
PULH
RTI
CLC
Using Two Channels of the HC08 TIM to Achieve a Full-Duplex Software SCI
rSCSR2
rSCCR
#$12
#$8080
confCH0
#$8040
confCH0
#$8100
rSCRSRH
TCH0H
#BIT1LO
#BIT1HI
TCH0H
#$50,TSC0
\
\______________ Used to adjust Rx data
Freescale Semiconductor, Inc.
For More Information On This Product,
\________ Will indicate Rx done
; The number of data bits depends on
; the number of bits configured and
; the parity bit configuration:
; M=0 & PEN=0 -> 8 data bits. No Parity
; M=0 & PEN=1 -> 7 data bits. Parity
; M=1 & PEN=0 -> 9 data bits. No Parity
; M=1 & PEN=1 -> 8 data bits. Parity
; Check M & PEN configuration bits
; 08 BIT SELECTION
; 07 BIT SELECTION
; 09 BIT SELECTION
; Here is the time at which the start
; bit was received
; Add 1.3 bit time - 31 for next OC
; If no other interrupt is present on
; the user software, each data bit is
; going to be received in 30 % of the
; bit time
; config. channel 0 as output
; compare with int enabled
; Pin under port control. Each output
; compare interrupt will give the time
; to check the pin state, that is why
; the channel is configured as pin
; under port control
; Return from interrupt
; 7........ [1 CYCLES]
Go to: www.freescale.com
AN2502/D
Software
49

Related parts for AN2502