On 08/14/2010 07:44 PM, Marc Kleine-Budde wrote:
> Wolfgang Grandegger wrote:
>>>>> I see that you typical use a sample point at 75%.
>>>>> CANopen has a "Recommended location of sample point" at 87.5%. (CiA 301).
>>>> I don't have access to the standard, but [1] lists a sample point of 75%
>>>> for 1000 kbit/s and 80% for 800 kbit/s. All slower bitrates have the
>>>> 87.5% sample point.
> 
>>>> [1] www.can-cia.org/fileadmin/cia/files/icc/9/koppe.pdf
>>> It's from 2003
>>> I hope the list will accept small pictures. 
>>> From CiA301   Version 4.1, 11. April 2007
>>
>> Grrr, our current settings are based on the following mail:
>>
>> https://lists.berlios.de/pipermail/socketcan-core/2008-May/001231.html
>>
>> For backward compatibility, I'm not sure if I want to modify them silently?
> 
> I just checked with the "can-calc-bit-timing". The current algorithm
> find the same bit timing parameters for all can cores, no matter if
> we're using the older or the newer CIA recommendations.

Hm, but not for 1MHz/sec:

$ ./can-calc-bit-timing -b 1000000 sja1000
Bit timing parameters for sja1000 with 8.000000 MHz ref clock
nominal                                 real Bitrt   nom  real SampP
Bitrate TQ[ns] PrS PhS1 PhS2 SJW BRP Bitrate Error SampP SampP Error BTR0 BTR1
1000000    125   2    3    2   1   1 1000000  0.0% 75.0% 75.0%  0.0% 0x00 0x14

$ ./can-calc-bit-timing -b 1000000 -s 875 sja1000
Bit timing parameters for sja1000 with 8.000000 MHz ref clock
nominal                                 real Bitrt   nom  real SampP
Bitrate TQ[ns] PrS PhS1 PhS2 SJW BRP Bitrate Error SampP SampP Error BTR0 BTR1
1000000    125   3    3    1   1   1 1000000  0.0% 87.5% 87.5%  0.0% 0x00 0x05

I'm actually thinking to printout some kind of warning if
1 MHz/sec is seleceted, e.g.:

  dev_warn(dev, "New CIA recommended sample point of 0.875 used");

Wolfgang.
_______________________________________________
Socketcan-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/socketcan-users

Reply via email to