Adapter settings verification

This forum covers PCAN-Linux and Linux development issues concerning our products
Post Reply
A. Cristea
Posts: 5
Joined: Mon 28. Jan 2019, 15:17

Adapter settings verification

Post by A. Cristea » Mon 13. May 2019, 10:19

Hi,

I'm trying to find out if my adapter settings are correct because i have sometimes errors when sending messages. I use the PCAN-miniPCIe (IPEH-003049) on Ubuntu 16.04 with socketcan.

in /etc/network/interfaces it is set up like:

Code: Select all

auto can0
  iface can0 inet manual
  pre-up /sbin/ip link set can0 type can bitrate 250000 restart-ms 75
  up /sbin/ifconfig can0 up
  down /sbin/ifconfig can0 down
Resulting to this:

Code: Select all

$ ip -details link show can0
4: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UP mode DEFAULT group default qlen 10
    link/can  promiscuity 0 
    can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 75 
	  bitrate 250000 sample-point 0.875 
	  tq 250 prop-seg 6 phase-seg1 7 phase-seg2 2 sjw 1
	  sja1000: tseg1 1..16 tseg2 1..8 sjw 1..4 brp 1..64 brp-inc 1
	  clock 8000000
How can i verify that SAMPLE_POINT, TQ, PROP-SEG, PHASE-SEG1, ... are set correctly for my adapter?

Thanks,
Best regards

M.Maidhof
Support
Support
Posts: 1753
Joined: Wed 22. Sep 2010, 14:00

Re: Adapter settings verification

Post by M.Maidhof » Mon 13. May 2019, 10:35

Hi,

best solution will be to set the bitrate parameters to the exact values of your CAN bus system, to which you connect the device.

See: https://www.kernel.org/doc/Documentatio ... ng/can.txt

Section 6.5.1 on how to set the parameters.

regards

Michael

A. Cristea
Posts: 5
Joined: Mon 28. Jan 2019, 15:17

Re: Adapter settings verification

Post by A. Cristea » Mon 13. May 2019, 12:16

Hi,

so if I set up as I did, there is no need to care about the used chip (sja1000?) and the used oscillator frequency inside the adapter?

br

M.Maidhof
Support
Support
Posts: 1753
Joined: Wed 22. Sep 2010, 14:00

Re: Adapter settings verification

Post by M.Maidhof » Mon 13. May 2019, 13:57

Hi,

oscillator frequency will only be relevant for PCAN-FD hardware, but not for SJA1000 based CAN hardware (oscillator frequency fixed on 8Mhz). But you still have to take care for samplepoint, sjw etc. with SJA1000 based CAN hardware.

In your setup you use a sp of 87,5%, try to use a sp of 75% instead.

regards

Michael

Post Reply