XC912BC32CFU8 Motorola Semiconductor Products, XC912BC32CFU8 Datasheet - Page 226

no-image

XC912BC32CFU8

Manufacturer Part Number
XC912BC32CFU8
Description
M68HC12B Family Data Sheet
Manufacturer
Motorola Semiconductor Products
Datasheet
Serial Interface
; ----------------------------------------------------------------------
;*
; ----------------------------------------------------------------------
INIT:
;
;
;
; ----------------------------------------------------------------------
;*
; ----------------------------------------------------------------------
TRANSMIT:
;
;
FLAG:
DONE:
; ----------------------------------------------------------------------
;
; ----------------------------------------------------------------------
DATA:
EOT:
Data Sheet
226
TABLE OF DATA TO BE TRANSMITTED
BSET
MOVB
MOVB
MOVB
MOVB
LDX
LDAA
LDAA
BSET
RTS
LDAA
BEQ
BCLR
STAA
BRCLR
BSET
BRA
RTS
DC.B
DC.B
DC.B
END
TRANSMIT SUBROUTINE
SUBROUTINE INIT:
PORTS,#$80
#$E0,DDRS
#$07,SP0BR
#$12,SP0CR1
#$08,SP0CR2
#DATA
SP0SR
SP0DR
SP0CR1,#$40
1,X+
DONE
PORTS,#$80
SP0DR
SP0SR,#$80,FLAG
PORTS,#$80
TRANSMIT
'Motorola'
$0D,$0A
$00
; SET SS Line High to prevent glitch
; Configure PORT S input/ouput levels
; MOSI, SCK, SS* = ouput, MISO=Input
; Select serial clock baud rate < 100 KHz
; Configure SPI(SP0CR1): No SPI interrupts,
; MSTR=1, CPOL=0, CPHA=0
; Config. PORTS output drivers to operate normally,
; and with active pull-up devices.
; Use X register as pointer to first character
; 1st step to clear SPIF Flag, Read SP0SR
; 2nd step to clear SPIF Flag, Access SP0DR
; Enable the SPI (SPE=1)
; Return from subroutine
; Load Acc. with "NEW" character to send, Inc X
; Detect if last character(0) has been transmitted
; If last char. branch to DONE, else
; Assert SS Line to start X-misssion.
; Load Data into Data Reg.,X-mit.
; it is also the 2nd step to clear SPIF flag.
;Wait for flag.
; Disassert SS Line.
; Continue sending characters, Branch to TRANSMIT.
; Return from subroutine
; Return (cr) ,Line Feed (LF)
; Byte used to test end of data = EOT
; End of program
Serial Interface
M68HC12B Family — Rev. 8.0
MOTOROLA

Related parts for XC912BC32CFU8