|
|
Component
SynchroSlave
Slave for synchronous serial communication
Component Level: High
Category:
CPU Internal Peripherals-Communication
This component (in cooperation with SynchroMaster) implements a serial synchronous master-slave communication. Only two devices can communicate - one of them is a MASTER and the other one is a SLAVE.
The difference between the master and slave is that the master generates the clock signal while the slave receives it. Consequently, if the master has no data to send to slave and needs receive data from the slave, it still has to transmit a character. For example a reserved character called "empty character" that may be ignored by slave (see properties Empty character and Ignore empty char.). That also applies vice versa - if the slave has no data, it sends an empty character to the master. When the device is initialized or enabled (initialized by Enable method) and Interrupt service property is enabled, the empty character is saved in the output buffer of the device, i.e. the slave device sends the empty character as the first character after initialization of the device. This mechanism is not supported in polling mode (Interrupt service property is disabled) and the user code must ensure saving of the empty character into output buffer. The type of the user type ComponentName_TComData is a byte if the number of information bits (Width property) is less than or equal to 8. If the number of information bits is greater than 8, the type of the user type ComponentName_TComData is a word. SW overrun behavior
Configuring Clock edge and Shift clock idle polarity properties
The pictures below show posible settings and their influence on the SPI communication operation.
Version specific information for Freescale HCS08 and RS08 and HCS12 and HCS12X and ColdFireV1 derivatives
Bidirectional mode behavior
The picture below show the SynchroSlave HW inner interconnection in the normal (two wires are used for communication) and bidirectional mode (one wire communication). In the bidirectional mode:
Consequently the direction hasn't effect on the OnTxChar event or the OnRxChar event. The behavior in the normal mode is obvious.
|