Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

CAN Transceiver MCP2551

I have bought a new NI-CAN USB 8473s and I want to do bus monitoring with other nodes based on CAN devices. These nodes were developed with mcp2551 transceiver. I have some problem when I connected the CAN_H and CAN_L of the mcp2551 to COMBICON 5-pin connectors of the NI CAN Breakout box, but  there was no message appeared in the Bus Monitoring dialog box.  The 8473s was in listen mode  after I checked the 'listen' checkbox. For your info, I had done an experiment with 3 nodes using mcp2551 and it was working. Any idea how to solve this problem.

 

 

0 Kudos
Message 1 of 9
(10,458 Views)

Howdy,

 

The listen only mode prevents the NI-CAN device from ACK CAN messages. On a CAN bus you need at least two active devices on the bus. When you connected to the bus of the MCP2551s where you connected to all three at once, or just one? If just one, can you try disabling the listen only mode of the 8473?

 

Also, when connecting to a CAN bus besure to honor the cabling requirements and termination resistances. More information about what is required can be found in the NI-CAN Hardware and Software Manual in Chapter 4.

Joshua B.
National Instruments
0 Kudos
Message 2 of 9
(10,445 Views)

Dear Joshua

 

I have followed all the intructions as well as in the manual but it gave me errors as follows:

 

 

frame error.jpg

The experiment setup of the system is attached

 

setup.jpg

 

The speed of the CAN bus is 500kbps and disabled the 'listen only' on Bus monitor

 

For your info, all the 3 mcp2551s can communicate each others without CAN breakout box.

 

Any ideas how to solve it.

 

Regards

fairuz

 

0 Kudos
Message 3 of 9
(10,421 Views)

Your Error Frame contains:

Comm State = 0x01 ===> Error Passive

Transmit Error Counter = 0x00 ===> Expected since you are not transmitting anything

Receive Error Counter = 0x87 ===> The reason for error passive, the Rx error counter is increasing

SJA1000 ECC Register = 0x77= 0b01110111

   7.6 = Error Code = 0b01 = Form Error

     5 = Direction = 0b1 = Reception

  4:0 = Segment = 0b10111 = Error Delimiter

 

I have to say, that is a strange error. This means that the SJA1000 detected an error frame, but with an invalid error delimeter. Since you say that the other nodes can communicate correctly, I would have to make a guess that this could be a baud rate issue.

 

What CAN controller are you using and how are you configuring it to 500k?

0 Kudos
Message 4 of 9
(10,414 Views)

I'm uing PIC18F458 with CAN controller inside. The configuration of the speed as follows:

 

Speed: 500kbps, Crystal Clock: 20MHz

 

 

Bit Timing Setup in Tq

Propagation Delay (Prop_Seg)= 1

Phase Segment 1(Phase_Seg1) = 5

Phase Segment 2(Phase_Seg2) = 3

Syncronization Jump Width (SJW) = 1

 

Selected Options

Baud Rate Prescaler (BRP) =  1

Sample Point = 70% of bit time

Number of Time Quanta = 10

 

0 Kudos
Message 5 of 9
(10,405 Views)

The default baud rates of the NI-CAN can controllers are:

 Tq = 125ns (8Mhz Crystal)
 Sync = 1 * Tq = 125ns
 TSEG1 = (12 + 1) = 13 * Tq = 1625 ns
 TSEG2 = (1 + 1) = 2 * Tq = 250ns
 Total bit time = 1 + 13 + 2 = 16 * Tq = 200ns = 500k bus

 

Sample point is 14/16 = 87.5%

 

If you want to match your baud rates to the CAN controller, you will need to set a custom baud rate so that the NI-CAN controller uses the same bit timings. The key thing will be to match the sample time of 70%.

 

NI-MAX has a mode where you can go through a graphical program to find out the custom bit timing value to change it to 70%.

0 Kudos
Message 6 of 9
(10,400 Views)

Might also be worth verifying the termination resistance as seen by the 8473 and that a CAN Hi and CAN Lo haven't been swapped over somewhere in the breakout box.

0 Kudos
Message 7 of 9
(10,397 Views)

Could you please show me the graphical program in NI MAX for customising bit timing value. I cannot find it

0 Kudos
Message 8 of 9
(10,386 Views)

Hi fairuz,

 

Attached is a screenshot of the MAX port properties.

Joshua B.
National Instruments
0 Kudos
Message 9 of 9
(10,337 Views)