Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
34
Добавлен:
27.04.2015
Размер:
1.98 Mб
Скачать

Serial Peripheral Interface

7.2.1.6 Master Mode Select (MST)—Bit 4

The Master mode select (MST) control bit is used to select Master or Slave mode. The MST bit is cleared on hardware reset. Table 7-3 shows how this mode is set.

Table 7-3. SPI Mode Programming

MST

SPI Mode

 

 

 

 

0

Slave

 

 

1

Master

 

 

7.2.1.7 Clock Polarity (CPL)—Bit 3

The clock polarity (CPL) control bit is used to define the polarity of the serial bit clock. When data is not being transferred and this bit is cleared, the SCK pin of the master device idles as a logic low. When the CPL bit is set, the SCK pin idles as a logic high. The CPL bit is cleared on hardware reset.

7.2.1.8 Clock Phase (CPH)—Bit 2

The clock phase (CPH) control bit is used in conjunction with the CPL bit to control the clock-data relationship between the master and slave. This bit selects one of two different clocking protocols. The CPH bit is cleared on hardware reset.

7.2.2 SPI Status Register (SPSR0 and SPSR1)

The SPI status registers (SPSR0 and SPSR1) are 16-bit read-only registers used to indicate the status of the SPI0 and SPI1 peripherals, respectively. The bits within these registers are arranged and interpreted identically. The only differences are that the two registers have different addresses and represent the status of different SPIs. The value of one register is not affected by the value of the other register. The bits of these registers are defined in Section 7.2.2.1, “Reserved Bits—Bits 15–8,” through Section 7.2.2.6, “Reserved Bits—Bits 3–0.”

7.2.2.1 Reserved Bits—Bits 15–8

Bits 15–8 of SPSR0 and SPSR1 are reserved and are read as zero during read operations. These bits should be written with zero to ensure future compatibility.

7.2.2.2 SPI Interrupt Complete Flag (SPIF)—Bit 7

The SPI interrupt complete flag (SPIF) bit is set upon completion of data transfer between the processor and the external device. If the SPIF bit goes high and the SPIE bit is set, an interrupt is generated. To clear the SPIF bit, read the SPSR with the SPIF bit set, then access the SPDR. Unless the SPSR is read first (with the SPIF bit set), attempts to write to the SPDR are not permitted. The SPIF bit is cleared on hardware reset.

7-8

DSP56824 User’s Manual

 

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