Other Parts Discussed in Thread: CC3235SF, ADS1299
移植了SPI的驱动后,用示波器测SCLK引脚和MOSI引脚,都没有波形出现,用万用表测试也没有电压值,请问怎么解决呢?怎么才能知道SPI通信正常呢?
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.
用示波器测SCLK引脚和MOSI引脚,都没有波形出现,用万用表测试也没有电压值,
看起来是硬件连接有问题。您是否有使用开发板直接测试例程?
C:\ti\simplelink_cc32xx_sdk_5_20_00_06\examples\rtos\CC3235SF_LAUNCHXL\drivers
若是可以,请您详细说明下您现在的情况
您可以看一下 simplelink_cc32xx_sdk_5_20_00_06/examples/rtos/CC3235SF_LAUNCHXL/drivers/spimaster/README.html
您现在是否有接从机?
您可以看一下
https://www.ti.com.cn/cn/lit/ug/swru543a/swru543a.pdf
8.3.2 Master Mode Operation Without Interrupt (Polling)
The Slave Select line can be controlled by the hardware (HW) or by the driver (SW).
It is only applicable in 4 pin mode.
Please refer to the TRM for more details (https://www.ti.com/lit/pdf/swru465).
您指的是SPICLK中的差距,在示波器上以红色突出显示的内容吗?这种差距是正常的,不能用 CC32xx SPI 硬件改变。它不应该对系统产生显着的性能影响。
至于“中间却隔了那么多的周期没有发送数据”,您指的是SPICLK间隙还是其他什么?
1.您好,请问使用GPIO的复用功能SPI通信,需要对对应的GPIO引脚设置复用成哪个引脚对应SPI的哪个引脚嘛,然后还需要开启相应的GPIO或SPI时钟嘛?还是只需要直接在syscfg里这样设置就可以了,然后也不用对SPI引脚进行设置成推挽输出之类的,也不用打开SPI对应的时钟了?
2.请问我想设置相关的使能引脚设置成推挽输出应该选择下面哪一个呢?,比如我这样写是不是将引脚设置成推挽输出了呢【GPIO_setConfig(CONFIG_ADS1299_EN, GPIO_CFG_OUTPUT | GPIO_CFG_OUT_OD_PU);】?
请问使用GPIO的复用功能SPI通信,需要对对应的GPIO引脚设置复用成哪个引脚对应SPI的哪个引脚嘛
您可以参考一下例程内的设置
simplelink_cc32xx_sdk_5_20_00_06\examples\rtos\CC3235SF_LAUNCHXL\drivers\spimaster
比如我这样写是不是将引脚设置成推挽输出了呢【GPIO_setConfig(CONFIG_ADS1299_EN, GPIO_CFG_OUTPUT | GPIO_CFG_OUT_OD_PU);
是的,可以看一下宏定义
#define GPIO_CFG_OUTPUT (((uint32_t) 0) << GPIO_CFG_IO_LSB) /*!< @hideinitializer Pin is an output. */
#define GPIO_CFG_OUT_STD (((uint32_t) 0) << GPIO_CFG_IO_LSB) /*!< @hideinitializer Output pin is actively driven high and low */
#define GPIO_CFG_OUT_OD_NOPULL (((uint32_t) 2) << GPIO_CFG_IO_LSB) /*!< @hideinitializer Output pin is Open Drain */
#define GPIO_CFG_OUT_OD_PU (((uint32_t) 4) << GPIO_CFG_IO_LSB) /*!< @hideinitializer Output pin is Open Drain w/ pull up */
#define GPIO_CFG_OUT_OD_PD (((uint32_t) 6) << GPIO_CFG_IO_LSB) /*!< @hideinitializer Output pin is Open Drain w/ pull dn */
请您看一下例程
simplelink_cc32xx_sdk_5_20_00_06\examples\rtos\CC3235SF_LAUNCHXL\drivers\gpiointerrupt