<?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>Not able to generate required sinewave using PWM and TIMER</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/127170/not-able-to-generate-required-sinewave-using-pwm-and-timer</link><description>I am using nRF5415-DK and SDK v3.2.2 
 I want to generate a sine wave using PWM and TIMER. The PWM repeat duty cycle method has limitations, so I am using a timer to trigger the PWM at the required rate.TIMER compare event is connected to the NEXTSTEP</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 25 Feb 2026 13:39:41 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/127170/not-able-to-generate-required-sinewave-using-pwm-and-timer" /><item><title>RE: Not able to generate required sinewave using PWM and TIMER</title><link>https://devzone.nordicsemi.com/thread/562047?ContentTypeID=1</link><pubDate>Wed, 25 Feb 2026 13:39:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:462fe11f-12af-4111-a124-1e2bd6b7ef6c</guid><dc:creator>Turbo J</dc:creator><description>&lt;p&gt;Read the datasheet chapter about the PWM peripherial again. You are trying do do things that simply won&amp;#39;t work.&lt;/p&gt;
&lt;p&gt;The (max) base frequency is 16MHz, and using 9 Bits requires 512 steps. That yields a max PWM refresh frequency of 16Mhz/512 = 31,250Hz.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;But 1.5Khz with 128 cycle values would require a refresh rate of 192,000Hz - far above hardware specs.&lt;/p&gt;
&lt;p&gt;My recommendation: Ditch the TIMER altogether, use PWM auto refresh and calculate your 1.5Khz sine wave points using 31,250Hz base frequency. You may need to be a bit clever in calculation buffer&amp;nbsp;&lt;em&gt;length&lt;/em&gt; here, too - I don&amp;#39;t think those frequencies match neatly.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>