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.

CC2530 用SPI 连接其他芯片不能工作

Other Parts Discussed in Thread: CC2530

我用了CC2530的UART1,配置成SPI master模式去连接 enc28j60芯片。enc28j60芯片是把spi发送的数据转成ip包发送到网络上。

现象上,SPI根本不能写到enc28j60芯片上。我测了下,发现SPI时钟信号一直没有。对过CC2530的说明文档也没有发现哪里出了问题。

请问能否帮我看下代码吗。

hal_spi.c文件里 配置了spi master并写了个简单的spiRead和spiWrite

hal_net.c里实现了利用spi和enc28j60通信的逻辑, enc28j60需要先用spi写1字节的寄存器地址,然后再写数据。

在SampleApp_HandleKeys中我做了按键测试,如果Key_6被按下,就会改写enc28j60的某个寄存器,但是我发现没有成功,spi总线上的数据很乱

spiMaster.zip