M5213EVB CAN Setup

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

M5213EVB CAN Setup

1,064 Views
jlpearl
Contributor I
Hello,
 
I am working on a CAN portation for the M5213EVB board.  I am using properly running code for the 5485EVB as my baseline.  I have adjusted the timing, output ports, interrupts etc for the 5213.  However, the CAN signals that are output from the M5213EVB look a little strange.  I am concerned that the board needs to be configured for correct transceiver operation.  Has anyone had to utilize RCAN1, RCAN2 or the RS pad for standard CAN operation at 125kb? 
 
My current output has the CAN_H and CAN_L at 2.5v but CAN_L drops to 1v and CAN_H only hits 2.75v with an occasional step to 3.5 and then 4v.  I can operate two nodes on the network with the M5213EVB plugged in as long as it is not actively participating in the communications. 
 
Any ideas, suggestions or small test code would be greatly appreciated. 
 
Thank you
Labels (1)
0 Kudos
2 Replies

230 Views
jlpearl
Contributor I
Hi all,  I found that the problem was not the code iteself but that I had the Flash Programmer configured wrong so it was not actually updating the code even when I was changing and recompiling it.  Once I actually started sending my new code to the device everything worked well!
0 Kudos

230 Views
mjbcswitzerland
Specialist V
Hi JL

I have used the 5213EVB and CAN but don't remember having any issues with it.

These are possible port setups:
      PUAPAR |= 0xa0;                                                    // configure UA port 2,3 as CAN
      PASPAR |= 0x0a;                                                    // configure AS port 0,1 as CAN


Then control setups for 40kHz and 1MHz operation respectively:
        CANCTRL = (((1-1) << 24) | RJW_2 | EXTAL_CLK_SOURCE | PROPSEG_BIT_TIME2 | PHASE_BUF_SEG1_LEN3 | PHASE_BUF_SEG2_LEN2); // Initialise the CAN controller with the required speed and parameters

        CANCTRL = (((8-1) << 24) | RJW_2 | EXTAL_CLK_SOURCE | PROPSEG_BIT_TIME8 | PHASE_BUF_SEG1_LEN8 | PHASE_BUF_SEG2_LEN8); // Initialise the CAN controller with the required speed and parameters

That is about all that should be required. Are you sure the transceiver hasn't been damaged?

Regards

Mark

www.uTasker.com

P.S. If you don't have a complete implementation yet, the uTasker project contains CAN support and works on the 5213. It has a simple user interface including remote frame support. See the guide:
www.utasker.com/docs/uTasker/uTaskerCAN.PDF



0 Kudos