Jump to content
  • 0

Using Pmod CAN in MCU (RX72N)


Question

Posted

I'm using the RX72N Envision Kit with a Pmod CAN controller to receive messages from the CAN bus. The Pmod CAN controller is connected to the Envision Kit through a Pmod interface, with communication managed via SPI. However, I'm currently unable to receive the SPI messages on the Pmod CAN controller's SPI end.

I'm following the instructions in this manual (set CAN control mode to configuration, set config rate and clock for CAN, ...). In section 2.3.2 Receive, the instructions lack clarity on which commands to use to retrieve data from the CAN bus, as well as the designated storage location for the received data.

The SPI commands I'm currently sending are these (corresponding to the Pmod CAN controller's setup as described in Section 2.3.1 Setup) It would be great if someone could also verify that these are correct:

//Set CAN control mode to configuration and set config rate and clock for CAN
{0x05,0x0F,0x80,0x80,0x02,0x2A,0x41,0x02,0x29,0xFB,0x02,0x28,0x86}

//Initiate CAN buffer filters and registers (these commands are preceded and followed by the writeSPI {0x02} and clear region {0x00} commands, respectively)
{0x00, 0x01, 0x02, 0x03,0x04, 0x05, 0x06, 0x07,0x08, 0x09, 0x0A, 0x0B,0x10, 0x11, 0x12, 0x13,0x14, 0x15, 0x16, 0x17,0x18, 0x19, 0x1A, 0x1B,
0x20, 0x21, 0x22, 0x23,0x24, 0x25, 0x26, 0x27,0x30, 0x31, 0x32, 0x33,0x34, 0x35, 0x36, 0x37,0x38, 0x39, 0x3A, 0x3B,0x3C, 0x3D,
0x40, 0x41, 0x42, 0x43,0x44, 0x45, 0x46, 0x47,0x48, 0x49, 0x4A, 0x4B,0x4C, 0x4D,
0x50, 0x51, 0x52, 0x53,0x54, 0x55, 0x56, 0x57,0x58, 0x59, 0x5A, 0x5B,0x5C, 0x5D}

//Set the CAN mode for any message type, set CAN control mode to normal mode
{0x05, 0x60, 0x64, 0x60,0x05, 0x0F, 0x80, 0x00}

 

pmodcan-rm.pdf

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...