我正在处理PIC24FJ256GB210,试图在SPI接口上接口从设备。我的从设备有8位寄存器加法器,16位寄存器数据。我使用MPLAB代码配置器工具来生成SPI代码。请您帮助我,我应该选择
通信宽度为16位还是8位?请举例说明如何使用Pix1Exchange 8BIT传输数据。在上面的场景中,我可以这样配置用于将16位数据写入8位寄存器:SPI1_Exchange8bit(register_addr);SPI1_Exchange8bit(register_data_MSB);SPI1_Exchange8bit(register_data_MSB);
以上来自于百度翻译
以下为原文
I am working on PIC24FJ256GB210, trying to interface a slave device on SPI interface.My slave has 8bit register addr, 16bit register data.
I am using MPLAB Code Configurator tool, to generate the SPI code. KIndly request you to help me, should i choose the Communica
tion width as 16bit or 8bit ?
Kindly provide an example how to use SPI1_Exchange8bit to transfer the data .
In the above scenario can i configure like this for WRITING 16bit data into 8bit register :
SPI1_Exchange8bit(register_addr);
SPI1_Exchange8bit(register_data_MSB);
SPI1_Exchange8bit(register_data_MSB);