Kurt Van Dijck wrote:
> On Tue, Mar 09, 2010 at 01:39:53PM +0100, Wolfgang Grandegger wrote:
>> Schubert, Thorsten wrote:
>>> I am struggling with the CAN bit-timing. I implemented an SJA1000 driver
>>> on top of the SJA1000 kernel module which comes with Linux 2.6.31. So
>>> far it
>>> seems to work except that the bitrate is off by factor two, i.e. a
>> To be clear here, for the SJA1000 you have to set "priv->can.clock.freq"
>> to half of the oscillator frequency, e.g. to 8000000 for 16MHz. This is
>> actually the frequency before the pre-scaler, which is used by the
>> bit-timing calculation algorithm. This is special to the SJA1000.
>>
> [...]
>> values. To avoid further confusion, we might think of adding a field
>> .brp_div, which we would set to "2" for the SJA1000. All other (or
>> most?) CAN controllers would use "1".
> ack. This would avoid confusion.
> ... added in struct can_bittiming_const would be my guess.

Is it worth the effort? Only the SJA1000 will need it, IIRC.

> '.freq_div' maybe? to avoid confusion with 'brp' stuff.

Ah, of course. In my early versions I used ".fix_div".

Wolfgang.

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

Reply via email to