IDT Serial Peripheral Interface
SPI Setup
79RC32438 User Reference Manual
16 - 7
November 4, 2002
Notes
SPI Setup
The following describes the typical setup of the SPI interface which occurs during boot time:
1. As the SPI interface shares data and clock pins with the PCI EEPROM, the SPI module must first
poll the PCI EEPROM EED bit in the PCI Status register of the PCI Controller to determine if the
PCI module has finished loading data from the PCI EEPROM. The RC32438 device automatically
switches the functionality of the pins for use as an SPI interface when the loading of configuration
data from the PCI EEPROM is completed.
2. As the SPI signal functions are routed via the PIO Controller, the PIO Controller will generally be
initialized to the Effect Mode and establish the correct direction for each SPI pin. At reset time, the
default Effect Mode and Direction are set up for the PCI EEPROM and also for the SPI.
3. The SPI Clock Prescalar Register, SPCP, is programmed.
4. The SPI Control Register (SPC), including the SPE Enable Bit, is programmed.
5. The data being sent to the SPI Slave is written into the SPI Data Register (SPD).
6. The SPI Controller will initiate the hardware protocol on the SPI pins. The RC32438 device will
receive data from the Slave at the same time it is sending data to the Slave.
7. System either with:
–
Wait for an SPI Interrupt. After receiving an SPI Interrupt via the Interrupt Controller, the SPI
Status Register SPIF and MODF Flags can be read.
–
Poll the SPI Status Register SPIF and MODF Flags.
8. If the SPIF Flag is set, indicating the transaction is complete, reading the SPI Status Register resets
the SPIF Flag.
9. Read the data from the SPI Data Register.
10. Repeat Steps 5 through 10, as needed.
Serial Bit I/O Pins
The serial I/O signals SCK, SDO, SDI, and PCIGNTN[1] may be used as bit I/O ports that operate in
basically the same way as GPIO pins. For additional information on the GPIO pins, refer to Chapter 12,
General Purpose I/O Controller.
The PCI serial EEPROM may be read to and written from when loading to the PCI Configuration regis-
ters has completed. This is achieved by disabling the SPI interface and synthesizing (via software)
MICROWIRE transactions on the serial I/O pins.
When the PCI interface operates in PCI satellite mode, the state of the PCIGNTN pin may be controlled
by writing the desired pin state value into the Serial I/O Data (SIOD) register.
Serial I/O Function Register
Figure 16.7 Serial I/O Function Register (SIOFUNC)
SDO
Description:
Serial Data Output.
When this bit is set to one, the SDO pin operates as a bit I/O port regardless
of the state of the SPI or PCI interfaces.
Initial Value:
0x0
SIOFUNC
0
31
0
28
SDO
1
SDI
1
SCK
1
PCI
1