<?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>Detect baudrate automatically by using Timer and GPIOTE signals</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/22920/detect-baudrate-automatically-by-using-timer-and-gpiote-signals</link><description>Hi, 
 I want to make an BLE_UART dongle which will receive the data from the module(An external module is connected through UART) and it will be send over the BLE to ble_receiver. In this case the baud rate of external module may vary for board to board</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 20 Jun 2017 12:53:03 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/22920/detect-baudrate-automatically-by-using-timer-and-gpiote-signals" /><item><title>RE: Detect baudrate automatically by using Timer and GPIOTE signals</title><link>https://devzone.nordicsemi.com/thread/90154?ContentTypeID=1</link><pubDate>Tue, 20 Jun 2017 12:53:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:13380a72-13ce-44db-a5b7-62f640fd8a71</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi Mani,&lt;/p&gt;
&lt;p&gt;Like @bjorn-spockeli said in your &lt;a href="https://devzone.nordicsemi.com/question/150531/how-to-detect-the-baud-rate-of-connected-modules-automatically-in-nrf52/"&gt;previous post&lt;/a&gt;, we don&amp;#39;t have any example of this available.&lt;/p&gt;
&lt;p&gt;The principle of detecting the baudrate is described in &lt;a href="https://stackoverflow.com/a/34997895"&gt;this post&lt;/a&gt;. You will have to use GPIOTE to connect the UART RX pin to the START and STOP tasks of a TIMER using PPI channels, to count the number of clock cycles between edge transistions. You need to do this for many samples to make sure you find the smallest cycle. Please read the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/gpiote.html?cp=2_2_0_20#concept_knz_kww_lr"&gt;GPIOTE&lt;/a&gt;, &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/timer.html?cp=2_2_0_23#concept_xbd_hqp_sr"&gt;TIMER&lt;/a&gt; and &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/ppi.html?cp=2_2_0_21#concept_sxf_21l_1s"&gt;PPI&lt;/a&gt; documentation in our infocenter, and check out the relevant &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v13.0.0/ppi_example.html?cp=4_0_0_4_4_17"&gt;PPI&lt;/a&gt; and &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v13.0.0/nrf_gpiote_example.html?cp=4_0_0_4_4_10"&gt;GPIOTE&lt;/a&gt; examples in our SDK for more details.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>