CAN maximum baudrate
jimmie11 opened this issue · 5 comments
This is my first ever project using the CAN bus. I am interfacing a CAN sensor to a Teensy 4.1 and the FlexCAN_T4 library.
My sensor can be configured with CAN baudrates of up to 1000 kbps. In my application, I need to use the fastest possible CAN baudrate.
My program works fine up to a CAN baudrate of 250 kbps which is unfortunately too slow in my case. Once I bump the sensor CAN rate beyond 250 kbps (options are 500, 1000), the Teensy4.1 stops receiving data.
Is there any way to bump the CAN baudrate on the Teensy4.1? Is this a hardware or a software limitation?
BTW, I am using the following board:
http://copperhilltech.com/teensy-4-1-triple-can-bus-board-with-240x240-lcd-and-ethernet/
1000 does work, maybe the clock timings are different for your application (device your connected to), try changing the clock? can.setClock(clock speed) then run setBaudRate again, default is 24, you can try 60mhz and check it
Thank you.
I configured the sensor for 500 kbps then used the following code but still no response.
can1.begin();
can1.setClock(60);
can1.setBaudRate(500000); //250000
Running a teensy 4,0 here with the 24MHz default clock. Read / send with 500kbps is no problem for me.
Thank you @designer2k2. Yes, I am also confirming it.
It depends on both the sensor AND the hardware on the MCU side. Basically the existence a 60 Ohm resistor across the CAN lines (on both sides, sensor and MCU).
you can get away with resistor less 125kbps or below, but any higher requires it mandatory to function