You are here

how to configure different baud rate for single UART | Cypress Semiconductor

how to configure different baud rate for single UART

Summary: 8 Replies, Latest post by pavloven on 04 Oct 2016 02:08 PM PDT
Verified Answers: 1
Last post
Log in to post new comments.
prabhu05fe_1711731's picture
User
39 posts

Hello Everyone,

 

I am using PSOC 3 family right now am working on UART communication where am trying to use only one  UART component then it should able to work on different baud rates based on the input (actually the input signal is available on various baud rates )so it has to detect the input baud rate automatically and then able to function accordingly based on the  baud rate

so can anybody suggest me how to configure different baud rates for same UART component 

Note :Actually if i set individual baud rate (using clocks it is working correctly) but i would like to create the functions to detect and respond accordingly for various baud rate inputs

ANy help or ideas or suggestion would be greatly apppreciated

 

thank you

prabhu

user_49271930's picture
User
443 posts

I did a similar project but it is very old it here:  Uart baud rate

prabhu05fe_1711731's picture
User
39 posts

Thank you for your kind reply in thE psoc3 i am  allowed to use only 8 clocks so how can i use different clocks for different baud rate could you please explain me some more information about you code how it is selecting the baud rate and in your program i did not see too many clocks for various baud rates could you also explain how your clock is working for different baud rate in your program the clock is mentioned 48mhz abd how it is getting converted for 1200, 2400 etc baud rates 

your informations could be really helpful for me to understand and implement in my logic

actually i understood your clock diving fucntionality mathmatically but logically i did not understand how it will divide and how it will select the respective clock

 

thank you

user_49271930's picture
User
443 posts

The clock is always alone - in the Divider mode.
You simply change the divider and wait for some time for the changes to have taken place (can not remember how many msec).
May be be easier for you to create a simple test project.

Attachments: 
prabhu05fe_1711731's picture
User
39 posts

Thank you so much for your kind reply and in my psoc creator 3.3 it is showing master clock 24MHz so i should set the divider to 13 or 26 (honestly i did not understand clearly what is the value of divider 26)? it means the UART clock divider will automatically change its baud rate after certain delay and how it will choose the respective baudrate? based on any input or we need to give any values?

user_49271930's picture
User
443 posts

26 - initially, when the   power  on.
For 24MHz :   Divider = 24000000 / (8 * baudrate)
those baudrate is 115200 for the divider = 26

prabhu05fe_1711731's picture
User
39 posts

Thank you so much for your kind reply i have understood the basic baud rate configuration but my aim is to continuously check the baud rate how can i change the divider value because my project should always searching for baud rate

for example at the begining the baud rate is 115200 and then after 0.5 seconds the baud rate is 1200 and then 0.5 delay baud rate is 2400 so how can i set the divider value i have gone through your example and i implemented the same logic as yours but my baud rate is not getting changed after certain delay what should i do inorder to obtain the periodical clock input change

user_49271930's picture
User
443 posts

Yes, the task was more difficult.
I did not make the input velocity analysis function.
Can someone tell us ideas.

user_49271930's picture
User
443 posts

My project for HC-04 does not analyze Rx baudrate.
He's just waiting for the device response to the command "AT" on different baudrate.
If the answer is the same as the standard ("OK"), it is considered that the baudrate defined.

add a simple example baudrate change.

Log in to post new comments.