<?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>Can I change the clock frequency on-the-fly given a UART command?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/14332/can-i-change-the-clock-frequency-on-the-fly-given-a-uart-command</link><description>Hi everyone 
 I am trying to understand if it &amp;#39;s possible to change the clock frequency on-the-fly, by giving a certain command to the uC via UART. 
 I started from the ble_app_uart example (I am working with nrf52832, SD 132).
I think that the function</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 07 Jun 2016 07:55:57 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/14332/can-i-change-the-clock-frequency-on-the-fly-given-a-uart-command" /><item><title>RE: Can I change the clock frequency on-the-fly given a UART command?</title><link>https://devzone.nordicsemi.com/thread/54722?ContentTypeID=1</link><pubDate>Tue, 07 Jun 2016 07:55:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:636452b3-a1d6-49c2-842b-9fd49be4a79e</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;You cannot change the system clock frequency at all on the nRF52. The system is running on 64 MHz and the peripherals at 16MHz. There is no way to change that.&lt;/p&gt;
&lt;p&gt;If you are talking about changing the UART baud rate on the other hand, it is no problem to change it  on-the-fly. Just close the UART, reconfigure it, and initialize it again with new settings.&lt;/p&gt;
&lt;p&gt;nrf_drv_uart_rx() is used to receive data over &lt;em&gt;wired&lt;/em&gt; UART. I.e. data received on the GPIO pins on the chip. When you receive data over BLE it is processed in the function nus_data_handler() in main.c. You can see that the incoming data is printed to the wired UART by calling app_uart_put(). You can do whatever you want with the data in the function.&lt;/p&gt;
&lt;p&gt;PS:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&amp;quot;nrf_drv_&amp;quot; signifies that the function belongs to a hardware module driver.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&amp;quot;app_&amp;quot; signifies that the function belongs to a library.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>