Microchip
直播中

孟佳

7年用户 219经验值
私信 关注
[问答]

为什么MCP2515与SPI在输入数据线上什么也没有?

继续努力把我们的硬件移植到HARMony 1.07……我们的定制硬件使用PIC32MX695F512L和4个MCP2515 CAN控制器,这些控制器通过一个SPI总线连接到PIC。芯片选择(CS)是由4个输出引脚处理。我正在移植这个硬件来运行FreeRTOS and Harmony。有了一个范围,我已经验证了CS是正确的,时钟和输出数据是正确的。当我读时,我看到时钟脉冲,但是在输入数据线上什么也没有。在这一点上,我不怀疑Harmony或SPI接口,因为我看到了输出数据的正确信号。这似乎是在2515芯片的配置。我发送的命令是:0x0C-CAN_RESET-一个单字节命令,它重置2515芯片并将其置于配置模式。0x02、0x2A、0x03-CAN_WRITE到CNF1寄存器,以将波特率生成器0x02、0x29、0xB1-CAN_WRITE设置到CNF2寄存器,以设置CAN定时参数0x02,0x28,0x05-CAN_WRITE到CNF3寄存器,以设置更多的CAN定时参数0xA0-CAN_RD_STATUS-这是我看到在SPI总线上发送命令的地方,但是当时钟再次脉冲时什么也没有收到。当我使用一个带有地址的ChanxRead命令时,同样的事情也会发生。谢谢,

以上来自于百度翻译


      以下为原文

    Continuing with the effort to port our hardware to Harmony 1.07...

Our custom hardware uses a PIC32MX695F512L and 4 MCP2515 CAN controllers connected to the PIC with a single SPI bus.  Chip Select (CS) is handled by 4 output pins.  I am porting this hardware to run FreeRTOS and Harmony.

With a scope, I have verified that the CS is correct and that the clock and output data are correct.  When I do a read, I see the clock pulses, but nothing on the input data line.

At this point, I don't suspect Harmony or the SPI interface because I see the correct signals for outgoing data.  It seems to be something in the configuration of the 2515 chip.  The commands I send it are:
0x0C - CAN_RESET - a single byte command that resets the 2515 chip and puts it in the configuration mode.
0x02, 0x2A, 0x03 - CAN_WRITE to the CNF1 register to set the baud rate generator
0x02, 0x29, 0xB1 - CAN_WRITE to the CNF2 register to set the CAN timing parameters
0x02, 0x28, 0x05 - CAN_WRITE to the CNF3 register to set more CAN timing parameters
0xA0 - CAN_RD_STATUS - this is where I see the command is sent on the SPI bus, but nothing is received when the clock is pulsed again.  The same thing happens when I use a CAN_READ command with an address.

Any MCP2515 experts out there?

Thanks,

更多回帖

发帖
×
20
完善资料,
赚取积分