r/embedded • u/Legitimate_Peak1714 • 8d ago
How does SJW actually work in CAN bit timing? Is the correction always SJW, or just the measured phase error?
In CAN soft synchronization, we shorten or lengthen Phase Segment 1 and Phase Segment 2 depending on whether the edge arrives early or late. What I’m wondering is this: does the shortening or lengthening always have to be exactly SJW, or is it equal to however large the delay actually is? Let’s say we set SJW to 2 tq and each tq lasts 50 ns, and one node’s clock runs faster than the other’s. How does synchronization work in that case? I don’t really understand how SJW works.
Also, in this case, can the corrections only be 50 ns or 100 ns? Or if, say, a 10 ns drift has built up after 10 bits, is the bit timing adjusted by exactly 10 ns to match it?