Hello,
I have modified the sample code with the below, for
PCAN_BITRATE_SAE_J2284_4 = create_string_buffer(b'f_clock=80000000,nom_brp=1,nom_tseg1=5,nom_tseg2=2,nom_sjw=2,data_brp=2,data_tseg1=7,data_tseg2=2,data_sjw=1')
as per APIs, write is successful, but no data is seen on PCAN view
PCAN-ISO-TP API Version: b'3.5.0.344'
Initialize transmitter: OK
Create a receive event on receiver: OK
Allocate tx message: OK
Allocate rx message: OK
Initialize tx message: OK
Write "42" message: OK
Wait a message on receiver: KO
Free tx message: OK
Free rx message: OK
Stop receive event on receiver: OK
Close receive event: OK
Uninitialize transmitter: OK
Can you please help/guide.
Regards
Anand Pujari
Unable to write CAN-FD data
Unable to write CAN-FD data
- Attachments
-
- can-fd.png (107.69 KiB) Viewed 3584 times
Re: Unable to write CAN-FD data
Hello,
this question is kind of duplicated. As I already answered you in your topic Unable to view the data on the PCAN-View, all participants need to have exact the same bit rate. SAE J2284-4 doesn't use 1MB for nnominal, as you are showing in your PCAN-View picture.
this question is kind of duplicated. As I already answered you in your topic Unable to view the data on the PCAN-View, all participants need to have exact the same bit rate. SAE J2284-4 doesn't use 1MB for nnominal, as you are showing in your PCAN-View picture.
Best regards,
Keneth
Keneth
Re: Unable to write CAN-FD data
Hello,
I have used the same variable "PCAN_BITRATE_SAE_J2284_4" to set the clock.
But my end controller is using 1mbps. So to match the 80000000 Hz clock, I have modified the clock. Sample code, and PCAN View are all on the same configuration.
Also when I execute the sample code with the modified configuration, the led stay green only. I am attaching the modified code here.
I have used the same variable "PCAN_BITRATE_SAE_J2284_4" to set the clock.
But my end controller is using 1mbps. So to match the 80000000 Hz clock, I have modified the clock. Sample code, and PCAN View are all on the same configuration.
Also when I execute the sample code with the modified configuration, the led stay green only. I am attaching the modified code here.
- Attachments
-
mod_canfd_read_write.txt
- (4.61 KiB) Downloaded 1238 times
Re: Unable to write CAN-FD data
Hello,
Please note that the bit rate parameters you are using (f_clock=80000000,nom_brp=1,nom_tseg1=5,nom_tseg2=2,nom_sjw=2,data_brp=2,data_tseg1=7,data_tseg2=2,data_sjw=1) correspond to a bit rate of 10 Mbit/nominal and 4 MBit/s data. This makes at least for me no sense and it is also not 1MB as your controller is using.
I still do not think this is the case. It is as it always has been, you have a bit rate problem. The red marked part in you post let me know that you are not sure how to define or calculate a bit rate. So I keep my last answer as current answer:
Best regards,
Keneth
Keneth
Re: Unable to write CAN-FD data
Hello,
I am using the setting provided by the PCAN for 1Mbps nominal and 2Mbps for data. Please see the attachment. If its not correct can you please help me with the exacting setting for the clock for 1Mbps nominal and 2Mbps for data.
I am using the setting provided by the PCAN for 1Mbps nominal and 2Mbps for data. Please see the attachment. If its not correct can you please help me with the exacting setting for the clock for 1Mbps nominal and 2Mbps for data.
- Attachments
-
- clock setting from PCAN.png (102.62 KiB) Viewed 3559 times
Re: Unable to write CAN-FD data
No. You are not. Here is a picture of your own code (file mod_canfd_read_write.txt) As you can see, these are not the same paraemters you are shwoing us in the PCAN-View picture. I have already shown that these values represent a different bit rate in my previous post.
Do you know the exact bit rate parameters used by your device? As long as you do not know this value, it makes no sense to configure anything in your code, because this will potentially never work. The 1 MB bit rate can have several configurations. For example, our Bit rate Calculation tools lists 700 possible values for the combination 1MB/2MB:
Again, if this is not exact the same bit rate, it will not work (even when they represent both 1 MB).
- Open the connection windows of PCAN-View,
- Select the device you want to connect
- In the "CAN Setup" tab, select "Mode: ISO CAN FD", "Clocl Frequency: 80 MHz", "Bit Rate Preset: None", "Nominal Bit rate"/"Database Entry: 1 MBit/s", "Data Bit rate"/"Database Entry: 2 MBit/s"
- Copy the whole value by using the copy button located in the nominal or data bit rate area (any of them copy the whole bit rate string)
- Use that string in your code for connecting the channel
I have written all information already about bit rate. Please understand tha this is not our work to help you finding a configuration of your devices. The PCAN device works, the API works and PCAN-View works. It is up to you to configurate things correctly. Thanks for your understanding.
Best regards,
Keneth
Keneth