arduino / arduino/ArduinoCore-samd
Cannot set UART to 300 baud
- Dominant language
- C
- Stars
- 502
- Forks
- 740
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
Since the commit 20104a6c it is not possible to set the UART baudrate to 300 anymore. We're now using the fractional mode of the SERCOM and `sercom->USART.BAUD.FRAC.BAUD` can only hold 13 bits while at 300 baud you want to write `10000`. It doesn't fit.
To be honest, I don't even know how accurate the 300 baud used to be before this change, but we only use it to emulate sending a break. And that is not possible anymore.
Should we perhaps switch to the non-fractional mode if we detect that there is an overflow of the 13 bits?
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reviewing commit 20104a6c and the UART baud-rate calculation that writes sercom->USART.BAUD.FRAC.BAUD. Reproduce the 300-baud configuration and compare fractional and non-fractional behavior; done means 300 baud can be selected without overflowing the 13-bit field and break emulation works as expected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- embedded-iot
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100