I converted the CAN_EXAMPLE_S32k344 to run in normal mode, but despite the oscilloscope showing a can transmission waveform it is not being picked up by a can485 board from adafruit I am using as a receiver. https://learn.sparkfun.com/tutorials/ast-can485-hookup-guide/all#example-simple-can-network
The blocking send always just times out.
Can someone look at the waveforms I have and tell me what is wrong? I changed the message Id to 200 but I don't think that should break anything. Have I set my segments wrong? I dont know how exactly I am supposed to distribute it just that I am working on 250k bps
canbus high
canbus low
output from oscilloscope
flexcan settings and baud rate
解決済! 解決策の投稿を見る。
It appeared to be a clock issue as editing the protocol clock to 16mhz instead of 24mhz (I have a 16mhz oscillator connected so I assume this was the issue), and adjusting the segments fixed it
Hi @pb632146.
As per your explanation, it seems that your S32K344 as transmitter is working just fine, therefore I would suggest to check on your receiver device or circuitry given that the transmitter is indeed generating an output signal.
Note: If you would like to test if your CAN module is working correctly, you can run an example code on your EVB (Evaluation Board) where you can use a "loopback" function, which makes the CAN module send information to its own receiver.
- RomanVR.
As a clarification I am using a 342 board so I had to edit the code a bit but also its it own transceiver which doesnt need to be enabled like the one on the 344evb. https://ww1.microchip.com/downloads/aemDocuments/documents/OTH/ProductDocuments/DataSheets/20005991B...
The sparkfun board receiver does work when I use another of the same board, but does not pick up the can messages from my 342 board, despite using the same transceiver.
Are there any considerations I might be missing trying to send a can message between this and the arduino code?
What do classic can/can fd mean relative to can 2.0a and can 2.0b? Are there specific settings to choose one or another in either the peripherals tab or the code itself?
Hi @pb632146
Thank you for confirming that your FlexCan Driver is working properly.
FlexCAN is a communication controller implementing the CAN protocol according to the ISO 11898-1:2015 standard and CAN 2.0 Part B protocol specifications. For more detailed information, I suggest referring to Chapter 73 (CAN (FlexCAN)) of the S32K3xx Reference Manual, Rev. 9.
Additionally, I recommend reviewing the S32K3 CAN_43_FLEXCAN Driver Integration Manual and the User Manual included with the RTDs. These documents provide detailed information about the driver, including its limitations, hardware and software requirements, usage instructions, and configuration guidelines. They will be helpful for gaining a deeper understanding of the driver's functionality. You can find these resources at the following location:
C:\NXP\SW32K3_S32M27x_RTD_4.4_4.0.0_P24\eclipse\plugins\Can_43_FLEXCAN_TS_T40D34M40I0R0\doc
Or
C:\NXP\S32DS.3.5\S32DS\software\PlatformSDK_S32K3\RTD\Can_43_FLEXCAN_TS_T40D34M30I0R0\doc
- RomanVR
So from reading the User manual is it possible that my time segments are wrong? I only focused on getting the bitrate to 250k. Bitrate and baud rate are synonymous for CANbus?
It appears from this my time segment 1 would be 15 while my time segment 2 is only 3. Figure 404 is the correct bit time segment figure for Can 2.0B as it says "Classical CAN format (Bosch CAN 2.0B)" meaning classic can and can 2.0b are synonymous correct?
additionally if I only want to be sending "Can protocol specification, version 2.0B" and not
"Can with flexible data rate(can fd)" then I would leave all the boxes here unchecked, unlike my original post correct? I do not know if 2.0b is the default or not but assume the enabling FD can may introduce some errors if I do not know how to use it.
Hi @pb632146
To help you verify if your configurations meet the requirements of your receiver device, I have attached to this message a guide that provides a deeper understanding of the configuration parameters of the FlexCAN module, as well as the limitations to consider.
This document can be found at: S32K3 Training.
- RomanVR.
It appeared to be a clock issue as editing the protocol clock to 16mhz instead of 24mhz (I have a 16mhz oscillator connected so I assume this was the issue), and adjusting the segments fixed it