Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
Hello,

I would to like to recive serial information with my XMC1200.
Serial Bit Format:
1 Start Bit
8 Data Bits
1 Mode Bit
1 Stop Bit
11 Bits Total

How have I to init my uart especially:
#ifdef _9600_Baud
// 9.6kbd @32MHz
#define FDR_STEP ?
#define BRG_PDIV ?
#define BRG_DCTQ ?
#define BRG_PCTQ ?
#endif

Many thanks,
Bernd
0 Likes
4 Replies
Not applicable
Here are the numbers I use, scaled for 9600 baud @ 32 MHz clock

STEP = 472
PCTQ = 1
DCTQ = 15
PDIV = 47

Hope this helps.
0 Likes
Not applicable
Hello Frank,

Thank you for your help! It works well!!
Could you tell me how do you calculate these values?

With thanks,
Bernd
0 Likes
Not applicable
Great - I'm glad it's working for you.

The numbers are partially calculated, partially selected. The XMC1400 reference manual, table 17-11, is very useful. That gives you working values for STEP, PCTQ & DCTQ. That means you only need to calculate PDIV, which is easy to scale up or down depending upon your CPU clock speed & your desired baud rate.
0 Likes
Not applicable
Hi Frank,

Thank you, now I know to calculate theses datas!

Regards,
Bernd
0 Likes