I think the board you are writing about is ZK-S12-B which contains CAN0 and CAN4 connected to the CAN transceivers MC33388.
The necessary parameters for calculation are described in the AN1798 - CAN Bit Timing Requirements.
(http://www.freescale.com/files/microcontrollers/doc/app_note/AN1798.pdf)
In order to provide some data I'll suppose some input parameters. If you use other parameters, transceiver,… do not hesitate to reply.
I'll suppose you use oscillator clock 16 MHz as a source clock for the CAN modules.
The Physical Interface MC33388D has Tx+Rx prop. delay = 1000 ns and it is designed for communication speed up to 125 kbaud.
INPUTS
fosc = 16 [MHz]
required can speed : fNBT = 125000 [bit/s]
bus propagation delay = 5 [ns/m]
bus length = 0,5 [m]
entire bus propagation delay = 2,5 [ns]
Physical Interface Tx+ Rx propagation delay 1000 [ns]
Overall Propagation Delay = 2005 [ns]
For these inputs and 125kbps bitrate the setup is:
CANBTR0 = 0xC7
CANBTR1 (3 sample per bit) = 0xD8
required oscillator tolerance [%] = 1.21%
However, I have some suggestion how to use the communication between CAN0 and CAN4 without usage of transceivers just by means of direct connection between MCU's CAN Rx,Tx pins. Plese look at CAN without Transceiver-siemens_AP2921, figure 2 (http://www.mikrocontroller.net/attachment/28831/siemens_AP2921.pdf)
For such a connection you can use following setup:
INPUTS
fosc = 16 [MHz]
required can speed : fNBT = 500000 [bit/s]
bus propagation delay = 5 [ns/m]
bus length = 0,5 [m]
entire bus propagation delay = 2,5 [ns]
Physical Interface Tx+ Rx propagation delay 150 [ns]
Overall Propagation Delay = 305 [ns]
CANBTR0 = 0xC1
CANBTR1 (3 sample per bit) = 0xE7
required oscillator tolerance [%] = 1.25%
Moreover, if I am wrong and your board contains some interface which is able o work up to 1Mbit then such interfaces have propagation delay approximately 150~250 ns.
- Interface PCA82C250 Tx+Rx prop. delay at 85C = 150 [ns] 1 Mbaud
- Interface MC33989 Tx+Rx prop. delay at 85C = 220 [ns] 1 MBaud
- Interface MC33388D Tx+Rx prop. delay = 1000 [ns] 125 kbaud
- Interface TJA1054T, PCA82C252T, TJA 1053T Tx+Rx prop. delay = 950 [ns] 125 kbaud
- Interface TJA1041T, PCA82C252T, TJA 1053T Tx+Rx prop. delay = 255 [ns] 1 MBaud
- Interface TJA1040 Tx+Rx prop. delay = 255 [ns] 1 MBaud
- Interface TLE6250G Tx+Rx prop. delay = 280[ns] 1 MBaud
- Interface TJA1050 Tx+Rx prop. delay = 250[ns] 1 MBaud
Some calculations for the same setup and different RxTx delays.
fosc = 16 [MHz]
required can speed : fNBT = 500000 [bit/s]
bus propagation delay = 5 [ns/m]
bus length = 0,5 [m]
entire bus propagation delay = 2,5 [ns]
Overall Propagation Delay = 305 [ns]
1) Physical Interface Tx+ Rx propagation delay 150 [ns]
CANBTR0 = 0xC1
CANBTR1 (3 sample per bit) = 0xE7
required oscillator tolerance [%] = 1.25%
2) Physical Interface Tx+ Rx propagation delay 220 ~ 255[ns]
CANBTR0 = 0xC1
CANBTR1 (3 sample per bit) = 0xD8
required oscillator tolerance [%] = 1.219%
3) Physical Interface Tx+ Rx propagation delay 280 [ns]
CANBTR0 = 0xC1
CANBTR1 (3 sample per bit) = 0xC9
required oscillator tolerance [%] = 1.216%
Best regards,
Ladislav