AN2502 Freescale Semiconductor / Motorola, AN2502 Datasheet - Page 42

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
;**********************************************************************
;* PutByte subroutine is a friendly usage of the SCI Transmission
;* features, which provides Flags check and storage from the H:X
;* registers to the transmission register. User would modify this
;* subroutine if the byte to be sent is stored in another register or *
;* location.
;**********************************************************************
PutByte:
;**********************************************************************
;* Program Goes here after a transmission if TIEN = 1 in the rSCCR
;**********************************************************************
SCITXEMPTY:
; ENTER YOUR SCITXEMPTY CODE HERE
;**********************************************************************
;* Program Goes here after a Reception if RIEN = 1 in the rSCCR
;**********************************************************************
SCIRXFULL:
; ENTER YOUR SCIRXFULL CODE HERE
;**********************************************************************
;* SCIsend.
;* PutByte calls this subroutine.
;* If TEN = 0 (transmissions disabled) in the rSCCR this subroutine
;* returns with no modifications to the transmit channel.
;* if no transmission is in progress, this subroutine configures the
;* transmit channel and calculates the time to send the start bit.
;* The value stored in TCH1H:TCH1L represents a time dependent to the *
;* baud rate referenced as BITHI:BITLO.
;**********************************************************************
SCISend:
42
STHX
JSR
BRCLR
RTS
RTI
RTI
BRCLR TEN,rSCCR,SCIsend_end
BCLR
BRSET CH1IE,TSC1,SCIsend_end
LDHX
Using Two Channels of the HC08 TIM to Achieve a Full-Duplex Software SCI
SCTE,rSCSR1 ; Clear transmitter empty flag
rSCTDRH
rSCTDRH
SCISend
SCTE,rSCSR1,*
Freescale Semiconductor, Inc.
For More Information On This Product,
; Store the H:X registers content in the
; transmission shift register
; Start byte transmission
; Wait for the byte to be transferred
; to the transmission shift register
; Return from subroutine if TX is not
; enabled
; If transmission channel is active,
; the byte to be transmitter is queued
; and exits SCISend subroutine
; Store data to be transmitted from
; the transmission data register to
Go to: www.freescale.com
*
*
*
*
*
*
*
*
*
*
*
*
*
MOTOROLA

Related parts for AN2502