I have 9DoF Razor IMU. When I use the UART module with 115200 baud, it works fine. However, when I increase the baud rate like 230400 baud, the communication fails. I looked samd21 datasheet, and I saw that this baud rate should work fine with SparkFun clock frequency, which is 48 MHz. Am I missing something? What might be the problem?
Do you mean SparkFun Board Definition? I’ve edited “SECOM.cpp” file located in "…\ArduinoData\packages\SparkFun\hardware\samd\1.7.4\cores\arduino". I’ve entered the values of “sercom->USART.BAUD.FRAC.FP” and “sercom->USART.BAUD.FRAC.BAUD” manually, but it didn’t work either.
Also, I’ve tried arithmetic mode, which is mentioned in the datasheet of SAMD21, by deleting the code for fractional mode and replacing it with the following code.
No, the actual firmware running inside the chip on the Razor.
I don’t have one to confirm, but the firmware may not support your baud rate. If that’s the case, the only way around that would be for you to write your own custom firmware that supports the higher baud rate.