The main program flow chart of terminal node SPI initialization and registers configuration of CC1101. The SPI interface of STC15W1K24S is a full-duplex, high speed, synchronous communication bus, there are two kinds of operating modes: the master mode and the slave mode. The main function register MCU SPI interface is SPCTL (SPI control register), SPSTAT (SPI status register) and SPDAT (SPI data registers). SPI initialization need to initialize the three register. SPSTAT need to write "1" to the flags(SPIF and WCOL) for clearing. In this system, the collecting and terminal node all use the main mode , it need to will write "1" to SPCTL SSIG, MSTR and SPEN in order to set the master mode.  

The main program flow chart of terminal node SPI initialization and registers configuration of CC1101. The SPI interface of STC15W1K24S is a full-duplex, high speed, synchronous communication bus, there are two kinds of operating modes: the master mode and the slave mode. The main function register MCU SPI interface is SPCTL (SPI control register), SPSTAT (SPI status register) and SPDAT (SPI data registers). SPI initialization need to initialize the three register. SPSTAT need to write "1" to the flags(SPIF and WCOL) for clearing. In this system, the collecting and terminal node all use the main mode , it need to will write "1" to SPCTL SSIG, MSTR and SPEN in order to set the master mode.