<?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>nRF9160DK high accuracy UART baud rates</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/83798/nrf9160dk-high-accuracy-uart-baud-rates</link><description>I&amp;#39;m a newbie (few weeks) with nRF9160-DK and using nRF Connect SDK v1.7.1 / VS Code on a Windows 10 PC 
 Good afternoon, 
 
 I&amp;#39;m struggling with how to set up and start the external crystal oscillator on the nRF9160DK to get high accuracy UART baud rates</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 19 Jan 2022 07:57:40 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/83798/nrf9160dk-high-accuracy-uart-baud-rates" /><item><title>RE: nRF9160DK high accuracy UART baud rates</title><link>https://devzone.nordicsemi.com/thread/348419?ContentTypeID=1</link><pubDate>Wed, 19 Jan 2022 07:57:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d720ca5b-fbc7-4368-9cef-18462f7a8f52</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Soupdragon"]&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Is this C code ? It seems to compile OK, but I can&amp;#39;t find any references to what all this stuff means&lt;/p&gt;[/quote]
&lt;p&gt;If it compiles without any warnings or errors, it is valid code.&lt;/p&gt;
[quote user="Soupdragon"]&lt;p&gt;NRF_CLOCK-&amp;gt;TASKS_HFCLKSTART = 1;&lt;/p&gt;
&lt;p&gt;while (NRF_CLOCK-&amp;gt;EVENTS_HFCLKSTARTED == 0) {}&lt;br /&gt;NRF_CLOCK-&amp;gt;EVENTS_HFCLKSTARTED = 0;&lt;/p&gt;[/quote]
&lt;p&gt;This is a de-referenced pointer to a struct, where one writes to the TASKS_HFCLKSTART register, then waits till it has started, and finally resets the EVENTS_ register. If you are new to C, I would recommend that you check out how this works, it is very common to see when working with ARM based microcontrollers.&lt;/p&gt;
&lt;p&gt;This is the registers that are touched upon:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf9160/clock.html?cp=2_0_0_4_6_1_0#topic"&gt;https://infocenter.nordicsemi.com/topic/ps_nrf9160/clock.html?cp=2_0_0_4_6_1_0#topic&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160DK high accuracy UART baud rates</title><link>https://devzone.nordicsemi.com/thread/348416?ContentTypeID=1</link><pubDate>Wed, 19 Jan 2022 07:54:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7a47c378-e844-42da-a342-0d07207c1c61</guid><dc:creator>Soupdragon</dc:creator><description>&lt;p&gt;OK I tried both examples and they seem to work. The register access is simple and easy to understand. The method using the Zephyr clock subsystem is way over my head. I can&amp;#39;t even begin to have the faintest idea what that is all about. Unfortunately for me I&amp;#39;m one of those guys that really likes to properly understand what is going on.&lt;br /&gt;But that&amp;#39;s for me to work out. I&amp;#39;m happy with the answer I have. I think you can close this ticket.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160DK high accuracy UART baud rates</title><link>https://devzone.nordicsemi.com/thread/348351?ContentTypeID=1</link><pubDate>Tue, 18 Jan 2022 15:51:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:63407f20-6366-41cd-88ec-1b0228c84331</guid><dc:creator>Soupdragon</dc:creator><description>&lt;p&gt;NRF_CLOCK-&amp;gt;TASKS_HFCLKSTART = 1;&lt;/p&gt;
&lt;p&gt;while (NRF_CLOCK-&amp;gt;EVENTS_HFCLKSTARTED == 0) {}&lt;br /&gt;NRF_CLOCK-&amp;gt;EVENTS_HFCLKSTARTED = 0;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Is this C code ? It seems to compile OK, but I can&amp;#39;t find any references to what all this stuff means&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160DK high accuracy UART baud rates</title><link>https://devzone.nordicsemi.com/thread/348337?ContentTypeID=1</link><pubDate>Tue, 18 Jan 2022 15:04:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:daaef82d-8c2a-4020-9d89-cd328c918388</guid><dc:creator>Soupdragon</dc:creator><description>&lt;p&gt;Many thanks to you both for super-fast response. I think I was focussed too much on Zephyr and was completely missing out on the SDK info.&lt;/p&gt;
&lt;p&gt;This is pretty hard work for me and painfully slow at the moment, but the products look great and I&amp;#39;m hoping the time invested will be worth it&lt;/p&gt;
&lt;p&gt;Thanks again,&lt;/p&gt;
&lt;p&gt;John&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160DK high accuracy UART baud rates</title><link>https://devzone.nordicsemi.com/thread/348328?ContentTypeID=1</link><pubDate>Tue, 18 Jan 2022 14:48:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c6529d79-8beb-4acf-a58b-f93dbbd8ba11</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Great answer, &lt;a href="https://devzone.nordicsemi.com/members/kingston"&gt;kingston&lt;/a&gt;!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;You have covered howto start HFXO directly&amp;nbsp;using register access, and here&amp;#39;s an example on how to use the clock subsys in zephyr to&amp;nbsp;start the HFXO:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/main/samples/nrf9160/at_client/src/main.c#L20-L29"&gt;https://github.com/nrfconnect/sdk-nrf/blob/main/samples/nrf9160/at_client/src/main.c#L20-L29&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;H&amp;aring;kon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160DK high accuracy UART baud rates</title><link>https://devzone.nordicsemi.com/thread/348325?ContentTypeID=1</link><pubDate>Tue, 18 Jan 2022 14:42:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:02dca803-a8eb-4bc3-88fa-f1be64fa31ed</guid><dc:creator>kingston</dc:creator><description>&lt;p&gt;Hi &lt;a href="https://devzone.nordicsemi.com/members/soupdragon"&gt;Soupdragon&lt;/a&gt;&amp;nbsp;there&amp;#39;s a lot there to learn, but once you get the general idea of Zephyr and the SDK it&amp;#39;ll all make sense.&amp;nbsp; My general workflow for &amp;quot;how do I accomplish this?&amp;quot; is to start with a search on the SDK page for the version I am on like&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/search.html?q=HFCLKSTART+&amp;amp;check_keywords=yes&amp;amp;area=default"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/search.html?q=HFCLKSTART+&amp;amp;check_keywords=yes&amp;amp;area=default&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This will usually lead me to whether the topic is handled in Nordic or on Zephyr natively.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The SDK pages will lead you to decent docs on how to use, and if nothing else other keywords you can search for here on DevZone that may lead you to an answer.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve not modified the Clocks on my 9160, but it appears you need to work with the Clock HAL(Hardware Abstraction Layer) based on the docs.&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s a link to an example I found.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/51527/nrf52840-hfxo-and-hfclkstarted-event"&gt;devzone.nordicsemi.com/.../nrf52840-hfxo-and-hfclkstarted-event&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>