@cek 使用wiringPiSPIDataRW函数进行读写是按照8位读写,但是openimu的spi按照16位读写,源代码中发送0x5600 0x0000时分别调用了两次该函数,导致发送完一次后CS线处于HIGH,因此直接调用一次该函数发送四字节,可以实现16位读写,但是会多一个时钟(Using the wiringPiSPIDataRW function to read and write is based on 8 bits, but openimu's SPI is based on 16 bits. When sending 0x5600 x0000 in the source code, the function is called twice respectively, resulting in the CS line at high after sending once. Therefore, calling the function once to send four bytes directly can realize 16 bit read and write, but there will be one more clock:):
buf[0] = REG_PRD;
buf[1] = 0x00;
buf[2] = 0x00;
buf[3] = 0x00;
wiringPiSPIDataRW(PI_SPI_CHANNEL,buf,4);
Posts made by sunshine1995tangyao
RE: openimu300ZI evk 如何使用spi模式读取数据 SPI reading of Open-IMU300ZI_evk
posted in The OpenIMU Family •
RE: openimu300ZI evk 如何使用spi模式读取数据 SPI reading of Open-IMU300ZI_evk
posted in The OpenIMU Family •
十分感谢!您的建议帮助很大,已解决问题~~
openimu300ZI evk 如何使用spi模式读取数据 SPI reading of Open-IMU300ZI_evk
posted in The OpenIMU Family •
使用树莓派3B,spidriver-c以及这份驱动代码,evk的p1上的三个跳线帽均已拔掉,已连接SPI(MOSI,MISO,CLK,NSS) lines, 1PPS line, VCC,GND。data ready line线在树莓派上未找到对应管脚故未连接,使用逻辑分析仪查看树莓派发送一切正常,MISO未返回任何数据?