Jump to content
  • 0

cannot receive message from tx sender PMOD CAN and BASYS MX3


Gaston

Question

Hello,

I'm trying to communicate two BASYS MX3 boards with a PMOD CAN attached. One board is programmed as TX sender and the other one with the RX firmware from provided examples. The problem is I cannot receive any frame from TX sender (who is incrementing frames every 1/2 second). Please could anyone help me whit this issue?

regards,

gaston

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

Hi @Gaston,

We ran the demo associated with the Arduino IDE version 1.6.9 and the Digilent Core version 1.0.4 (available on the Pmod CAN Resource Center), and the demo worked as expected. Both Pmods were plugged into Pmod Header A. What version of the Arduino IDE are you using as well as the Digilent Core? Can you provide a picture of your setup so that we can see how you have things plugged in?

Thanks,
JColvin

Link to comment
Share on other sites

Hi JCovin,

I'm running the provided demo on two Basys MX3 with PMOD CAN in MPLAB X, not Arduino at all. Here's my current configuration:

  • MPLAB X v4.15
  • XC32 v2.05 compiler
  • Installed legacy peripheral libraries (plib) v1.40 from Microchip site and set include paths in project (CAN_TX and CAN_RX) settings

The building of CAN_TX and CAN_RX projects was correct, no errors were shown and generated respective binaries (.hex) as expected. Next I was able to program the boards without problems.

When I turn on the boards I can open a serial terminal to check printf output messages. First I turn on the Tx board, here's the output terminal ttyUSB1 at this point:

image.png.f015d7b45b42b0b512d5835cdb6847c6.png

Then I turn on the Rx board

image.png.b1367b9ed8767e763cbe5db7cb187340.png

And finally check the output terminal ttyUSB0 (in the Rx board)

image.png.3733d10de34b470565bdc085ce59466c.png

In the Rx board the CAN bus seems to be initialized correctly but I cannot receive Tx information as expected. I've checked the MCP25625 INT signal (connected to RC3 on PIC32MX) and it is always High.

I've also captured the bus frame but it seems that everything is correct.

image.png.a31705963b1c49869f6ff216883c8676.png

Any hint to solve this issue?

regards,
gaston

Link to comment
Share on other sites

Hi @Gaston,

I'll have to test the setup with MPLAB X to see if we get something different since it sounds like you did everything correctly. Is the bus frame that you caputured coming out of the Pmod CAN? One other thing you could try to see if it is a weird hardware issue would be to swap Pmod CANs between the two boards to see if that changes anything in what you see; I'm not certain if anything will change, but it will at least help rule out a hardware error.

Thanks,
JColvin

Link to comment
Share on other sites

17 minutes ago, JColvin said:

Is the bus frame that you caputured coming out of the Pmod CAN?

Yes, it is.

17 minutes ago, JColvin said:

One other thing you could try to see if it is a weird hardware issue would be to swap Pmod CANs between the two boards to see if that changes anything in what you see

I've also swapped the boards. Nothing changes...

Please, check the setup as you suggested. I'll be waiting for your feedback.

regards,
gaston

Link to comment
Share on other sites

Hi Gaston,

It looks like your CAN receiver doesn't have interrupts enabled. Try adding the following to the RX code, just above the readRegisters function in main()

     mcp25625_setRegister(MCP_CANINTE, 0x3);//Enable read buffer full interrupts
    mcp25625_setRegister(MCP_CANINTF, 0);//Clear interrupt flags

Hope this helps!

-Tommy

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...