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

SPI Programming Model

NOTE:

The maximum frequency of the serial bit clock is limited to 10 MHz. This means that for a 70 MHz DSP56824, the SPR bits must be programmed so that the clocking frequency of the serial bit clock is less than or equal to 10 MHz. Thus, setting the SPR[2:0] bits to 000 (divide by 1) can be used only when the frequency of the Phi clock is less than or equal to 10 MHz. Likewise, SPR[2:0] = 001 can be used only when the Phi clock is less than or equal to 20 MHz, and SPR[2:0] = 010 requires a Phi clock frequency of less than or equal to 40 MHz. All other combinations (divide by 8 through divide by 128) can be used with any Phi clock frequency up to the maximum frequency of 70 MHz.

7.2.1.3 SPI Interrupt Enable (SPIE)—Bit 7

The SPI interrupt enable (SPIE) control bit is used to enable interrupts from the SPI port. When interrupts are disabled (the SPIE bit is cleared), any pending interrupt is cleared, and polling is used to sense the SPI interrupt complete flag (SPIF) and mode fault (MDF) bits. When interrupts are enabled (the SPIE bit is set), an SPI interrupt is requested if either the SPIF or the MDF bit is set. The SPIE bit is cleared on hardware reset.

As with all on-chip peripheral interrupts for the DSP56824, the status register (SR—bits I[1:0] = 01) must first be set to enable maskable interrupts (interrupts of level IPL 0). Next, the IPR must also be set to enable the interrupt. Table 7-2 lists the appropriate bits to set in the interrupt priority register (IPR) and the corresponding interrupt vector.

Table 7-2. SPI Interrupt

SPI Port (Register)

Bit in IPR

Interrupt Vector

Interrupt Priority

 

 

 

 

 

 

 

 

SPI0 (SPCR0)

Bit 13 (CH2)

$002A

0

 

 

 

 

SPI1 (SPCR1)

Bit 12 (CH3)

$0028

0

 

 

 

 

Table 3-6 on page 3-16 lists the interrupt priority order for the DSP56824. Finally, SPI interrupts are configured within the SPI itself, using the SPIE bit.

7.2.1.4 SPI Enable (SPE)—Bit 6

The SPI enable (SPE) control bit is used to enable the SPI port functionality. Clearing the SPE bit disables the SPI peripheral and the shuts off the Phi clock signal provided to the SPI port to reduce power consumption. The SPE bit is cleared on hardware reset.

7.2.1.5 Wired-OR Mode (WOM)—Bit 5

The Wired-OR mode (WOM) control bit is used to select the nature of the SPI pins. When enabled (the WOM bit is set), the SPI pins in Port C are configured as open-drain drivers with the P-channel pull-ups disabled. When disabled (the WOM bit is cleared), the SPI pins are configured as push-pull drivers. The WOM bit is cleared on hardware reset.

Serial Peripheral Interface

7-7

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