AN2502 Freescale Semiconductor / Motorola, AN2502 Datasheet - Page 44

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
storeinCH1:
SCIsend_end:
;**********************************************************************
;* This ISR is dedicated only for transmission. each transmitted bit
;* generate this interrupt, excluding the second stop bit when
;* configued.
;* Each transmission bit configures the polarity of output compare:
;* for example, if the next transmission bit is a logic '1', the
;* channel is configured as set on output compare after 1 bit time.
;* If the bit to be transmitted is a logic '1', the temporal parity is*
;* toggled,so at the end of the transmission if the temporal parity is*
;* 1 means that an odd number of logic '1' has been transmitted.
;* 0 means that an even number of logic '1' has been transmitted.
;**********************************************************************
TX_isr:
44
BRCLR SB,rSCCR,storeinCH1
TXA
ADD
TAX
PSHH
PULA
ADC
PSHA
PULH
STHX
LDA
AND
STA
MOV
RTS
PSHH
BCLR
BRSET TPF,rSCSR1,txinprog
BSET
LDHX
Using Two Channels of the HC08 TIM to Achieve a Full-Duplex Software SCI
#BITLO
#BITHI
TCH1H
rSCSR2
#$0D
rSCSR2
#$58,TSC1
CH1F,TSC1
TPF,rSCSR1
TCH1H
Freescale Semiconductor, Inc.
For More Information On This Product,
; if there is a 2 stop bit
; configuration, another bit time is
; added to the current calculation
; Add 1 more bit time
; for next compare
; to handle 2 stop bits
; Store the calculated time in the
; channel timer register to generate
; the output compare.
; Clear Transmitter Flags in rSCSR2
; to start a new transmission. This is
; done to reset the parity calculation
; config. channel 1 as OC
; with interrupt enabled
; Clear on Output compare to send the
; start bit
; Check if there's a transmission in
; progress
; Program goes here if no transmission
; is in progress
; Calculate the time for next bit to
; be transmitted. Start bit was already
; sent by the SCISend subroutine
Go to: www.freescale.com
*
*
*
*
*
*
*
*
MOTOROLA

Related parts for AN2502