Microcontrollers in Practice

Chapter 4: Using the Synchronous Serial Interface SPI

4.1 In this Chapter

This chapter contains a detailed description of the SPI of HC11 and AVR microcontrollers, with hardware and software applications examples.

4.2 General Description of the SPI

As mentioned in Chap. 3, in synchronous serial communication, both the transmitter and receiver use the same synchronization clock to transfer data. Therefore, the device that generates the transmission clock fully controls the moment and the speed of the transmission, and it is called the MASTER.

The HC11 and AVR families of microcontrollers include a synchronous serial interface, called the Serial Peripheral Interface (SPI), allowing operation either in MASTER mode or in SLAVE mode. The general block diagram of a SPI link is presented in Fig. 4.1.


Figure 4.1: General block diagram of a SPI link

Four shift registers are involved in this link. All work with the same shift clock, generated by the MASTER device. The transmission and reception processes occur simultaneously. Two data line are provided to this purpose: MOSI (MASTER Out SLAVE In) and MISO (MASTER In SLAVE Out).


Figure 4.2: General block diagram of the SPI

When the MASTER writes by software a byte into the transmitter's data register, eight clocks are automatically generated to the SCK line, and the bi-directional transmission begins. Whatever is found at this moment in the SLAVE's Tx Data Register is shifted into the MASTER's Rx Data Register.

When more than one SLAVE device is connected to the SPI bus, only one SLAVE may be enabled at a certain...

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: Bit Error Rate Testers
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.