Quantcast
Channel: Infineon Forums
Viewing all articles
Browse latest Browse all 9892

XMC 4200 CAN Bit Timing

$
0
0
Hi,

I am trying to configure the CAN Module of my XMC4200.

I followed the MutliCAN application note. In my main function I send a message every 100ms.
My ECU is connected to a PCAN Usb dongle.

Now the problem:
I can only receive error frames. (stoff error, other errors).
The bit timing must be the problem.
This is what my bit timing config looks like:

Code:

XMC_CAN_NODE_NOMINAL_BIT_TIME_CONFIG_t CanBaud_cfg=
{
                .can_frequency = CAN_FREQUENCY_80,                // fCAN=80MHz
                .baudrate = (1000 * 500),                                // baudrate=500K
                .sample_point = (8000),                        // Sample point=80%
                .sjw = 2                                                        // SJW=1+1
};

In the CAN Init function I call the XMC function: XMC_CAN_NODE_NominalBitTimeConfigure(CAN_NODE1, &CanBaud_cfg);

Per brute force in noticed that with the following bit timing config, I can receive messages, but there are still many errors:

XMC_CAN_NODE_NOMINAL_BIT_TIME_CONFIG_t CanBaud_cfg=
{
.can_frequency = 65000000, // fCAN=120MHz
.baudrate = (1000 * 500), // baudrate=1000K
.sample_point = (10000), // Sample point=87,5%
.sjw = 1 // SJW=1+1
};

The strange thing is that my Global CAN Node is initialized to 80Mhz. How is this possible? I need a bit timing where I have no error frames.

Viewing all articles
Browse latest Browse all 9892

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>