This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


Set bit timing rate of CAN channel




configBusSpeed(canch,busspeed) sets the speed of the CAN channel in a direct form that uses baseline bit timing calculation factors.

configBusSpeed(canch,busspeed,sjw,tseg1,tseg2,numberofsamples) sets the speed of the CAN channel canch to busspeed using the specified bit timing calculation factors to control the timing in an advanced form.

Input Arguments


CAN channel object that you want to set the bit timing rate for


Bit timing rate specified in bits per second for the identified object


Synchronization jump width. This value is the maximum value of time bit adjustments


Length of time at the start of the sample point within a bit time


Length of time at the end of the sample point within a bit time


Specified count of bit samples used


To configure the bus speed using baseline bit timing calculation, type:

canch = canChannel('Vector','CANCaseXL 1',1)

To specify the bit timing calculations, type:

canch = canChannel('Kvaser','USBcan Professional 1',1)


  • Unless you have specific timing requirements for your CAN connection, use the direct form of configBusSpeed. Also note that you can set the bus speed only when the CAN channel is offline. The channel must also have initialization access to the CAN device.

  • Synchronize all nodes on the network for CAN to work successfully. However, over time, clocks on different nodes will get out of sync, and must resynchronize. SJW specifies the maximum width (in time) that you can add to tseg1 (in a slower transmitter), or subtract from tseg2 (in a faster transmitter) to regain synchronization during the receipt of a CAN message.

See Also

Introduced in R2009a

Was this topic helpful?