TXZ Family
Serial Peripheral Interface
2019-02-28
16 / 67
Rev. 3.0
Operation description
3.1. Basic operation
3.1.1. Clock supply
When TSPI is used, the corresponding clock enable bits should be set to “1” (Clock supply) in fsys supply stop
register A (
[CGFSYSENA]
and
[CGFSYSMENA]
), fsys supply stop register B (
[CGFSYSENB]
and
[CGFSYSMENB]
), and fc supply stop register (
[CGFCEN]
). The corresponding registers and the bit locations
depend on a product. Some products do not have all registers. For the details, refer to “Clock Control and
Operation Mode” in Reference manual.
When stopping supply of a clock, please check that TSPI has stopped (
[TSPIxCR0]
<TSPIE>=0 (TSPI control)).
Moreover, also when you change operational mode to STOP1/STOP2, please check that TSPI has stopped.
3.1.2. Initial setting of TSPI
First,
[TSPIxCR0]
<TSPIE>(TSPI operation control) set as "1". Please perform needed setup, such as
communicate mode, transfer mode, and a transfer format, after checking that
[TSPIxSR]
<TSPISUE>(TSPI
modify status flag) is "0".
3.1.3. Start and stop transfer
There are two methods for a transfer start in the case of full duplex communication mode and transmitting mode.
1.
Write Data to data register
[TSPIxDR],
after wrote “1” to
[TSPIxCR1]
<TRXE> for enable
communication.
2.
Write “1” to
[TSPIxCR1]
<TRXE>, after wrote data to data register
[TSPIxDR]
.
In the case of receiving mode, reception is started shortly after setting to
[TSPIxCR1]
<TRXE>=1.
In order to stop transfer, please set "0" to
[TSPIxCR1]
<TRXE>. In single transfer burst transfer and continuously
transfer, transfer is performed to the last of the frame under transfer.,
After stopped, TSPIxSCK,TSPIxCS0/1/2/3,and TSPIxTXD will be in an idle state. Please refer to “3.3.7. Special
control”.
If a transfer is enabled again after stopping transfer in a burst mode, operation will be started from the beginning
of the stopped burst transfer.