arduino / arduino/ArduinoCore-samd

Cannot set UART to 300 baud

Open
#208 4 comments 0 reactions 0 assignees View on GitHub
improvement
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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.