-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Different sample rate for arbitration and data phase #61
Comments
Take a look at FlexCAN_T4FDTimings.tpp, specifically line 13. The clock rate also affects the timings in FD mode. Leave the advanced argument as true to see all the timing possibilities for the selected clock rate |
setBaudRate(CANFD_timings_t config, uint8_t nominal_choice, uint8_t flexdata_choice, FLEXCAN_RXTX listen_only, bool advanced) config you already have thats as close to multiple timings you can select. anything else and you'll need to modify the registry directly which is more complex so prepare to read the reference manual :) |
ok I understand... arbitrationphase: bitrate 500k; samplerate 80% ...so config.sample can eather be 80 or 70... config.sampleArbit = 80; Your libary is so super super awsome and full of features like ISO TP, which is so awsome... |
The calculations were based off NXP's excel document configuration. Whatever is available in flexcan_t4 is only as capable as what they offered in the spreadsheet calculation. Unfortunately other than porting the calculations over and designing a console option listing for selecting different timings, I wouldn't be able to help in deeper baudrate configuration as it's beyond my current scope, that's one of the reasons flexcan_t4fd was delayed for awhile during beta, CANFD mode worked using fixed register values found on forums, before the baudrate calculator was implemented. So it wasn't viable for most people who had to search that time for specific rates |
There are cases where the CAN arbitration for arbitration phase is not defined the same as for data phase.
In my case f.e. would be a sample rate for arbitration phase of 70 and sample rate for data phase of 80.
As I found out you are not able to set different sample rates for arbitration and data phase by now. Is that correct?
CANFD_timings_t config;
config.clock = CLK_24MHz;
config.baudrate = 500000;
config.baudrateFD = 2000000;
config.propdelay = 190;
config.bus_length = 1;
config.sample = 80;
FD.setBaudRate(config);
The text was updated successfully, but these errors were encountered: