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.

MSP432P401R SPI DATA

Other Parts Discussed in Thread: ADS1299

我現在用MSP432P401R(MASTER)和ADS1299(SLAVE)進行傳輸。

當我用SP432P401R接收來自ADS1299的資料時,ADS1299會先傳LOW BITS再傳HIGH BITS,而SP432P401R會先接收LOW BITS再接收HIGH BITS對嗎?

我利用CCS的查看暫存器之值,它顯示1'/x01',我知道這代表0x01的意思,但是我不知道0x(01)括號中的0和1分別代表的是low bits還是high bits?

  • 首先关于ADS1299,您可以参考

    e2e.ti.com/.../774886

    关于发送接收

    SPI mode features include:
    • 7-bit or 8-bit data length
    • LSB-first or MSB-first data transmit and receive

    The default SPI character transmission is LSB first. For communication with other SPI interfaces, MSB-first mode may be required.
  • 这是可设置的,例如你如果是高位先传,
    EUSCI_B_CTLW0_MSB; // MSB first
    就是这样设置。
    MSB:Most Significant Bit. “最高有效位”
    LSB:Least Significant Bit. “最低有效位”
    MSB first表示,数据采用大端模式,意思就是一个多字节数据的高字节在前,低字节在后。例如0x1234567890ab,它的存储方式就是12 34 56 78 90 ab.
    相反,lsb first就是小端模式,一个多字节数据的低字节在前,高字节在后。上例的存储就是ab 90 78 56 34 12
    这里是可以设置的。外挂的外设元件一般是没法修改的,而我们的单片机可以通过寄存器配置。
  • 建议楼主下载MSPware432,里面有丰富的例子介绍,你看一个就明白哪些参数可以配置了。官方的演示例子写的非常明白。
    www.ti.com/.../slau356i.pdf
    这是该芯片的手册,在934页介绍了该功能,是可以选择的。
  • The default SPI character transmission is LSB first. For communication with other SPI interfaces, MSB-first mode may be required.
    另外请注意手册934页这句话,默认是小端优先配置,也就是你不用配置这个,就可以满足你低位先接收的原则。所以在头文件的宏里面只提供了大端优先的配置宏。