On 08/11/2010 08:13 PM, Wolfgang Grandegger wrote:
> On 08/11/2010 05:59 PM, Marc Kleine-Budde wrote:
>> Wolfgang Grandegger wrote:
>> [...]
>>
>>>>> However the mainline driver only supports the bus clock.
>>>> and with this clock, if it is 66.5 MHz, one Mbit/s can not be reached.
>>>
>>> OK. Another problem might be that 66.5 MHz does not give *good*
>>> bit-timing parameters as confirmed by my can-calc-bit-timing:
>>>
>>>  $ ./can-calc-bit-timing -c 66500000 flexcan
>>>  Bit timing parameters for flexcan using 66500000Hz
>>>  Bitrate TQ[ns] PrS PhS1 PhS2 SJW BRP SampP Error
>>>  1000000     90   4    3    3   1   6 72.7%  0.8% !!
>>>   800000    180   2    2    2   1  12 71.4%  1.0%
>>>   500000    105   8    7    3   1   7 84.2%  0.0%
>>>   250000    285   8    3    2   1  19 85.7%  0.0%
>>>   125000    571   8    3    2   1  38 85.7%  0.0%
>>>   100000    526   8    7    3   1  35 84.2%  0.0%
>>>    50000   1428   8    3    2   1  95 85.7%  0.0%
>>>    20000   2631   8    7    3   1 175 84.2%  0.0%
>>>
>>> It it's even worse with worse with 24.576MHz:
>>>
>>>  $ ./can-calc-bit-timing -c 24576000 flexcan
>>>  Bit timing parameters for flexcan using 24576000Hz
>>>  Bitrate TQ[ns] PrS PhS1 PhS2 SJW BRP SampP Error
>>>  1000000     40   8    8    8   1   1 68.0%  1.7% !!!!
>>>   800000    122   5    2    2   1   3 80.0%  2.4%
>>>   500000    284   2    2    2   1   7 71.4%  0.3%
>>>   250000    569   2    2    2   1  14 71.4%  0.3%
>>>   125000   1139   2    2    2   1  28 71.4%  0.3%
>>>   100000   1424   2    2    2   1  35 71.4%  0.3%
>>>    50000   1668   7    2    2   1  41 83.3%  0.1%
>>>    20000   5004   5    2    2   1 123 80.0%  0.1%
>>>    10000   7690   8    2    2   1 189 84.6%  0.0%
>>>
>>> Marc, what's happened with your optimized version of
>>> can-calc-bit-timing? Does it find better values?
>>
>> I just noticed that the can-calc-bit-timing is in can-test and an
>> improved version is in can-utils. I commited the improved version to
>> can-utils, but shame on me, 2 month after you've commited the initial
>> version to can-test. What should we do?
> 
> I have not committed any version of can-calc-bit-timing. I did not see
> your version due to some svn update problems. Sorry for the noise.
> 
>> However, the improved algorithm may just find better (i.e. lesser)
>> sample point errors but the bit rate error stays the same.
> 
> The improved algorithm is not what exactly what we have in the kernel,
> right? Anyway, the algorithm will not make anybody happy.

s/anybody/everybody/

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

Reply via email to