Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
mikrocont / MC68HC705C8A.pdf
Источник:
Скачиваний:
59
Добавлен:
06.01.2022
Размер:
2.49 Mб
Скачать

Technical Data — MC68HC705C8A

Section 11. Serial Peripheral Interface (SPI)

11.1 Contents

11.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .139

11.3 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .140

11.4 Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .142

11.4.1 Pin Functions in Master Mode . . . . . . . . . . . . . . . . . . . . . .143

11.4.2 Pin Functions in Slave Mode . . . . . . . . . . . . . . . . . . . . . . .144

11.5 Multiple-SPI Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .145

11.6 Serial Clock Polarity and Phase . . . . . . . . . . . . . . . . . . . . . . .146

11.7 SPI Error Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .147

11.7.1 Mode Fault Error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .147

11.7.2 Write Collision Error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .147

11.7.3 Overrun Error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .148

11.8 SPI Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .148

11.9 SPI I/O Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .148

11.9.1 SPI Data Register. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .149

11.9.2 SPI Control Register. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .149

11.9.3 SPI Status Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .151

11.2 Introduction

The serial peripheral interface (SPI) module allows full-duplex, synchronous, serial communication with peripheral devices.

MC68HC705C8A —

Rev. 3

Technical Data

 

 

 

MOTOROLA

Serial Peripheral Interface (SPI)

139

Serial Peripheral Interface (SPI)

11.3 Features

Features of the SPI include:

Full-duplex operation

Master and slave modes

Four programmable master mode frequencies (1.05 MHz maximum)

2.1-MHz maximum slave mode frequency

Serial clock with programmable polarity and phase

End of transmission interrupt flag

Write collision error flag

Bus contention error flag

Figure 11-1 shows the structure of the SPI module. Figure 11-2 is a summary of the SPI input/output (I/O) registers.

Technical Data

 

MC68HC705C8A — Rev. 3

 

 

 

140

Serial Peripheral Interface (SPI)

MOTOROLA

Serial Peripheral Interface (SPI)

Features

 

 

INTERNAL

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

S

 

PD2/

 

 

CLOCK

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

M

 

MISO

 

 

(XTAL 2)

 

 

SPI SHIFT REGISTER

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

M

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

7

6

5

4

3

2

1

0

 

 

 

 

 

 

S

 

PD3/

 

 

DIVIDER

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

LOGIC

MOSI

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

2

4

6

32

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

CONTROL

 

 

 

 

 

 

 

SPDR ($000C)

 

 

 

 

 

 

SHIFT

 

PD4/

 

 

 

 

 

 

 

 

 

 

 

 

CLOCK

 

 

SCK

 

 

 

 

 

SPI CLOCK (MASTER)

 

 

 

 

 

 

 

 

 

 

 

 

 

PIN

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

SELECT

 

 

 

 

 

 

 

 

 

 

 

CLOCK

 

M

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

LOGIC

 

S

 

PD5/

 

 

SPR1

SPR0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

SS

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

MSTR

 

 

 

 

 

 

 

 

 

 

 

 

MSTR

 

 

 

 

 

SPI CONTROL

SPE

 

 

 

 

 

 

 

 

 

 

 

 

SPE

 

 

 

 

 

SPIE

 

 

 

 

 

 

 

 

 

 

 

 

DWOM

 

 

 

 

 

 

 

 

 

 

 

 

 

 

DWOM

 

 

 

 

 

 

SPIF

 

WCOL

MODF

 

 

 

 

 

 

 

 

SPIE

SPE

MSTR

CPHA

CPOL

SPR1

SPR0

 

 

 

 

SPSR ($000B)

 

 

 

 

 

 

 

 

 

SPCR ($000A)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

SPI INTERRUPT

 

INTERNAL

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

REQUEST

 

DATA BUS

 

 

 

 

 

 

 

 

 

 

 

 

Figure 11-1. SPI Block Diagram

MC68HC705C8A —

Rev. 3

Technical Data

 

 

 

MOTOROLA

Serial Peripheral Interface (SPI)

141

Соседние файлы в папке mikrocont