Wednesday 16 May 2007

About CAN Bus measurement

When I just joined my present company, I was assigned to work out the measurement methodology for CAN bus system that was deployed in a development project on hand. Basically, the CAN bus is used to communicate voice and control data between handset (with keypad, microphone and LCD display) and mobile radio transceiver. I was excited as I had worked on some other long distance communication systems previously, I knew that CAN bus is very robust against the noise interference and also capable for transmission up to 1KM distance max, though it has quite a marginal tramission rate, i.e. 1.0Mbit/sec max. Anyway, it is more than sufficient for a number of applications which is not data intensive. The opportunity to work more in depth on CAN bus, would allow me the luxury to spend time with this stuff.


Below diagram depicts the overview of the basic CAN bus system deployed. In this system, there consists of two nodes, namely the handset itself and mobile radio transceiver. They are connected via shielded twisted pair wires with Zo of 120 ohm. The differential signalling and shielded twisted pair characteristics would provide a robust resilience toward EMI. EMIcould be notorious in automative environment that the product itself is installed within. We use TI's CAN bus transceiver IC 65HVD230 with 120 ohm differential termination between differential lines. The CAN logic controller resides in a FPGA developed in-house.




For our CAN bus system, we decided to use Vector CANScope as the measurement tool to capture the eye diagram and respective CAN bus data decipher. The reason being the tool could provide a oscilloscope window to display the bus levels and the eye diagram as well. The ability of different trigger condition is also useful. The cost effectiveness of the tool is also an important factor in the purchase decision over other alternative options.


The captured data signal data could look something like below:




In order to design an eye mask for signal integrity evaluation, we would need to finalize the calculation of the bit segments for our product at max length of 40m. Below calculations shown was completed with reference to "CAN Bit Timing Requirements" technical document released by Freescale Semiconductor.

Bit rate = 1M bit per second
Bus length = 40m (or ~130’)
Bus propagation delay = 5.5 ns/ m
Physical Interface (SN65HVD230) transmitter plus receiver propagation delay = 135ns at 85°C

CAN system clock = 16MHz
Physical delay of bus = 40 x 5.5 ns = 220ns
tPROP_SEG=2(220ns + 135ns)= 710ns

A prescaler value of 1 gives a CAN system clock of 16MHz and a Time Quantum of 62.5ns.

This will give 1000 / 62.5 = 16 time quanta per bit.
Prop_seg = round up (710ns/ 62.5 ns) = 12. Therefore, maximum tprop_seg = 750 ns

From 16 time quanta per bit, subtract 12 for PROP_SEG and 1 for SYNC_SEG. This leaves 3 which is the absolute minimum.

The eye mask diagram shown below would be the eye mask used in the CAN signal evaluation based on the calcualations.

1 comment:

Serina Bay said...

great sharing also, please elaborate how to use this in real application, do you have any actual example? and what is the real problem encounter and how to resolve them ? btw, how good is the CAN bus in noise environment?