主题中讨论的其他部件: LMX2571
您好,
我目前正在使用msp430f5659设备。 我要做的是使用SPI从其它设备接收数据。 我的设备是FSK接收器模块,输出为0~1.5 或0~1.8 数字数据摆动。
是否可以使用来自其他器件而不是TI的这些数据?
谢谢
Jongchan Woo
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
您好,
我目前正在使用msp430f5659设备。 我要做的是使用SPI从其它设备接收数据。 我的设备是FSK接收器模块,输出为0~1.5 或0~1.8 数字数据摆动。
是否可以使用来自其他器件而不是TI的这些数据?
谢谢
Jongchan Woo
SPI是每个传输8位-您将看到从属设备通常有8位或8位的倍数来读取或写入。 例如,对于16位ADC结果,您必须接收2倍8位的数据,并将数据组合到控制器内的16位字中。 24,32或64位数据也是如此。
一个16位字可能如下所示:
MSB -> 1101 1001 1011 0000 <- LSB
如果您请求数据,通常首先获得MSB,这样您就可以执行如下操作:
//数据:MSB -> 1101 1011 0000 <- LSB uint8_t data_buffer[2]; uint16_t data_word = 0; data_buffer[0]=<请求MSB>;//1101 data_buffer[1]= <请求LSB>;// 1011 0000 data_word = data_buffer[0]; // 0000 0000 1101 1001 数据字<<=8; // 1101 1001 0000 data_word |= data_buffer[1];// 1101 1001 1011 0000
Dennis