Last Updated on : 2024-06-20 02:32:24download
This topic describes information about implementing serial peripheral interface (SPI) communication between CBx series modules and MCUs.
CBx series is a Wi-Fi and Bluetooth Low Energy (Bluetooth LE) combo module developed by Tuya Smart. It is composed of a highly integrated radio-frequency identification (RFID) chip BK7231N and a few peripheral components. It can run in Wi-Fi station mode and access point (AP) mode as well as support connection over Bluetooth Low Energy.
Module/chip model | MISO pin No. | MISO silk screen | MOSI pin No. | MOSI silk screen | SCLK pin No. | SCLK silk screen | CS pin No. | CS silk screen |
---|---|---|---|---|---|---|---|---|
BK7231N | 14 | P17 | 12 | P16 | 11 | P14 | 13 | P15 |
CBU | 20 | P17 | 2 | P16 | 1 | P14 | 21 | P15 |
CBU-IPEX | 20 | P17 | 2 | P16 | 1 | P14 | 21 | P15 |
CB3SE | 13 | P17 | 14 | P16 | 4 | P14 | 9 | P15 |
The SPI allows full-duplex synchronous serial communication. The SPI bus complies with the de-facto standard and supports four working modes. It uses three (single-to-single) or four-wire (multiple-to-multiple) for communication as needed. The built-in receive and transmit FIFO can help you reduce software overhead.
The following diagram shows the internal structure and connection to peripherals.
Features
When the SPI device acts as the controller, it generates the SCLK. The clock rate is set with the software. The following diagram shows the four working modes.
When the SPI device acts as the peripheral, the SCLK is an input signal. To sample data correctly, the clock polarity and phase must match the controller. Data on the MOSI pin is sampled in the middle of the data bit.
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback