using CAN_InitializeFD api in linux

This forum covers PCAN-Linux and Linux development issues concerning our products
Post Reply
shaibg
Posts: 1
Joined: Thu 7. May 2020, 17:05

using CAN_InitializeFD api in linux

Post by shaibg » Thu 7. May 2020, 17:52

Hi,
I'm using peak_basic api (in c language on linux).
Till today I used the CAN_Initialize function api since I worked only with the classical can messages.
Now I would like to work with can FD messages as well.
I have some questions regarding it:
1. Is the FD api backward compatible? I mean can I use CAN_InitializeFD to work with can FD messages as well as classical can messages?
2. If the answer for 1 is yes, then should I change the parameters for CAN_InitializeFD each time to work for both FD and classical can messages?

The second parameter for the CAN_InitializeFD function is a string that contains parameters:
f_clock=80000000,nom_brp=2000,nom_tseg1=5,nom_tseg2=2,nom_sjw=1,data_brp=4,data_tseg1=7,data_tseg2=2,data_sjw=1

What are tseg, sjw stand for and how would I know what values to fill them in order to work with both classical and FD can messages.

I saw some examples online, but I didn't find an explanation how would I know what values to use in order it to work and if someone try to use the CAN_InitializeFD to work also with classical can messages (not the fd can messages).

I would appreciate your help.

Thanks,
Shai

User avatar
PEAK-Support
Sales & Support
Sales & Support
Posts: 1646
Joined: Fri 10. Sep 2010, 19:34

Re: using CAN_InitializeFD api in linux

Post by PEAK-Support » Fri 8. May 2020, 07:55

You also could use the new CAN FD Hardware to run within a CAN2.0a/b network, as long as you do not set the Fast Data Bitrate in the CAN Message and do not use DLC>8. The Timing in CAN FD Networks is very criticall when you use the BRS (Bit Rate Switch) and so use a higher Butrate for the Data Block of the CAN Frame.

More info how to setup a CAN FD Network could be found on the WEB. You also could use our Bitrate Calculation Tool, which have, as a result, your needed string.
See Support section on our WEB page - Section Software. The Tool is available for iOS, Android Phone and Windows..
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------

Post Reply