Datasheet
Serial Peripheral Interface (SPI)
MC68HC812A4 Data Sheet, Rev. 7
192 Freescale Semiconductor
15.9 Interrupt Sources
15.10 General-Purpose I/O Ports
Port S shares its pins with the multiple serial interface (MSI). In all modes, port S pins PS7–PS0 are
available for either general-purpose I/O or for SCI and SPI functions. See Chapter 13 Multiple Serial
Interface (MSI).
15.11 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.
15.11.1 Equipment
For this exercise, use the M68HC812A4EVB emulation board.
15.11.2 Code Listing
NOTE
A comment line is delimited by a semicolon. If there is no code before
comment, a semicolon (;) must be placed in the first column to avoid
assembly errors.
INCLUDE 'EQUATES.ASM' ;Equates for all registers
; User Variables
; Bit Equates
; ----------------------------------------------------------------------
; MAIN PROGRAM
; ----------------------------------------------------------------------
ORG $7000 ; 16K On-Board RAM, User code data area,
; ; start main program at $7000
MAIN:
BSR INIT ; Subroutine to initialize SPI registers
BSR TRANSMIT ; Subroutine to start transmission
FINISH:
BRA FINIS ; Finished transmitting all DATA
Table 15-4. SPI Interrupt Sources
Interrupt
Source
Flag
Local
Enable
CCR
Mask
Vector
Address
Transmission complete SPIF
SPIE I bit $FFD8, $FFD9
Mode fault MODF
