2
\$\begingroup\$

I have a CAN-BUS line communicating at 50kb/s speed. There are only 2 products communicating with each other on the CAN-BUS line. One of these products has the STM32L496RGT MCU (the clock speed of the CAN module (APB1) is 80Mhz.)enter image description here and the other one has the STM32F072 MCU (the clock speed of the CAN module (APB1) is 16Mhz).enter image description here STM32L496RGT's CAN prescaler value is 100, time segment 1 value is 13, time segment 2 value is 2 and sample point is 87.5%. STM32F072RB's CAN prescaler value is 20, time segment 1 value is 13, time segment 2 value is 2 and sample point is 87.5%. SN65HVD232 is used as CAN-Bus transceiver in both products. In addition, 120 ohm limiting resistors are added at both ends of the line. I have added the schematic of the CAN-BUS module, which is the same in both my products.enter image description here The inductance of ACT45B coil at 50kHz is 100uH. The cutoff frequency of my low pass filter is 750kHz.I use split termination as termination type. In addition to these, I add the print circuit layouts of the CAN modules of the products.enter image description hereenter image description here 5. and 8. legs of the Transciever integrated are not connected legs. The schematic is taken from another version of the product.First one is generally transmitter one. The second one is generally receiver. I also use 1 meter of insulated twisted pair cable.

My problem occurs when the products are operating at 70-75 ° C ambient temperature. I monitor and log the line with kvaser can bus analyzer.As far as I follow from the temperature sensors on the products, even error frames start to occur when they reach 55-60 degrees. However, the TEC register starts to increase by 8 by 8. Even though TEC decreases one by one every time the correct message arrives, the error frames that come continuously make TEC 255.When TEC register is 255, naturally the line bus is off. STM32s have automatic bus off recovery feature. I enabled this feature. Every time TEC register is 255, ABOM (Auto bus off management) puts the line back into transmission. However, because the error frames are constantly coming, the line becomes bus off state again.LEC is bit recessive error in case of this times.

Except for the terminating resistor in the line, I removed all filter elements and tried again, but the same situation occurred.I adjusted the line to many speeds and tried it, and again I encountered the same situation.

Wavelengths are as follows. enter image description here

What could cause this situation?

\$\endgroup\$
10
  • \$\begingroup\$ What is the clock source for the microcontrollers, and are you sure it is configured properly? \$\endgroup\$
    – Justme
    Commented Nov 21, 2020 at 10:44
  • \$\begingroup\$ You appear to have not asked a question. Actually framing your thoughts into a question can be beneficial to resolving the issue you are trying to solve. This is a Q and A site and it needs a question in order to get answers. \$\endgroup\$
    – Andy aka
    Commented Nov 21, 2020 at 10:44
  • \$\begingroup\$ I thought I explained my problem very well. But now I've added a Q.Thanks @Andyaka \$\endgroup\$
    – ali.ozkan
    Commented Nov 21, 2020 at 11:00
  • \$\begingroup\$ I mentioned the speed of both processors in the problem. I think maybe you missed it. One of these products has the STM32L496RGT MCU (the clock speed of the CAN module (APB1) is 80Mhz.) And the other one has the STM32F072 MCU (the clock speed of the CAN module (APB1) is 16Mhz). @Justme \$\endgroup\$
    – ali.ozkan
    Commented Nov 21, 2020 at 11:02
  • \$\begingroup\$ What do the waveforms look like? \$\endgroup\$
    – Andy aka
    Commented Nov 21, 2020 at 11:03

1 Answer 1

3
\$\begingroup\$

Internal oscillators have larger tolerance and temperature drift than what is required for stable CAN communications.

For example, the F072 HSI8 has 2% tolerance over temperature range from 0 C to 70 C.

Depending on which CAN specs are being used, they either allow up to 0.5% or 1.5%.

In practice, at least a ceramic resonator should be used for CAN communications, preferably a crystal.

\$\endgroup\$
5
  • \$\begingroup\$ Thanks for your answer. I will try it with the external osilator. @Justme \$\endgroup\$
    – ali.ozkan
    Commented Nov 21, 2020 at 12:39
  • \$\begingroup\$ Today I had two more attempts to troubleshoot. It even finds STM32F072 in case of buyer. I replaced the transmitter STM32L496 with another STM32F072. I set the speed of the new transmitter to 48Mhz. Clock source became HSI48 again. I did not encounter any problems when I tested it this way. @Justme \$\endgroup\$
    – ali.ozkan
    Commented Nov 21, 2020 at 12:40
  • \$\begingroup\$ Other than that, I used STM8S208 as a transmitter again. I set the speed to 2Mhz. Clock source I used HSIRC 16Mhz (DIV8) again. Again, there was no problem in communication in the heat. I am having a problem with my product with STM32L496. Could there be another additional reason why I have this problem with the STM32L496 version and not others have this problem?@Justme \$\endgroup\$
    – ali.ozkan
    Commented Nov 21, 2020 at 12:40
  • 1
    \$\begingroup\$ Internal oscillators of different devices have manufacturing tolerances and their frequency deviation as a function of temperature will vary. So two devices A and B might both drift a lot, but their difference might stay within tolerance band of CAN operation between them, but a third device C might not work with them. \$\endgroup\$
    – Justme
    Commented Nov 21, 2020 at 13:11
  • 1
    \$\begingroup\$ Thank you for answering. I do not have a chance to use an external osilator as I do not have the chance to make changes to the product's print circuit right now. But I solved the problem for now. I chose HSI 16Mhz as the clock source. With this selection, I have reduced the PLL multiplier value from 40 to 10. In this way, I tried to reduce the change of the MCU's clock source due to environmental factors. The CAN-BUS line has now been running smoothly at 80C degrees. But as a permanent solution, we should definitely use external clock source as you said. @Justme \$\endgroup\$
    – ali.ozkan
    Commented Nov 25, 2020 at 12:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.