Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
8xC196EA microcontroller user's manual.1998.pdf
Скачиваний:
52
Добавлен:
23.08.2013
Размер:
8.29 Mб
Скачать

CHAPTER 9 SYNCHRONOUS SERIAL I/O (SSIO) PORT

This device has a synchronous serial I/O (SSIO) port that shares pins with port 10. The SSIO provides two unidirectional serial communication channels or one synchronous bidirectional communication channel. The SSIO is compatible with most protocols because the serial clock is completely configurable. Paired, the SSIO channels can operate in a channel-select mode, allowing for communication in multiple-master systems without additional external hardware. Each SSIO channel can also perform handshaking transfers, which along with the PTS, provides unidirectional, multi-byte transfers with no CPU overhead. This chapter describes the SSIO port and explains how to program it.

9.1SSIO PORT OVERVIEW

The SSIO port has three modes of operation: standard, duplex, and channel-select. For singleslave, single-master systems requiring only one SSIO channel or two independent SSIO channels, use the standard mode of operation. In standard mode, each channel has a unique serial clock and data signal. For single-slave, single-master systems requiring two SSIO channels, use the duplex mode of operation. In duplex mode, the channels have unique serial data signals, but share a common clock signal. For systems with multiple masters or multiple slaves, use the channel-select mode of operation. Like duplex mode, in channel-select mode, the channels have unique serial data signals, but share a common clock signal. Channel-select mode provides an additional chan- nel-select signal designed for communicating in systems with multiple masters or multiple slaves.

In addition to three operating modes, the SSIO port can perform two types of data transfers: normal and handshaking. All modes support normal transfers, while only standard mode supports handshaking transfers. Normal transfers are compatible with most protocols because the serial clock is completely configurable. Handshaking transfers allow a slave device to notify the master that it is not ready for a transfer. “Normal Transfers (All Modes)” on page 9-9 and “Handshaking Transfers (Standard Mode Only)” on page 9-10 discuss these transfer types in detail.

9.1.1Standard Mode

In standard mode, the SSIO channels operate as two independent serial channels. Each channel contains one clock signal and one data signal. This mode is useful for systems in which unidirectional or half-duplex communication is acceptable. Half-duplex communication uses the same data signal for both transmissions and receptions. In standard mode, the channels can act as either master or slave and as either transmitter or receiver, resulting in the four configuration options shown in Figure 9-1.

9-1

8XC196EA USER’S MANUAL

Microcontroller

 

 

 

 

 

Microcontroller

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Peripheral

 

 

 

 

 

Peripheral

SCx

 

 

 

Clock

 

SCx

 

 

 

Clock

 

 

 

 

 

 

 

SDx

 

 

 

Data Out

 

SDx

 

 

 

Data In

 

 

 

 

 

 

 

Master

 

 

 

Slave

 

Master

 

 

 

Slave

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Master Receiver

 

Master Transmitter

 

 

 

 

 

 

 

 

 

Microcontroller

 

 

 

 

 

Microcontroller

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Peripheral

 

 

 

 

 

Peripheral

SCx

 

 

 

Clock

 

SCx

 

 

 

Clock

 

 

 

 

 

 

 

SDx

 

 

 

Data Out

 

SDx

 

 

 

Data In

 

 

 

 

 

 

 

Slave

 

 

 

Master

 

Slave

 

 

 

Master

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Slave Receiver

 

Slave Transmitter

A3306-01

Figure 9-1. Standard Mode Configuration Options

A master device generates a clocking signal and a slave device receives a clock signal. As shown in Figure 9-1, with a master configuration, the SSIO channel outputs a clocking signal on its serial clock (SCx) pin. With a slave configuration, the clocking signal is input on SCx. When the channel acts as a receiver, the SSIO port shifts an 8-bit data stream (MSB first) into the microcontroller through its serial data (SDx) pin. When the channel acts as a transmitter, the SSIO port shifts data out of the microcontroller through SDx.

9.1.2Duplex Mode

In duplex mode, the SSIO channels operate as a pair to provide full-duplex communication. Fullduplex communication uses separate data signals for receptions and transmissions. In this mode, the SSIO can act as either master or slave, and it transmits data through its serial data 0 (SD0) signal and receives data through its serial data 1 (SD1) signal. As master, the SSIO outputs a clocking signal on its serial clock (SC0) pin. As slave, the SSIO receives an externally generated clocking signal on SC0. Figure 9-2 shows the duplex-mode configuration options.

9-2

SYNCHRONOUS SERIAL I/O (SSIO) PORT

Microcontroller

Peripheral

SC0 Clock

SD0 Data In

SD1 Data Out

Master

Slave

 

Microcontroller as Master

Microcontroller

Peripheral

SC0 Clock

SD0 Data In

SD1 Data Out

Slave

Master

 

Microcontroller as Slave

A3312-01

Figure 9-2. Duplex Mode Configuration Options

9.1.3Channel-select Mode

In channel-select mode, the SSIO channels operate as one serial channel for communications in systems with multiple slaves or multiple masters. With this configuration, the SSIO can act as either master or slave. Channel-select mode uses four signals: two serial data signals (SD0 and SD1), a clock signal (SC0), and a channel-select signal (CHS#). In channel-select mode, the SSIO can provide full-duplex communication, using both SD0 and SD1 data signals, or it can provide half-duplex communication, using only the SD1 data signal. When the SSIO is configured as a slave, an external master activates CHS# to communicate with the SSIO. When the SSIO is configured as a master, an external master activates CHS# when it wants the SSIO to give up the bus. When the microcontroller is the only master in a system, tie the CHS# signal high because the SSIO does not need to relinquish the bus to another master. Figure 9-3 shows channel-select configurations.

9-3

8XC196EA USER’S MANUAL

Microcontroller 1

 

 

Microcontroller 2

(master)

Clock

Clock

(slave)

 

 

SC0

 

 

SC0

SD0

Data In

Data In

SD0

SD1

Data Out

Data Out

SD1

CHS#

Peripheral 1

Peripheral 2

 

(slave)

(slave)

 

 

CS#

CS#

 

Pn.x

 

 

 

Pn.y

 

 

 

Pn.z

 

 

CHS#

System with Multiple Slaves

Microcontroller 1

 

 

(master)

 

 

SC0

Clock

Clock

SD0

Data In

Data In

SD1

Data Out

Data Out

 

Peripheral 1

Peripheral 2

 

(slave)

(slave)

 

CS#

CS#

CHS#

 

 

Px.1

 

 

Px.2

 

 

Px.3

 

 

Microcontroller 2

(master)

SC0

SD0

SD1

CHS#

Px.1

Px.3

Px.2

System with Multiple Masters

A3354-01

Figure 9-3. Channel-select Configuration Options

9-4

Соседние файлы в предмете Электротехника