|
CAN programming interface environment
Version 3.10
|
To ensure correct sampling up to the last bit, a CAN node needs to resynchronize throughout the entire frame. This is done at the beginning of each frame with the falling edge SOF and on each recessive-to- dominant edge.
One CAN bit time is specified as four non-overlapping time segments. Each segment is constructed from an integer multiple of the time quantum. The time quantum (TQ) is the smallest discrete timing resolution used by a CAN node. The four time segments are:
The sample point is the point in time at which the bus level is read and interpreted as the value (recessive or dominant) of the respective bit. Its location is at the end of Phase Segment 1 (between the two Phase Segments). Programming of the sample point allows “tuning” of the characteristics to suit the bus. Early sampling allows more Time Quanta in the Phase Segment 2 so the Synchronization Jump Width can be programmed to its maximum. This maximum capacity to shorten or lengthen the bit time decreases the sensitivity to node oscillator tolerances, so lower cost oscillators such as ceramic resonators may be used. Late sampling allows more time quanta in the Propagation Time Segment, which allows a poorer bus topology and greater bus length. To allow interoperability between CAN nodes from different vendors, it is essential that both the absolute bit length (e.g., 1 microsecond) and the sample point are within certain limits. The following table gives an overview of recommended bit‑timing setups.
| Bit rate | Bit time | Valid range for sample point location |
Recommended sample point location |
| 1 MBit/s | 1µs | 75% .. 90% | 87.5% |
| 800 kBit/s | 1.25µs | 75% .. 90% | 87.5% |
| 500 kBit/s | 2µs | 85% .. 90% | 87.5% |
| 250 kBit/s | 4µs | 85% .. 90% | 87.5% |
| 125 kBit/s | 8µs | 85% .. 90% | 87.5% |
| 50 kBit/s | 20µs | 85% .. 90% | 87.5% |
| 20 kBit/s | 50µs | 85% .. 90% | 87.5% |
| 10 kBit/s | 100µs | 85% .. 90% | 87.5% |
The default bit rates defined in this table can be set via the core function CpCoreBitrate(). The supplied parameter for the bit rate selection is taken from the enumeration CpBitrate_e (canpie.h).