Rev. 1.10
150
October 23, 2020
Rev. 1.10
151
October 23, 2020
BC66F5652
2.4GHz RF Transceiver A/D Flash MCU
BC66F5652
2.4GHz RF Transceiver A/D Flash MCU
Slave Mode
• Step 1
Select the SPI Slave mode using the SIM2~SIM0 bits in the SIMC0 control register
• Step 2
Setup the CSEN bit and setup the MLS bit to choose if the data is MSB or LSB first, this setting
must be the same with the Master devices.
• Step 3
Setup the SIMEN bit in the SIMC0 control register to enable the SPI interface.
• Step 4
For write operations: write the data to the SIMD register, which will actually place the data into
the TXRX buffer. Then wait for the master clock SCK and
SCS signal. After this, go to step5.
For read operations: the data transferred in on the SDI line will be stored in the TXRX buffer
until all the data has been received at which point it will be latched into the SIMD register.
• Step 5
Check the WCOL bit if set high then a collision error has occurred so return to step 4. If equal to
zero then go to the following step.
• Step 6
Check the TRF bit or wait for a SPI serial bus interrupt.
• Step 7
Read data from the SIMD register.
• Step 8
Clear TRF.
• Step 9
Go to step 4.
Error Detection
The WCOL bit in the SIMC2 register is provided to indicate errors during data transfer. The bit is
set by the SPI serial Interface but must be cleared by the application program. This bit indicates a
data collision has occurred which happens if a write to the SIMD register takes place during a data
transfer operation and will prevent the write operation from continuing.
I
2
C Interface
The I
2
C interface is used to communicate with external peripheral devices such as sensors,
EEPROM memory etc. Originally developed by Philips, it is a two line low speed serial interface
for synchronous serial data transfer. The advantage of only two lines for communication, relatively
simple communication protocol and the ability to accommodate multiple devices on the same bus
has made it an extremely popular interface type for many applications.
Device
Slave
Device
Master
Device
Slave
VDD
SDA
SCL
I
2
C Master Slave Bus Connection