<?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>Play Tune on Piezo Buzzer Using PWM</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/104525/play-tune-on-piezo-buzzer-using-pwm</link><description>Hello Nordic Team, 
 
 I am doing development in nrf52832 DK for playing Piezo Buzzer for generate some Tones or Tunes using PWM. 
 
 Currently I am using SDK 17.1.0 SES. 
 My Piezo Buzzer Part number is AB1560B . 
 I have also used PAM8904Q piezo sounder</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 13 Oct 2023 13:55:04 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/104525/play-tune-on-piezo-buzzer-using-pwm" /><item><title>RE: Play Tune on Piezo Buzzer Using PWM</title><link>https://devzone.nordicsemi.com/thread/450326?ContentTypeID=1</link><pubDate>Fri, 13 Oct 2023 13:55:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:61cc6fb8-299a-47e8-974b-0c3e589d92a4</guid><dc:creator>JONATHAN LL</dc:creator><description>&lt;p&gt;Sorry Anil, but this is what we currently have, there will be no new updates for the nRF5 SDK in terms of PWM examples. I would recommend to change to the nRF Connect SDK as this is our current focus.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;But the nRF5 SDK should do the job and if you follow the recommendations form &lt;span&gt;hmolesworth&lt;/span&gt; as well it would get you quite far.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;Jonathan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Play Tune on Piezo Buzzer Using PWM</title><link>https://devzone.nordicsemi.com/thread/449964?ContentTypeID=1</link><pubDate>Thu, 12 Oct 2023 07:29:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7b195b94-470e-4e2f-839c-5ab9620b31de</guid><dc:creator>Anil Rathod</dc:creator><description>&lt;p&gt;&lt;span&gt;I appreciate your guidance, Jonathan.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I mention earlier&amp;nbsp;&lt;span&gt;I have already explored SDK PWM Library example&amp;nbsp;&lt;strong&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/pwm_example.html?cp=9_1_4_6_25"&gt;pwm_library&lt;/a&gt;&lt;/strong&gt;. Using that I am&amp;nbsp;able to generate beep sound and i have also try to changing duty cycle but I didn&amp;#39;t get expected output, &lt;/span&gt;&lt;span&gt;According to PWM principles, it should alter the intensity of the Piezo Buzzer, but the output didn&amp;#39;t meet my requirements.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I also examined your microbit piano demo example. It&amp;#39;s looking same, but unfortunately, it doesn&amp;#39;t align with the &lt;strong&gt;nRF52832&lt;/strong&gt; Development Board (Devlop code into &lt;strong&gt;Segger Embedded Studio&lt;/strong&gt;). Additionally, it utilizes more than one GPIO pin for generating different frequencies, contrary to my project&amp;#39;s specification where I need to achieve this using just one GPIO pin using PWM.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Mention above I have refer Arduino Project :&amp;nbsp;&lt;a id="" href="https://github.com/giacomocerquone/arduino-projects/blob/master/arduino-jingle-bells/arduino-jingle-bells.ino"&gt;https://github.com/giacomocerquone/arduino-projects/blob/master/arduino-jingle-bells/arduino-jingle-bells.ino&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;that&amp;nbsp;&lt;span&gt;successfully&lt;/span&gt;&amp;nbsp;generate &lt;span&gt;various&lt;/span&gt; &lt;span&gt;frequencies&lt;/span&gt; using&amp;nbsp;PWM on a &lt;span&gt;single&lt;/span&gt; &lt;span&gt;GPIO&lt;/span&gt;&amp;nbsp;pin &amp;amp; also it&amp;#39;s create &lt;span&gt;specific&amp;nbsp;&lt;/span&gt;rhythms or &lt;span&gt;tunes,&amp;nbsp;precisely what I need for my application.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/pwm_example.html?cp=9_1_4_6_25"&gt;&lt;/a&gt;I r&lt;span&gt;egret to inform you that, I&lt;/span&gt;&amp;nbsp;have f&lt;span&gt;ound similar queries which raise in this forum dating back 7 to 8 years and 4 to 5 years &lt;/span&gt;&lt;span&gt;but still viable solutions not available.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Regards,&lt;br /&gt;Anil Rathod&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Play Tune on Piezo Buzzer Using PWM</title><link>https://devzone.nordicsemi.com/thread/449902?ContentTypeID=1</link><pubDate>Wed, 11 Oct 2023 16:20:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1761217d-37ea-4f9e-a7ab-4960077f640e</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;Not sure if this code helps, but worth a look&amp;nbsp;&lt;a href="https://github.com/don41382/nrf52-pwm-wav-sbc-decoder-player"&gt;nrf52-pwm-wav-sbc-decoder-player&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Play Tune on Piezo Buzzer Using PWM</title><link>https://devzone.nordicsemi.com/thread/449800?ContentTypeID=1</link><pubDate>Wed, 11 Oct 2023 11:57:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fbadc985-ca53-49de-9421-31082ff1e959</guid><dc:creator>JONATHAN LL</dc:creator><description>&lt;p&gt;We do have some examples from the SDK that might be helpful but not much else of example for making music with a buzzer.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/pwm_example.html?cp=9_1_4_6_25"&gt;https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/pwm_example.html?cp=9_1_4_6_25&lt;/a&gt;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;There is a microbit example for a piano demo :&amp;nbsp;&lt;a href="https://www.youtube.com/watch?v=ulKq5To9dmA"&gt;https://www.youtube.com/watch?v=ulKq5To9dmA&lt;/a&gt;&amp;nbsp;(its voiced in Norwegian, but can have English text) It links to a Git repo with the example.&amp;nbsp;&lt;a href="https://github.com/ProsjektMicroBit/08_Piano"&gt;https://github.com/ProsjektMicroBit/08_Piano&lt;/a&gt;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;They use a speaker in the demo and not a buzzer.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;Jonathan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Play Tune on Piezo Buzzer Using PWM</title><link>https://devzone.nordicsemi.com/thread/449748?ContentTypeID=1</link><pubDate>Wed, 11 Oct 2023 09:30:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2629539c-3d5a-41d4-b56a-955061fc6224</guid><dc:creator>Anil Rathod</dc:creator><description>&lt;p&gt;Thanks for the quick reply Hmolesworth&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I have already seen this link before but sorry it was really not helpful for me. I need to simply integrate PWM peripheral task not an over BLE.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Can you please posting any simple example&amp;nbsp;for playing a tune using PWM ? This would be really very helpful&amp;nbsp;to understanding the full setup for changing multiple frequency using PWM and playing tune.&lt;/span&gt;&lt;/p&gt;
&lt;pre id="tw-target-text" class="tw-data-text tw-text-large tw-ta" dir="ltr" data-placeholder="Translation" data-ved="2ahUKEwjMn926z-2BAxWASWwGHRluDV4Q3ewLegQIBhAQ"&gt;&lt;span class="Y2IQFc" lang="en"&gt;&lt;/span&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Play Tune on Piezo Buzzer Using PWM</title><link>https://devzone.nordicsemi.com/thread/449636?ContentTypeID=1</link><pubDate>Tue, 10 Oct 2023 16:00:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2d972e7c-354b-4b3b-a773-f348548f92fe</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;Try these links, they might be of use:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/44765/nrf52-pwm-strange-behaviour-of-simple_playback-playback_count-parameter/175790"&gt;simple_playback&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/43574/nrf52-midi-piano---pwm-feature-request"&gt;nrf52-midi-piano&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/guides/short-range-guides/b/bluetooth-low-energy/posts/midi-over-bluetooth-le"&gt;midi-over-bluetooth-le&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>