VH6501 Segment Length Calculation
How can I calculate the segment length for VH6501 disturbance interface based on CAN bit rate?
Example calculation for CAN bus bit rate of 500 kbit/s:
1 FPGA tick of the VH6501 Hardware takes 6.25 ns (nanoseconds), which leads with a bit rate of 500 kbit/s to a bit time of 2 µs:
Bit time calculation:
bit time = 1 / bit rate = 1 / 500 kbit/s = 0.002 ms = 2µs
Segment length calculation:
Segment length = bit length / tick length = 2 µs / 6.25 ns = 2000 ns / 6.25 ns = 320
The segment length in VH6501 is 320 given a bit rate of 500 kbit/s.
In CAPL this can be implemented as follows:
result = sequence.AppendToSequence(320, 'R'); // AppendToSequence(word segmentLength, char segmentValue);
The above calculation is applicable only for VH6501 CAN disturbance interface.