<?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 use internal capacitors on nrf5340?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/89094/how-to-use-internal-capacitors-on-nrf5340</link><description>Hi, 
 I wonder how to use the internal capacitor of the nrf5340. 
 The nRF5340-DK operates at 32M=8pf 32.768k=9pf without any special settings. 
 If i use 10pf products for both crystals, 
 How can I set it up in NCS 1.9.1? 
 I added it to prj.conf as</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 20 Jun 2022 14:43:32 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/89094/how-to-use-internal-capacitors-on-nrf5340" /><item><title>RE: How to use internal capacitors on nrf5340?</title><link>https://devzone.nordicsemi.com/thread/373292?ContentTypeID=1</link><pubDate>Mon, 20 Jun 2022 14:43:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:654871bc-6c97-4d4a-9e54-bf5eeb2c0390</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;Try adding these Kconfigs to the prj.conf:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_SOC_ENABLE_LFXO=y
CONFIG_SOC_LFXO_CAP_INT_7PF=y
CONFIG_SOC_HFXO_CAP_INTERNAL=y
CONFIG_SOC_HFXO_CAP_INT_VALUE_X2=20
CONFIG_BUILD_WITH_TFM=y
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Then build and program you application, and read the registers in the following manner:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;@$ nrfjprog --memrd 0x400046D0&lt;br /&gt;0x400046D0: 00000002 |....|&lt;/p&gt;
&lt;p&gt;@$ nrfjprog --memrd 0x400045C4&lt;br /&gt;0x400045C4: 00000107 |....|&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;&lt;span style="text-decoration:underline;"&gt;Explanations:&lt;/span&gt;&lt;/p&gt;
[quote user="bong9"]&lt;span&gt;I used the board name nrf5340dk_nrf5340_cpuapp_ns.&lt;/span&gt;&lt;br /&gt;&lt;span&gt;Was it a problem to use it as nonsecure?&lt;/span&gt;[/quote]
&lt;p&gt;You need to add CONFIG_BUILD_WITH_TFM due to the following:&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/v2.7.99-ncs1-1/soc/arm/nordic_nrf/nrf53/Kconfig.soc#L149"&gt;https://github.com/nrfconnect/sdk-zephyr/blob/v2.7.99-ncs1-1/soc/arm/nordic_nrf/nrf53/Kconfig.soc#L149&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
[quote user="bong9"]Cannot read as nrfjprog --memrd.[/quote]
&lt;p&gt;Be&amp;nbsp;aware that the nonsecure oscillator offset is&amp;nbsp;&lt;span&gt;0x40004000, not&amp;nbsp;0x50004000. This is probably why you couldn&amp;#39;t read the registers&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1655735864975v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Simon&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use internal capacitors on nrf5340?</title><link>https://devzone.nordicsemi.com/thread/373062?ContentTypeID=1</link><pubDate>Fri, 17 Jun 2022 13:46:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:905a4487-4594-4b65-83c3-046cad7a70b2</guid><dc:creator>noseed</dc:creator><description>&lt;p&gt;Hi.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I used the board name nrf5340dk_nrf5340_cpuapp_ns.&lt;/span&gt;&lt;br /&gt;&lt;span&gt;Was it a problem to use it as nonsecure?&lt;/span&gt;&lt;br /&gt;&lt;span&gt;Cannot read as nrfjprog --memrd.&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;The reason for 7 is that I checked the link below to add 3pf.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/75541/nrf5340-lfxo-internal-load-cap-setting"&gt;link&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Thank you.&lt;/p&gt;
&lt;div id="__endic_crx__"&gt;
&lt;div class="css-1abc5oq"&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use internal capacitors on nrf5340?</title><link>https://devzone.nordicsemi.com/thread/373050?ContentTypeID=1</link><pubDate>Fri, 17 Jun 2022 13:10:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:81f315f1-f6e9-4d83-8adf-921f45a60fa3</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;I did some testing.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I programmed the&amp;nbsp;hello world sample (NCS v1.9.1) to the nRF5340 DK using the board name nrf5340dk_nrf5340_cpuapp with the following prj.conf&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_SOC_ENABLE_LFXO=y
CONFIG_SOC_LFXO_CAP_INT_7PF=y
CONFIG_SOC_HFXO_CAP_INTERNAL=y
CONFIG_SOC_HFXO_CAP_INT_VALUE_X2=20&lt;/pre&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Then I read the&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf5340/chapters/oscillators/doc/oscillators.html?cp=3_0_0_3_11_3_2#register.XOSC32KI.INTCAP"&gt;XOSC32KI.INTCAP register&lt;/a&gt;:&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;@$ nrfjprog --memrd 0x500046D0&lt;br /&gt;0x500046D0: 00000002 |....|&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;According to the documentation, it is correct. A value of 2 means the 7 pF internal load capacitance is selected&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1655470784169v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Then I&amp;nbsp;put a break point in the function &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/v2.7.99-ncs1/soc/arm/nordic_nrf/nrf53/soc.c#L108"&gt;nordicsemi_nrf53_init()&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;to see what the calculated cap value was, which was 7
&lt;ul&gt;
&lt;li&gt;I don&amp;#39;t have much knowledge about this topic, so I&amp;#39;m not sure if a value of 7 makes sense. If it doesn&amp;#39;t please let me know and I will take a closer look at it/ask internally&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Then I read the&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf5340/chapters/oscillators/doc/oscillators.html?cp=3_0_0_3_11_3_0#register.XOSC32MCAPS"&gt;XOSC32MCAPS&lt;/a&gt;&amp;nbsp;register:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;@$ nrfjprog --memrd 0x500045C4&lt;br /&gt;0x500045C4: 00000107 |....|&lt;/p&gt;
&lt;p&gt;As you can see, this will enable the capacitor and set the cap value to 7&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x200/__key/communityserver-discussions-components-files/4/pastedimage1655471364250v2.png" /&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>