Such a simple math error.
Alan's formula is:
Baudrate = fCAN / ((BRP + 1) * (1 + TSeg1 + TSeg2))
and clearly TSeg1 and TSeg2 are integers as is the number '1' in the formula above.
if you want to work in micro seconds or seconds then it's important to multiply all terms with the same constant.
If you multiply TSeg1 and TSeg2 by 0.0000004 then it's important to also multiply the rest of the numbers by that constant.
Substituting, I get
Baudrate = 40,000,000 / ((15 + 1) * (1 + (5+4)))
= 250,000
Baudrate = 40,000,000 / ((15 + 1) * (1 + (5+4)))
= 250,000
Automation Artisans Inc.
http://www.autoartisans.com/ELS/
Ph. 1 250 544 4950