<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>How to set UART Baudrate ?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/88298/how-to-set-uart-baudrate</link><description>I&amp;#39;m referring to the sample code : ncs \ v1.9.1 \ nrf \ samples \ bluetooth \ peripheral_uart 
 I&amp;#39;m not happy at all with the samples, the documentation is quite poor in many ways and the online help not much better 
 The sample itself is working and</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 27 May 2022 09:30:15 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/88298/how-to-set-uart-baudrate" /><item><title>RE: How to set UART Baudrate ?</title><link>https://devzone.nordicsemi.com/thread/369741?ContentTypeID=1</link><pubDate>Fri, 27 May 2022 09:30:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8ba9f177-33b3-4186-9433-61a16e91a28a</guid><dc:creator>MDF</dc:creator><description>&lt;p&gt;ok, thanks, it works now&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to set UART Baudrate ?</title><link>https://devzone.nordicsemi.com/thread/369736?ContentTypeID=1</link><pubDate>Fri, 27 May 2022 08:57:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9c7c9727-7de6-4954-8d8e-1aa4f555205b</guid><dc:creator>Priyanka</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Just like how&amp;nbsp;@Vasiliy mentioned, you can change the UART baudrate dynamically by creating a variable of type uart_config. For more details you can take a look at &lt;a href="https://academy.nordicsemi.com/topic/uart-driver/#uart_config"&gt;our Dev academy&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Kind Regards,&lt;/p&gt;
&lt;p&gt;Priyanka&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to set UART Baudrate ?</title><link>https://devzone.nordicsemi.com/thread/369642?ContentTypeID=1</link><pubDate>Thu, 26 May 2022 05:31:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:63d43cf3-93ce-456c-ac84-c82862d60d41</guid><dc:creator>qwertynoon</dc:creator><description>&lt;p&gt;It was just a sample. You should study &amp;quot;struct&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;struct uart_config {
	uint32_t baudrate;
	uint8_t parity;
	uint8_t stop_bits;
	uint8_t data_bits;
	uint8_t flow_ctrl;
};

/** @brief Parity modes */
enum uart_config_parity {
	UART_CFG_PARITY_NONE,
	UART_CFG_PARITY_ODD,
	UART_CFG_PARITY_EVEN,
	UART_CFG_PARITY_MARK,
	UART_CFG_PARITY_SPACE,
};

/** @brief Number of stop bits. */
enum uart_config_stop_bits {
	UART_CFG_STOP_BITS_0_5,
	UART_CFG_STOP_BITS_1,
	UART_CFG_STOP_BITS_1_5,
	UART_CFG_STOP_BITS_2,
};

/** @brief Number of data bits. */
enum uart_config_data_bits {
	UART_CFG_DATA_BITS_5,
	UART_CFG_DATA_BITS_6,
	UART_CFG_DATA_BITS_7,
	UART_CFG_DATA_BITS_8,
	UART_CFG_DATA_BITS_9,
};

/**
 * @brief Hardware flow control options.
 *
 * With flow control set to none, any operations related to flow control
 * signals can be managed by user with uart_line_ctrl functions.
 * In other cases, flow control is managed by hardware/driver.
 */
enum uart_config_flow_control {
	UART_CFG_FLOW_CTRL_NONE,
	UART_CFG_FLOW_CTRL_RTS_CTS,
	UART_CFG_FLOW_CTRL_DTR_DSR,
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;just enter according parameter&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;
const struct uart_config uart_cfg = {
                                .baudrate  = 115200,
                                .parity    = UART_CFG_PARITY_NONE,
                                .stop_bits = UART_CFG_STOP_BITS_1,
                                .data_bits = UART_CFG_DATA_BITS_8,
                                .flow_ctrl = UART_CFG_FLOW_CTRL_NONE
                };
uart_configure(uart, &amp;amp;uart_cfg);&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to set UART Baudrate ?</title><link>https://devzone.nordicsemi.com/thread/369548?ContentTypeID=1</link><pubDate>Wed, 25 May 2022 13:17:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a2319895-0194-4a2a-8ca1-0c964a272002</guid><dc:creator>MDF</dc:creator><description>&lt;p&gt;that does not work - all the &amp;quot;preset&amp;quot; things are undeclared&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to set UART Baudrate ?</title><link>https://devzone.nordicsemi.com/thread/369545?ContentTypeID=1</link><pubDate>Wed, 25 May 2022 13:11:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c89517cf-1142-4895-a2a6-9c1273bb4bb0</guid><dc:creator>qwertynoon</dc:creator><description>&lt;p&gt;Hi &lt;/p&gt;
&lt;p&gt;Add this code in uart_init&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;const struct uart_config uart_cfg = {
                                .baudrate  = uart_speed_preset,
                                .parity    = uart_parity_preset,
                                .stop_bits = uart_stop_bits_preset,
                                .data_bits = UART_CFG_DATA_BITS_8,
                                .flow_ctrl = UART_CFG_FLOW_CTRL_NONE
                };
uart_configure(uart, &amp;amp;uart_cfg);&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>