<?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>Does PWM frequency of all 4 channels in one pwm module on an nRF52840 have to be the same?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/118161/does-pwm-frequency-of-all-4-channels-in-one-pwm-module-on-an-nrf52840-have-to-be-the-same</link><description>Hi, 
 I am developing an application for an nRF52840 using nRF Connect SDK v2.9.0. The application currently uses the Zephyr driver for simple PWM functions on several GPIOs. Does the PWM frequency across all 4 channels (CH0, CH1, CH2, CH3) in one module</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 03 Feb 2025 13:42:59 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/118161/does-pwm-frequency-of-all-4-channels-in-one-pwm-module-on-an-nrf52840-have-to-be-the-same" /><item><title>RE: Does PWM frequency of all 4 channels in one pwm module on an nRF52840 have to be the same?</title><link>https://devzone.nordicsemi.com/thread/521128?ContentTypeID=1</link><pubDate>Mon, 03 Feb 2025 13:42:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9567fb3a-6a7c-4723-b91e-5945ffd3c0f0</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello Ken,&lt;/p&gt;
&lt;p&gt;Sorry for not specifying in my previous reply.&lt;/p&gt;
&lt;p&gt;If you want to test the Zephyr Bluetooth Low Energy controller, instead of the Softdevice controller, you will have to add:&lt;/p&gt;
&lt;p&gt;CONFIG_BT_LL_SW_SPLIT=y&lt;/p&gt;
&lt;p&gt;in your prj.conf.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This config is defined in ncs\zephyr\subsys\bluetooth\controller\kconfig:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;config BT_LL_SW_SPLIT
	bool &amp;quot;Software-based BLE Link Layer [EXPERIMENTAL]&amp;quot;
	select EXPERIMENTAL
	select ENTROPY_GENERATOR
	help
	  Use Zephyr software BLE Link Layer ULL LLL split implementation.
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;So if you are using NCS, and do not have a line saying CONFIG_BT_LL_SW_SPLIT=y in your prj.conf or any other .conf files present in your application folder, then you are using the softdevice controller.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Does PWM frequency of all 4 channels in one pwm module on an nRF52840 have to be the same?</title><link>https://devzone.nordicsemi.com/thread/520942?ContentTypeID=1</link><pubDate>Fri, 31 Jan 2025 20:13:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1235421d-6521-42a9-8cdb-eb71894a14bc</guid><dc:creator>Ken58</dc:creator><description>&lt;p&gt;Hi Edvin,&lt;/p&gt;
&lt;p&gt;We are far away from my original ticket, but thank you so much for the discussion.&amp;nbsp; Indeed, I have found that Nordic&amp;#39;s support provided here has been world class.&amp;nbsp; I appreciate it very much.&lt;/p&gt;
&lt;p&gt;You said &amp;quot;Unless you specify NCS applications to use the Zephyr controller, it will use the SoftDevice Controller by default&amp;quot;.&amp;nbsp; I think I have used defaults all along the way so I think my application is using SoftDevice.&amp;nbsp; If I wanted to use the Zephyr control, how would I specify this?&amp;nbsp; How can I check to ensure my application is using SoftDevice?&lt;/p&gt;
&lt;p&gt;Ken&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Does PWM frequency of all 4 channels in one pwm module on an nRF52840 have to be the same?</title><link>https://devzone.nordicsemi.com/thread/520719?ContentTypeID=1</link><pubDate>Thu, 30 Jan 2025 13:29:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e11eef46-9af7-4674-b092-1a40195ff777</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;The SoftDevice is not part of a standalone zephyr installation, but it will be added when you use nRF Connect SDK. The nRF Connect SDK has a choice to use either the Zephyr&amp;#39;s Bluetooth LE controller, or the softdevice controller (which is Nordic Semiconductor&amp;#39;s closed source Bluetooth Low Energy controller). Unless you specify NCS applications to use the Zephyr controller, it will use the SoftDevice Controller by default.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So while you could choose to use the Zephyr controller, that is not something that we qualify with Bluetooth, so you would have to do the entire qualification part on your own, which would be a much more expensive way to certify your BLE device with Bluetooth. If you use our SoftDevice controller, you only need to&amp;nbsp;certify&amp;nbsp;a much smaller part, as the controller is pre-certified.&lt;/p&gt;
&lt;p&gt;That being said, the Zephyr controller will probably use a similar amount of peripherals.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Does PWM frequency of all 4 channels in one pwm module on an nRF52840 have to be the same?</title><link>https://devzone.nordicsemi.com/thread/520475?ContentTypeID=1</link><pubDate>Tue, 28 Jan 2025 21:12:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:366b79fd-50a7-43a0-9cec-87a551917db0</guid><dc:creator>Ken58</dc:creator><description>&lt;p&gt;Hi Edvin,&lt;/p&gt;
&lt;p&gt;Thanks for pointing out the documentation URLs.&lt;/p&gt;
&lt;p&gt;Question:&amp;nbsp; Is the softdevice of nrfxlib part of a typical Zephyr application built with nRF Connect SDK?&lt;/p&gt;
&lt;p&gt;Sorry, but I am still learning how all of what is in the SDK works together.&lt;/p&gt;
&lt;p&gt;Ken&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Does PWM frequency of all 4 channels in one pwm module on an nRF52840 have to be the same?</title><link>https://devzone.nordicsemi.com/thread/520188?ContentTypeID=1</link><pubDate>Mon, 27 Jan 2025 13:54:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:55ebb1d2-7693-4b51-86ff-44bb2d648a84</guid><dc:creator>Edvin</dc:creator><description>[quote user="Ken58"]is one of the PWM instances used by the OS or SoftDevice equivalent?[/quote]
&lt;p&gt;No. The softdevice uses one RTC and one TIMER instance (or technically, it is the MPSL layer that uses these). Please see:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/nrfxlib/softdevice_controller/doc/softdevice_controller.html"&gt;https://docs.nordicsemi.com/bundle/ncs-latest/page/nrfxlib/softdevice_controller/doc/softdevice_controller.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/nrfxlib/mpsl/doc/mpsl.html"&gt;https://docs.nordicsemi.com/bundle/ncs-latest/page/nrfxlib/mpsl/doc/mpsl.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Does PWM frequency of all 4 channels in one pwm module on an nRF52840 have to be the same?</title><link>https://devzone.nordicsemi.com/thread/520101?ContentTypeID=1</link><pubDate>Sun, 26 Jan 2025 19:16:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c2a31b59-14ea-4949-a30c-81dbafa70039</guid><dc:creator>Ken58</dc:creator><description>&lt;p&gt;Hi Edvin,&lt;/p&gt;
&lt;p&gt;How about the question of 3 vs 4 PWM instances?&amp;nbsp; If I am using Zephyr in a BT application, is one of the PWM instances used by the OS or SoftDevice equivalent?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Does PWM frequency of all 4 channels in one pwm module on an nRF52840 have to be the same?</title><link>https://devzone.nordicsemi.com/thread/519880?ContentTypeID=1</link><pubDate>Thu, 23 Jan 2025 22:36:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d247aab5-a4e7-4203-84fa-6eaa390baf8a</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;I haven&amp;#39;t used the visual editor that much, but as far as I can see, it doesn&amp;#39;t specify the frequency?&lt;/p&gt;
&lt;p&gt;If you look in e.g. the ncs\zephyr\samples\basic\blinky_pwm, you can see that the API that sets the PWM signal sets both the period and the duty cycle (pulse). I believe that if you have one instance running with one channel, and you try to set another channel with a different frequency, it will return an error.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Does PWM frequency of all 4 channels in one pwm module on an nRF52840 have to be the same?</title><link>https://devzone.nordicsemi.com/thread/519402?ContentTypeID=1</link><pubDate>Tue, 21 Jan 2025 19:00:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4a7ff930-5e89-47d2-a389-05e5403828da</guid><dc:creator>Ken58</dc:creator><description>&lt;p&gt;Hi Edvin,&lt;/p&gt;
&lt;p&gt;Thanks for your response.&amp;nbsp; How about my followup questions from above:&lt;/p&gt;
[quote userid="74045" url="~/f/nordic-q-a/118161/does-pwm-frequency-of-all-4-channels-in-one-pwm-module-on-an-nrf52840-have-to-be-the-same"]Does the SDK or the Devicetree Visual Editor detect different PWM frequencies as a problem? It doesn&amp;#39;t seem like it does, and so, if different channels of one pwm module are set to different frequencies, what frequency will prevail?[/quote]
&lt;p&gt;Also, why 3 and not 4 PWM instances?&amp;nbsp; SoftDevice Controller?&amp;nbsp; Is this active if using Zephyr?&lt;/p&gt;
&lt;p&gt;Ken&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Does PWM frequency of all 4 channels in one pwm module on an nRF52840 have to be the same?</title><link>https://devzone.nordicsemi.com/thread/519206?ContentTypeID=1</link><pubDate>Tue, 21 Jan 2025 08:37:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9768f28f-a4e3-479d-be41-52e87f76235b</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello Ken,&lt;/p&gt;
&lt;p&gt;You need to have the same PWM frequency accross all channels on the same PWM instance. You have 3 PWM instances, so that means you can have 3 separate frequencies.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You can also generate PWM signals withouot the PWM peripheral. One way is to use a TIMER instance, together with the GPIOTE peripheral and PPI to connect the two peripherals together. But that would also limit you to one frequency per TIMER instance. But if the case is that you need 4 different frequencies, it would be possible to acheive by using e.g. PWM0, PWM1, PWM2 and TIMERX (any timer instance not used by the SoftDevice Controller).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;You can see that each PWM instance has it&amp;#39;s own COUNTERTOP register:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.nordicsemi.com/bundle/ps_nrf52840/page/pwm.html#register.COUNTERTOP"&gt;https://docs.nordicsemi.com/bundle/ps_nrf52840/page/pwm.html#register.COUNTERTOP&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This is the register that basically decides the frequency of the PWM instance.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>