autosportlabs / RaceCapture-Pro_firmware

Firmware for RaceCapture-Pro Data Acquisition, control and Telemetry system for motorsports
GNU General Public License v3.0
65 stars 35 forks source link

Auto-calculate the closest CAN baud rate prescalers based on the the specified baud rate #442

Open brentpicasso opened 8 years ago

brentpicasso commented 8 years ago

An algorithm can be used to select the closest prescaler for nearly any specified CAN baud rate. The system can be more versatile if an approach like this is used.

Some helpful info: https://my.st.com/public/STe2ecommunities/mcu/Lists/STM32Discovery/Flat.aspx?RootFolder=https%3a%2f%2fmy%2est%2ecom%2fpublic%2fSTe2ecommunities%2fmcu%2fLists%2fSTM32Discovery%2fCAN%20Baud%20rate&FolderCTID=0x01200200770978C69A1141439FE559EB459D75800084C20D8867EAD444A5987D47BE638E0F&currentviews=6266

jordan81 commented 8 years ago

Any progress on implementing this code? I'd love to be able to upgrade the firmware to be able to use the newer features and wifi support. It is something that will be very important for selling the new RC when it comes out.

stieg commented 8 years ago

Any progress on implementing this code?

Nothing as of yet. When bugs are in the process of being fixed they get assigned to the person creating the fix. We are quite busy with other deliverables so keep an eye on this ticket.

jordan81 commented 8 years ago

Thanks. I understand, just checking in.

brentpicasso commented 6 years ago

After discussing offline with @jordan81, the quickest, least regression solution would be to add an entry for 618K baud, with the following settings for all devices using the STM32F4 processors.

STM32F3 (RaceCapture/Track MK1) will not be supported as the peripheral does not allow us to get close enough to the target baud rate.

Prescaler: 17 TSEG1: 2 TSEG2: 1

brentpicasso commented 6 years ago

Will add to the 2.13.5 firmware release.

brentpicasso commented 6 years ago

Bumping this to 2.14 firmware, too much regression risk and we need to get the firmware out to address critical bug fixes.

brentpicasso commented 6 years ago

@jordan81 - there are 4 CAN setup parameters, can you test and verify the 4 parameters so we can get it implemented?

Thanks, -Brent //For 168MHz clock / BS1 BS2 SJW Pre 1M: 12 8 1 2 500k: 8 5 1 6 250k: 8 5 1 12 125k: 12 8 1 16 100k: 12 8 1 20 /

jordan81 commented 6 years ago

I think you covered this via email, but for posterity it is: 618k: 2 1 1 17

Thank you! Let me know when ready to test.