Скачиваний:
34
Добавлен:
27.04.2015
Размер:
4.9 Mб
Скачать

Resets

10.12 Resets

Any system reset completely resets the SPI. Partial resets occur whenever the SPI enable bit (SPE) is low. Whenever SPE is low, the following will occur:

The SPTE flag is set.

Any slave mode transmission currently in progress is aborted.

Any master mode transmission currently in progress is continued to completion.

The SPI state counter is cleared, making it ready for a new complete transmission.

All the SPI port logic is disabled.

The following items are reset only by a system reset:

The SPDTR and SPDRR Registers

All control bits in the SPSCR Register (MODFEN, ERRIE, SPR1, and SPR0)

The status flags SPRF, OVRF, and MODF

By not resetting the control bits when SPE is low, it is possible to clear SPE between transmissions without having to set all control bits again when SPE is set back high for the next transmission.

By not resetting the SPRF, OVRF, and MODF flags, it is possible to service the interrupts after the SPI has been disabled. Disable SPI by writing 0 to the SPE bit. SPI can also be disabled by a Mode Fault occurring in a SPI configured as a master with MODF.

10.13 Interrupts

Four SPI status flags can be enabled to generate interrupt requests.

Table 10-6. SPI Interrupts

Flag

Request

 

 

 

 

 

SPTE (Transmitter Empty)

SPI Transmitter Interrupt Request (SPTIE = 1,SPE = 1)

SPRF (Receiver Full)

SPI Receiver Interrupt Request (SPRIE = 1)

 

 

OVRF (Overflow)

SPI Receiver/Error Interrupt Request (ERRIE = 1)

 

 

MODF (Mode Fault)

SPI Receiver/Error Interrupt Request (ERRIE = 1)

 

 

 

The following sources in the SPI Status and Control Register can generate interrupt requests:

The SPI Transmitter Interrupt Enable (SPTIE) bit enables the SPTE flag to generate transmitter interrupt requests provided the SPI is enabled (SPE = 1). The clearing mechanism for the SPTE flag is always just a write to the transmit data register.

 

56852 Digital Signal Controller User Manual, Rev. 4

10-28

Freescale Semiconductor

-packaged product lines and part numbers indicated here currently are not

2010: MC13892

Commission, BGA

prior to September

order from the United States International Trade Freescale for import or sale in the United States

of an from

Because

available

Interrupts

The SPI Receiver Interrupt Enable (SPRIE) bit enables the SPRF bit to generate receiver interrupt requests regardless of the state of the SPE bit. The clearing mechanism for the SPRF flag is always just a read to the Receive Data Register.

The Error Interrupt Enable (ERRIE) bit enables both the MODF and OVRF bits to generate a receiver/error controller interrupt request.

The Mode Fault Enable (MODFEN) bit can prevent the MODF flag from being set so only the OVRF bit is enabled by the ERRIE bit to generate receiver/error controller interrupt requests.

SPTE

 

 

 

SPI Transmitter

 

 

 

 

 

 

 

 

 

SPTIE

 

 

 

 

 

 

Interrupt Request

 

 

 

 

 

 

 

SPE

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

SPRIE

SPRF SPI Receiver/Error

Interrupt Request

ERRIE

MODF

OVRF

Figure 10-17. SPI Interrupt Request Generation

The following sources in the SPI Status and Control Register can generate interrupt requests:

SPI Receiver Full (SPRF) — The SPRF bit becomes set every time a full data transmission transfers from the Shift Register to the Receive Data Register. If the SPI Receiver Interrupt Enable (SPRIE) bit is also set, SPRF can generate a SPI receiver/error interrupt request.

SPI Transmitter Empty (SPTE) — The SPTE bit becomes set every time a full data transmission transfers from the Transmit Data Register to the Shift Register. If the SPI Transmit Interrupt Enable (SPTIE) bit is also set, SPTE can generate a SPTE interrupt request.

 

Serial Peripheral Interface (SPI), Rev. 4

Freescale Semiconductor

10-29

-packaged product lines and part numbers indicated here currently are not

2010: MC13892

Commission, BGA

prior to September

order from the United States International Trade Freescale for import or sale in the United States

of an from

Because

available

Interrupts

-packaged product lines and part numbers indicated here currently are not

2010: MC13892

Commission, BGA

prior to September

order from the United States International Trade Freescale for import or sale in the United States

of an from

Because

available

 

56852 Digital Signal Controller User Manual, Rev. 4

10-30

Freescale Semiconductor

Chapter 11

Improved Synchronous Serial Interface

(ISSI)

 

Improved Synchronous Serial Interface (ISSI), Rev. 4

Freescale Semiconductor

11-1

-packaged product lines and part numbers indicated here currently are not

2010: MC13892

Commission, BGA

prior to September

order from the United States International Trade Freescale for import or sale in the United States

of an from

Because

available

 

-packaged product lines and part numbers indicated here currently are not

2010: MC13892

 

 

Commission, BGA

prior to September

 

order from the United States International Trade Freescale for import or sale in the United States

 

of an from

 

Because

available

 

56852 Digital Signal Controller User Manual, Rev. 4

11-2

Freescale Semiconductor

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