配置主设备SPI接口时钟时一定要弄清楚从设备的时钟要求,由于主设备这边的时钟极性和相位都是从设备为基准的。硬件上主设备的SDO和从设备的SDI相连,主设备的SDI和从设备的SDO相连。主设备上SDO发送的数据从设备通过SDI接收,主设备SDI接收的数据从设备通过SDO发送。所以主设备的SPI时钟极性的配置(即SDO)和从设备的SDI接收数据的极性相反,和从设备SDO发送数据的极性相同。
下面这段话是Sychip Wlan8100 Module Spec上说的,充分说明了时钟极性是如何配置的:
The 81xx module will always input data bits at the rising edge of the clock, and the host will always output data bits on the falling edge of the clock
SPI的时钟配置心得
最新推荐文章于 2024-06-15 13:35:20 发布