<?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>Controling a PWM signal (duty cycle (0 to 100%) , frequency (0 to 1hz )), using ble over a phone application . Guidance Needed</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/53657/controling-a-pwm-signal-duty-cycle-0-to-100-frequency-0-to-1hz-using-ble-over-a-phone-application-guidance-needed</link><description>hi all, 
 we&amp;#39;re developping an application to control the frequency and the duty cycle of a pwm signal throuth ble . 
 firstly we have built both the functionalities separatly , the ble control and the pwm control (we&amp;#39;re using the pwm library as it can</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 02 Dec 2019 13:06:13 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/53657/controling-a-pwm-signal-duty-cycle-0-to-100-frequency-0-to-1hz-using-ble-over-a-phone-application-guidance-needed" /><item><title>RE: Controling a PWM signal (duty cycle (0 to 100%) , frequency (0 to 1hz )), using ble over a phone application . Guidance Needed</title><link>https://devzone.nordicsemi.com/thread/223056?ContentTypeID=1</link><pubDate>Mon, 02 Dec 2019 13:06:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b48ca92a-5e9b-4393-ba1a-acdb42f6011e</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Eran&lt;/p&gt;
&lt;p&gt;All incoming data from the mobile app is handled by the&amp;nbsp;&lt;em&gt;nus_data_handler(ble_nus_evt_t * p_evt)&lt;/em&gt; ballback. The standard example simply forwards this data to the physical UART, but you can change this any way you like by modifying the code inside the&amp;nbsp;&lt;em&gt;if (p_evt-&amp;gt;type == BLE_NUS_EVT_RX_DATA)&amp;nbsp;{ }&lt;/em&gt;&amp;nbsp;section.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The simplest way would be to send an integer value from the app, and convert that from a string to an integer in the nus_data_handler and then set the PWM.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you need to send many different commands you can use the first byte of the package as a command byte, and include a check on this byte in the nus_data_handler to figure out which action to take.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Controling a PWM signal (duty cycle (0 to 100%) , frequency (0 to 1hz )), using ble over a phone application . Guidance Needed</title><link>https://devzone.nordicsemi.com/thread/222701?ContentTypeID=1</link><pubDate>Fri, 29 Nov 2019 07:22:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9ce60e32-77a6-469e-9c3b-6ca44ab1e326</guid><dc:creator>ERAN GISSER</dc:creator><description>&lt;p&gt;Hi Torbjorn,&lt;/p&gt;
&lt;p&gt;This example is fine , I flashed it and changed the duty cycle and delay time&amp;nbsp;&lt;/p&gt;
&lt;p&gt;for(int i = 0; i &amp;lt;= 90; i++)&lt;br /&gt; {&lt;br /&gt; nrf_delay_ms(20);&lt;br /&gt; pwm_update_duty_cycle(i);&lt;/p&gt;
&lt;p&gt;Now I need to integrate it with ble_app_uart to change these values from the nrf connect/toolbox.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve found this thread that I can start with&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/33110/beginner-needing-help-with-basic-structure-and-pwm/156850#156850"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/33110/beginner-needing-help-with-basic-structure-and-pwm/156850#156850&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I just need to add on-off button.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Tnx,&lt;/p&gt;
&lt;p&gt;Eran.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Controling a PWM signal (duty cycle (0 to 100%) , frequency (0 to 1hz )), using ble over a phone application . Guidance Needed</title><link>https://devzone.nordicsemi.com/thread/222567?ContentTypeID=1</link><pubDate>Thu, 28 Nov 2019 10:04:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c7499755-aad6-41e1-bb80-008a0a8a5553</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Eran&lt;/p&gt;
&lt;p&gt;If you need to run a PWM aroun 1KHz I don&amp;#39;t think that example is a good choice, I would recommend using the regular PWM module instead.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you have a look a this case I share an example written by a colleague showing how to setup and use the PWM driver:&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/28081/is-there-a-simple-example-how-to-set-a-pwm-driver"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/28081/is-there-a-simple-example-how-to-set-a-pwm-driver&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Controling a PWM signal (duty cycle (0 to 100%) , frequency (0 to 1hz )), using ble over a phone application . Guidance Needed</title><link>https://devzone.nordicsemi.com/thread/222304?ContentTypeID=1</link><pubDate>Wed, 27 Nov 2019 10:48:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:de9b4e3b-7a56-46b8-be52-c3553237d6ea</guid><dc:creator>ERAN GISSER</dc:creator><description>&lt;p&gt;HI Torbjorn,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m looking for an example that I can control a simple PWM pin (about 1Khz, 0-100duty cycle) by sending Values through NUS example.&lt;/p&gt;
&lt;p&gt;I used the attached project and put it under the SDK15.3 ble_peripherial library and compiled it Succesful. But not sure what this project is doing? Will be happy to get something to start with.&lt;/p&gt;
&lt;p&gt;Tnx,&lt;/p&gt;
&lt;p&gt;Eran.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Controling a PWM signal (duty cycle (0 to 100%) , frequency (0 to 1hz )), using ble over a phone application . Guidance Needed</title><link>https://devzone.nordicsemi.com/thread/217468?ContentTypeID=1</link><pubDate>Wed, 30 Oct 2019 09:28:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:40ba9f0f-c7f5-46eb-adee-8970c55efe7e</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;You welcome Abdelali. If you have any questions to the example just let me know.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Controling a PWM signal (duty cycle (0 to 100%) , frequency (0 to 1hz )), using ble over a phone application . Guidance Needed</title><link>https://devzone.nordicsemi.com/thread/217462?ContentTypeID=1</link><pubDate>Wed, 30 Oct 2019 09:01:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:20835022-7373-4c4e-a135-fdd717037302</guid><dc:creator>abdelali</dc:creator><description>&lt;p&gt;thanks alot &lt;a href="https://devzone.nordicsemi.com/members/ovrebekk"&gt;ovrebekk&lt;/a&gt;,&lt;/p&gt;
&lt;p&gt;will give it a try .&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Abdelali&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Controling a PWM signal (duty cycle (0 to 100%) , frequency (0 to 1hz )), using ble over a phone application . Guidance Needed</title><link>https://devzone.nordicsemi.com/thread/217460?ContentTypeID=1</link><pubDate>Wed, 30 Oct 2019 08:59:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:59373401-36fc-45f8-bc7e-5a3ad629a207</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Abdelali&lt;/p&gt;
&lt;p&gt;My apologies, I forgot to attach the files ...&lt;/p&gt;
&lt;p&gt;You will find them below, embedded in a small test project based on ble_app_uart&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-92850e585443498aa06d8770a6161a90/238215_5F00_ble_5F00_app_5F00_uart_5F00_rtc_5F00_pwm.zip"&gt;devzone.nordicsemi.com/.../238215_5F00_ble_5F00_app_5F00_uart_5F00_rtc_5F00_pwm.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Controling a PWM signal (duty cycle (0 to 100%) , frequency (0 to 1hz )), using ble over a phone application . Guidance Needed</title><link>https://devzone.nordicsemi.com/thread/217348?ContentTypeID=1</link><pubDate>Tue, 29 Oct 2019 13:47:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:75766939-4562-4401-889f-b065067db8d2</guid><dc:creator>abdelali</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;thanks again &lt;a href="https://devzone.nordicsemi.com/members/ovrebekk"&gt;ovrebekk&lt;/a&gt;, for your help .&lt;/p&gt;
&lt;p&gt;will test that for sure .&amp;nbsp;&lt;/p&gt;
&lt;p&gt;but, haven&amp;#39;t found any links in your reply to the example ?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;best regards,&lt;/p&gt;
&lt;p&gt;Abdelali&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Controling a PWM signal (duty cycle (0 to 100%) , frequency (0 to 1hz )), using ble over a phone application . Guidance Needed</title><link>https://devzone.nordicsemi.com/thread/217321?ContentTypeID=1</link><pubDate>Tue, 29 Oct 2019 12:25:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ec64f952-5eb3-486b-9762-f9db9711c099</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I cooked up a quick example showing how you can set up an RTC timer to control a pin.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Please note that the pin is set directly from the interrupt handler, which means the pin update can be delayed by higher priority interrupts in the system.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I would suggest doing some testing to see if&amp;nbsp;the accuracy is good enough.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Also, the example requires you to set the on and off time of the PWM, so you need to do some arithmetics to calculate this based on the frequency and the duty cycle.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Controling a PWM signal (duty cycle (0 to 100%) , frequency (0 to 1hz )), using ble over a phone application . Guidance Needed</title><link>https://devzone.nordicsemi.com/thread/217135?ContentTypeID=1</link><pubDate>Mon, 28 Oct 2019 14:21:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:029794f2-f4e1-4f9c-8c71-233f8812395d</guid><dc:creator>abdelali</dc:creator><description>&lt;p&gt;hi &lt;a href="https://devzone.nordicsemi.com/members/ovrebekk"&gt;ovrebekk&lt;/a&gt;,&lt;/p&gt;
&lt;p&gt;thanks for your reply.&lt;/p&gt;
&lt;p&gt;well, a 0.25hz would be the minimum we need to go for .&lt;/p&gt;
&lt;p&gt;for the accuracy , it should be good&amp;nbsp;.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;just one channel , need to output the pwm signal to 4 gpio pins .&lt;/p&gt;
&lt;p&gt;for the RTC timer, we&amp;#39;re new to the nrf52 developement .and we apreciate any axamples or guidance on how to use the dedicated RTC timer here, also keep in mind that we also need to control the duty cycle .&lt;/p&gt;
&lt;p&gt;best regards,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Controling a PWM signal (duty cycle (0 to 100%) , frequency (0 to 1hz )), using ble over a phone application . Guidance Needed</title><link>https://devzone.nordicsemi.com/thread/217121?ContentTypeID=1</link><pubDate>Mon, 28 Oct 2019 14:05:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cca6ec06-2c53-4805-8060-26b62c8b35ff</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;How low do you need to go in frequency, while still being above 0?&lt;/p&gt;
&lt;p&gt;How high accuracy do you need?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Do you need multiple output channels, or just a single one?&lt;/p&gt;
&lt;p&gt;If you need really low frequencies it is possible that it would be better to use a dedicated RTC timer, rather than one of the standard libraries.If you have the app_timer library in your project you should also be able to use this when the frequency is low.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>