
464
Use the following procedure for simultaneous transmission and reception in external clock mode.
1. Setup transmission/reception mode by setting the PMRA1 and PMRA0 bits to 11.
2. Setup external clock mode by setting the SMR3 to SMR0 bits to 1111.
The serial interface internal states are initialized when SMR is written.
3. Select either a low or high level SO pin idle output by setting the PMRC1 bit. The SO pin will
immediately go to either the high or low level when PMRC1 is written.
4. Write the data to be transmitted to the SRL/U pair.
5. Execute an STS instruction. The serial interface will switch from the STS instruction wait state
to the transfer clock wait state.
When the external clock is applied, the serial interface will switch from the transfer clock wait
state to the transfer state on the first transfer clock falling edge, and the serial interface will
begin the transmission/reception operation. The SRL/U pair will be shifted right (in the MSB
to LSB direction) in synchronization with the transfer clock, received data will be acquired in
the MSB, and transmitted data will be output from the LSB.
6. When eight transfer clock cycles have been input, OC is cleared to 000 and IFS is set to 1. At
the same time the serial interface switches from the transfer state to the transfer clock wait
state thus completing the transmission/reception operation.
7. Read out the received data from the SRL/U pair.
After the transfer completes, the SO pin holds the value of the MSB of the transmitted data. The
output value on the SO pin can be changed by setting the PMRC1 bit.
In the transfer clock wait state, if the transfer clock continues to be input, data transmission/
reception operations are repeated. Also, the serial interface can be returned to the STS instruction
wait state to prepare for the next transmission/reception by performing a dummy write to the SMR
register.
If the SMR register is written during a transmission/reception operation, OC is cleared to 000 and
IFS is set to 1. At the same time the serial interface switches to the STS instruction wait state and
the transmission/reception operation is aborted.
See figures 20-6 and 20-10 for the transmission/reception operation in external clock mode.