On 01.10.2010 18:55, Uwe Bonnes wrote:
>>>>>> "Ewgenij" == Ewgenij Sokolovski <[email protected]> writes:
> 
>     Ewgenij> Hmm, and what is the way to compute the value of the parameter?
>     Ewgenij> Why the value for 100 kbit/s is 0x4914? I need 500 kbit/s and
>     Ewgenij> 125 kbit/s...  BR Ewgenij
> 
> Did you have a look at the pEAK documentation. There is a list of values to
> set... 

There's also a tool in the SocketCAN SVN that gives correct settings for the
SJA1000 bittiming registers (BTR) :


u...@host:~/socketcan/trunk/can-utils$ ./can-calc-bit-timing
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
 800000    125   3    4    2   1   1  800000  0.0% 80.0% 80.0%  0.0% 0x00 0x16
 500000    125   6    7    2   1   1  500000  0.0% 87.5% 87.5%  0.0% 0x00 0x1c
 250000    250   6    7    2   1   2  250000  0.0% 87.5% 87.5%  0.0% 0x01 0x1c
 125000    500   6    7    2   1   4  125000  0.0% 87.5% 87.5%  0.0% 0x03 0x1c
 100000    625   6    7    2   1   5  100000  0.0% 87.5% 87.5%  0.0% 0x04 0x1c
  50000   1250   6    7    2   1  10   50000  0.0% 87.5% 87.5%  0.0% 0x09 0x1c
  20000   3125   6    7    2   1  25   20000  0.0% 87.5% 87.5%  0.0% 0x18 0x1c
  10000   6250   6    7    2   1  50   10000  0.0% 87.5% 87.5%  0.0% 0x31 0x1c

(..)

There you can see 0x001C for 500kBit/s (which is the default in the PEAK 
driver).

For your 125kBit/s bus you need to use 0x031C

AFAIK there's also a bitrate calculation tool for MS Win on the PEAK site.

Regards,
Oliver

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

Reply via email to