Trouble with hardware SPI control STM8 Note NRF24L01

STM8 used today to control the hardware SPI NRF24L01, through the self-test results, but the data packet transmission is always wrong.

Engage in an afternoon, and finally found the cause of the problem.

CSN NRF24L01 foot is used to control the transmission of the SPI Enable. The feet can not be directly grounded, otherwise the module does not work. Each time the microcontroller with NRF24L01 communications, we need to pin this down, then pulled newsletter completion. Because it is hardware drivers, SPI is often no communication is completed, CSN foot was pushed up. Cause data loss. All foot before CSN raised the need to determine whether the SPI is idle.

Shihai tests found that if the SPI is divided by 256, even if the judge whether SPI is idle, then pulled CSN foot, communication is not successful. So too slow clock frequency.

Released seven original articles · won praise 8 · views 3080

Guess you like

Origin blog.csdn.net/laocui1/article/details/88917434