Uart

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

cross mob
Anonymous
Not applicable

 how to use api change Uart’s Baud rate, stop bits, date bits

0 Likes
6 Replies
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

If you look at the datasheet there is a discussion of the control register to

   

set UART parameters. Also same is true of clock input for UART, when

   

you assign a clock to be fed to the UART clock pin it has API calls in datasheet

   

to set frequency, hence baud rate of UART.

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

 In my opinion, I can use the external clock and change the divider of the clock that I can change the baud rate of the uart

   

but  i don't know change like this will be stabled.

   

another problem there are know way  that  i  can change the stop bits and data bits from  api(from datasheet).

   

so can  you tell me what I say is right or not.

0 Likes
Anonymous
Not applicable

 there  are  no way that  i know can  change the stop  bits and data bits using  the api (from the datasheet )

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

Somebody else got stuck at the very same point, look here http://www.psocdeveloper.com/forums/viewtopic.php?f=42&t=8612&p=38998&hilit=uart+baudrate+change#p38....

   

When you file a technical case, will you please inform us here about the results?

   

 

   

Bob

0 Likes
Anonymous
Not applicable

UART_1_WriteControlRegister(UART_1__B_UART__ODD_REVB); 

   

I write like this but it doesn't work like what I want.

   

and the same question:

   

   

/***************************************

   

*    Initial Parameter Constants

   

***************************************/

   

 

   

#define UART_1_TXBUFFERSIZE           (100u)

   

#define UART_1_RXBUFFERSIZE           (100u)

   

/* UART shifts max 8 bits, Mark/Space functionality working if 9 selected */

   

#define UART_1_NUMBER_OF_DATA_BITS    ((8u > 8u) ? 8u : 8u)

   

#define UART_1_NUMBER_OF_STOP_BITS    (1u)

   

I don't know how to change above parameters.

   

and  thanks for your  reply

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

How do you know new settings did not take effect ? Scope pictures ?

   

Or are you relying on the other end of the link to have auto-negotiated

   

the new settings ?

   

 

   

Also a quick check of the defines, look at their bit settings and match up

   

tech ref manual register bit settings for the UART control registers, to see

   

if there is no error in either defines or manual.....

   

 

   

Regards, Dana.

0 Likes