DrDatasalad
Level: Hangaround

Joined: Mon. Jun 8, 2009

Location: Planet of the Apes

Posted by DrDatasalad:
Wed. Jul 6, 2022 - 10:57 AM

Hi,

with SAME53J18 I have used Atmel Start to configure SERCOM in USART-mode and to have 38400 Baud.

My input clock is 4MHz.

In debug mode I read the baud register value to be 0xFE6D. In CTRLA reg, SAMPR is 0 -> 16x arithmetic baud rate generation.

I have checked with a scope that my output baudrate is correct (bit time is 26µs).

When I look at the formula in data sheet page 829 it is stated: F_baud= (F_ref/16) * (1 - Baud/65536).

So with this Baud register setting and above formula, F_baud= 1537 (???).

When I use given other formula to calculate baud rate register value, I get 55470 = 0xD8AE. Which is also not the setting.

Does anybody know the correct formula? What did I get wrong?

Please help. Thank you.

Meanwhile I did some Tests:

Baud reg value Bit duration Baud rate

0x8000 323ns 3 095 975

0xF000 2.565µs 389 863

0xFF00 40.95µs 24 420

0xFFFF 10.8ms 92.59

Can someone figure out the formula to it?

PS:

I have found out now, that when I enable ctrlb.COLDEN= 1, then the USART TXD does not function any more!

Just to warn others to use it...

This topic has a solution. Jump to the solution.
Surprise: As soon as one's doing it correctly - it works!

## Tags:

Last Edited: Mon. Jul 11, 2022 - 06:03 AM