MC97F2664
160
April 11, 2014 Ver. 1.4
11.9.3 Data Transmit / Receive Operation
User can use SPI 2/3 for serial data communication by following step
1. Select SPI 2/3 operation mode(master/slave, polarity, phase) by control register SPInCR.
2. When the SPI 2/3 is configured as a Master, it selects a Slave by SS2/3 signal (active low).
When the SPI 2/3 is configured as a Slave, it is selected by SS2/3 signal incoming from Master
3. When the user writes a byte to the data register SPInDR, SPI 2/3 will start an operation.
4. In this time, if the SPI 2/3 is configured as a Master, serial clock will come out of SCK2/3 pin. And Master shifts
the eight bits into the Slave (transmit), Slave shifts the eight bits into the Master at the same time (receive). If
the SPI 2/3 is configured as a Slave, serial clock will come into SCK2/3 pin. And Slave shifts the eight bits into
the Master (transmit), Master shifts the eight bits into the Slave at the same time (receive).
5. When transmit/receive is done, SPInIFR bit will be set. If the SPI 2/3 interrupt is enabled, an interrupt is
requested. And SPInIFR bit is cleared by hardware when executing the corresponding interrupt. If SPI 2/3
interrupt is disable, SPInIFR bit is cleared when user read the status register SPInSR, and then access
(read/write) the data register SPInDR.
11.9.4 SS2/3 pin function
1. When the SPI 2/3 is configured as a Slave, the SS2/3 pin is always input. If LOW signal come into SS2/3 pin,
the SPI 2/3 logic is active. And if
‘HIGH’ signal come into SS2/3 pin, the SPI 2/3 logic is stop. In this time, SPI
2/3 logic will be reset, and invalidated any received data.
2. When the SPI 2/3 is configured as a Master, the user can select the direction of the SS2/3 pin by port direction
register (P37IO/P73IO). If the SS2/3 pin is configured as an output, user can use general P37IO/P73IO output
mode. If the SS2/3 pin is configured as an input,
‘HIGH’ signal must come into SS2/3 pin to guarantee Master
operation. If
‘LOW’ signal come into SS2/3 pin, the SPI 2/3 logic interprets this as another master selecting the
SPI 2/3 as a slave and starting to send data to it. To avoid bus contention, MSB bit of SPICR will be cleared
and the SPI 2/3 becomes a Slave and then, SPInIFR bit of SPInSR will be set, and if the SPI 2/3 interrupt is
enabled, an interrupt is requested.
NOTES)
- When the SS2/3 pin is configured as an output at Master mode, SS2/3
pin’s output value is defined by user’s
software (P37IO/P73IO). Before SPInCR setting, the direction of SS2/3 pin must be defined
- If you don
’t need to use SS2/3 pin, clear the SPInSSEN bit of SPInSR. So, you can use disabled pin by
P37IO/P73IO freely. In this case, SS2/3 signal is driven by
‘HIGH’ or ‘LOW’ internally. In other words, master is
‘HIGH’, salve is ‘LOW’
- When SS2/3 pin is configured as input, if
‘HIGH’ signal come into SS2/3 pin, SS_HIGH flag bit will be set. And
you can clear it by
writing ‘0’.
Содержание MC97F2664
Страница 20: ...MC97F2664 20 April 11 2014 Ver 1 4 4 Package Diagram Figure 4 1 64 Pin LQFP 1010 Package...
Страница 21: ...MC97F2664 April 11 2014 Ver 1 4 21 Figure 4 2 64 Pin LQFP 1414 Package...
Страница 22: ...MC97F2664 22 April 11 2014 Ver 1 4 Figure 4 3 64 Pin QFN Package...
Страница 23: ...MC97F2664 April 11 2014 Ver 1 4 23 Figure 4 4 44 Pin MQFP 1010 Package...