linux
Examples of bit rate settings

There is a bit timing calculator available here: http://www.kvaser.com/archive/kvaser.


// 500 kbit/s, using library-supplied default values
stat = canSetBusParams(hnd, BAUD_500K, 0, 0, 0, 0, 0);

// 125 kbit/s, tseg1=4, tseg=3, sjw=2, one sample
// tseg1=4 means 4+1=5 quanta will preceed the sampling point.
// tseg2=3 means 3 quanta will follow the sampling point.
// The sampling point will occur when 5/(5+3) = 62,5% of the bit has passed.
stat = canSetBusParams(hnd, 125000, 4, 3, 2, 1, 0);

// 83333 kbit/s, sapmling point 75%, sjw=2, one sample
stat = canSetBusParams(hnd, 83333, 5, 2, 2, 1, 0);

Related Topics

canSetBusParams
canGetBusParams