M68HC12A4EVB Freescale Semiconductor, M68HC12A4EVB Datasheet - Page 211

no-image

M68HC12A4EVB

Manufacturer Part Number
M68HC12A4EVB
Description
Manufacturer
Freescale Semiconductor
Datasheet

Specifications of M68HC12A4EVB

Lead Free Status / Rohs Status
Not Compliant
; ----------------------------------------------------------------------
;
; ----------------------------------------------------------------------
TRANS: BRCLR
; ----------------------------------------------------------------------
;
; ----------------------------------------------------------------------
DATA:
EOT:
14.6 Synchronous Character Transmission using the SPI
This program is intended to communicate with the HC11 on the UDLP1 board. It utilizes the SPI to
transmit synchronously characters in a string to be displayed on the LCD display. The program must
configure the SPI as a master, and non-interrupt driven. The slave peripheral is chip-selected with the SS
line at low voltage level. Between 8 bit transfers the SS line is held high. Also the clock idles low and
takes data on the rising clock edges. The serial clock is set not to exceed 100 kHz baud rate.
14.6.1 Equipment
For this exercise, use the M68HC912B32EVB emulation board.
14.6.2 Code Listing
Freescale Semiconductor
TABLE : DATA TO BE TRANSMITTED
MOVB
LDAA
STD
LDX
RTS
MOVB
CPX
BNE
RTS
DC.B
DC.B
DC.B
DC.B
DC.B
END
TRANSMIT SUBROUTINE
A comment line is deliminted by a semi-colon. If there is no code before
comment, an “;” must be placed in the first column to avoid assembly
errors.
#$08,SC1CR2
SC1SR1
SC1DRH
#DATA
SC1SR1,#$80, TRANS ; Wait for TDRE flag
1,X+,SC1DRL
#EOT
TRANS
'Freescale HC12 Banner - June, 1999'
$0D,$0A
'Scottsdale, Arizona'
$0D,$0A
$04
M68HC12B Family Data Sheet, Rev. 9.1
; Set for No Ints, and Transmitter enabled(SC1CR2)
; 1st step to clear TDRE flag: Read SC1SR1
; 2nd step to clear TDRE flag: Write SC1DR register
; Use X as a pointer to DATA.
; Return from subroutine
; Transmit character, increment X pointer
; Detect if last character has been transmitted
; If last char. not equal to "eot", Branch to TRANS
; else Transmission complete, Return from Subroutine
; Return (cr) ,Line Feed (LF)
; Return (cr) ,Line Feed (LF)
; Byte used to test end of data = EOT
; End of program
NOTE
Synchronous Character Transmission using the SPI
211