How to set baudrate for UART component programatically ?

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

cross mob
jamec_2673086
Level 3
Level 3
5 likes given First like received First like given

Hello,

I am Jagir. I want to set the baud-rate to one of the UART component in my project programmatically.

I had gone through much APIs & functions But i did not find any way.

If any one had tried this ,Please guide me for that.

0 Likes
1 Solution

for SCB use:      UART Basic ->Clock from terminal

I did this: https://community.cypress.com/thread/18953

baudrate.PNG

View solution in original post

0 Likes
4 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Select an external clock for your UART. There are APIs to change the clock divider, see "System Reference Guide" from Creator Help.

Bob

0 Likes

Hi Bob,

Thanks for your response,

I got a function void CySysClkWriteSysclkDiv (uint32 divider) from this we can set appropreate devider but here i want to change baudrate of my uart component only Because i think this will change my system clock also.

Is there any API for UART SCB u know with that we can change devider to change baudrate ?

If i had changed it then is there any API to read it ?

0 Likes

I wasn't quite right, sorry.

Use Clock_SetDivider() API for the clock you connected to the UART. See clock datasheet.

Bob

0 Likes

for SCB use:      UART Basic ->Clock from terminal

I did this: https://community.cypress.com/thread/18953

baudrate.PNG

0 Likes