嗨,因为SPI总是有它自己的位时钟信号在单独的线/迹上,所以SCK引脚、精确定时并不重要,只要它不太快。MCP23S17的数据表规定了10MHz的最大值。dsPIC33中的SPI硬件通常有一个控制位以8位或16位模式操作。此外,MCP23S17具有内部控制以8位数据或16位序列操作。这对SPI信号线并不重要:当SPI数据传送时。r开始,通过设置/CS低,SPI传输是连续的比特序列,在字节或单词之间没有标点。如果从数组传输数据,则数据的排序可能根据8位或16位模式而受到影响。代码片段显示以8位字节数组构建缓冲区,这是在DSSPIC33中使用8位模式传输到MCP23 S17。“值”是软件中的16位或更长的整数变量。它应该包含要传送到端口扩展器的数据、控制寄存器设置或输出管脚数据。每次传送到MCP23S17时,可以传送1个或更多个数据字节,即一起传送3个或更多个字节。字节4和后续将如何解释,将取决于ICOON寄存器中的设置。
以上来自于百度翻译
以下为原文
Hi,
Since SPI always have it's own bit clock signal on a separate wire/trace, the SCK pin, precice timing do not matter, as long as it is not too fast. The datasheet for MCP23S17 specify 10 MHz maximum.
SPI hardware in dsPIC33 usually have a control bit to operate in 8 bit or 16 bit mode.
Also, the MCP23S17 have internal controls to operate either with 8 bit data or 16 bit sequences.
This do not matter to the SPI signal lines: when a SPI data transfer is started, by setting /CS low,
a SPI transfer is a contigous sequence of bits, with no punctuation between bytes or words.
If transferring data from an array, the ordering of data may be affected depending upon 8-bit or 16-bit mode.
The code snippet show building a buffer in a array of 8-bit bytes, this is for transfer to the MCP23S17 using 8-bit mode in the dsPIC33.
'value' is a 16 bit or longer integer variable in your software. It should contain the data you want to transfer to the port expander, control register settings or output pin data.
It is possible to transfer 1 or more data bytes in each transfer to the MCP23S17, that is 3 or more bytes together. How byte 4 and following will be interpreted, will depend upon settings in the IOCON register.
Regards,
Mysil
嗨,因为SPI总是有它自己的位时钟信号在单独的线/迹上,所以SCK引脚、精确定时并不重要,只要它不太快。MCP23S17的数据表规定了10MHz的最大值。dsPIC33中的SPI硬件通常有一个控制位以8位或16位模式操作。此外,MCP23S17具有内部控制以8位数据或16位序列操作。这对SPI信号线并不重要:当SPI数据传送时。r开始,通过设置/CS低,SPI传输是连续的比特序列,在字节或单词之间没有标点。如果从数组传输数据,则数据的排序可能根据8位或16位模式而受到影响。代码片段显示以8位字节数组构建缓冲区,这是在DSSPIC33中使用8位模式传输到MCP23 S17。“值”是软件中的16位或更长的整数变量。它应该包含要传送到端口扩展器的数据、控制寄存器设置或输出管脚数据。每次传送到MCP23S17时,可以传送1个或更多个数据字节,即一起传送3个或更多个字节。字节4和后续将如何解释,将取决于ICOON寄存器中的设置。
以上来自于百度翻译
以下为原文
Hi,
Since SPI always have it's own bit clock signal on a separate wire/trace, the SCK pin, precice timing do not matter, as long as it is not too fast. The datasheet for MCP23S17 specify 10 MHz maximum.
SPI hardware in dsPIC33 usually have a control bit to operate in 8 bit or 16 bit mode.
Also, the MCP23S17 have internal controls to operate either with 8 bit data or 16 bit sequences.
This do not matter to the SPI signal lines: when a SPI data transfer is started, by setting /CS low,
a SPI transfer is a contigous sequence of bits, with no punctuation between bytes or words.
If transferring data from an array, the ordering of data may be affected depending upon 8-bit or 16-bit mode.
The code snippet show building a buffer in a array of 8-bit bytes, this is for transfer to the MCP23S17 using 8-bit mode in the dsPIC33.
'value' is a 16 bit or longer integer variable in your software. It should contain the data you want to transfer to the port expander, control register settings or output pin data.
It is possible to transfer 1 or more data bytes in each transfer to the MCP23S17, that is 3 or more bytes together. How byte 4 and following will be interpreted, will depend upon settings in the IOCON register.
Regards,
Mysil
举报