<?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>PWM stability issues (resetting)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/36697/pwm-stability-issues-resetting</link><description>I&amp;#39;m using: nrf52832, SDK 15.0, SoftDevice S132 v6.0. 
 I&amp;#39;m trying to control a motor using an H-Bridge. If I simply do a nrf_gpio_pin_write to set forward/reverse to 1/0 or vice versa, there is no issue. I can change motor directions quickly. 
 However</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 02 Aug 2018 00:33:53 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/36697/pwm-stability-issues-resetting" /><item><title>RE: PWM stability issues (resetting)</title><link>https://devzone.nordicsemi.com/thread/142478?ContentTypeID=1</link><pubDate>Thu, 02 Aug 2018 00:33:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:53e04fe9-9e15-4005-9f48-a9cd333a784d</guid><dc:creator>stellar7</dc:creator><description>&lt;p&gt;oh, the motor draws over 100ma, but it&amp;#39;s not being powered by the chip, the chip is controlling it via an h-bridge. I get roughly a max of 5.8ma total on the nrf52832 and bridge when running.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PWM stability issues (resetting)</title><link>https://devzone.nordicsemi.com/thread/142429?ContentTypeID=1</link><pubDate>Wed, 01 Aug 2018 13:34:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6ad107e1-728a-47c8-af40-7af8c7d0cac7</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;This is probably due to difference in internal resistance of the GPIO pins which can vary a bit (also between chips).&lt;/p&gt;
&lt;p&gt;I suggest the following approach to fix this issue:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Determine the maximum current consumption of the motor (typically when it starts).&lt;/li&gt;
&lt;li&gt;If the maximum current consumption is lower than the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/gpio.html?cp=2_1_0_19_3_0#unique_1511470077"&gt;IOH,HDH&lt;/a&gt;, then you should be OK by just configuring the pin as high drive. Remember to use the minimum value (6 mA) so that the value is valid for any nRF52832 device, as there can be significant variation.&lt;/li&gt;
&lt;li&gt;If the current consumption of the motor is higher, then you need to use a form of buffer so that you can supply the motor separately and not via the nRF52.&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PWM stability issues (resetting)</title><link>https://devzone.nordicsemi.com/thread/142284?ContentTypeID=1</link><pubDate>Wed, 01 Aug 2018 03:46:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:666955ab-0905-4ce0-a1b6-dcda7fd03120</guid><dc:creator>stellar7</dc:creator><description>&lt;p&gt;I&amp;#39;ll add--the weirdest part is that with some pin outs, it immediately resets. For example, when using pins P0_12 and 13 for forward and reverse it will either immediately reset when controlling the motor or run for about 2 seconds. However, when using pins &lt;span&gt;P0_&lt;/span&gt;11 and 14, it rarely resets--usually running for several minutes.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PWM stability issues (resetting)</title><link>https://devzone.nordicsemi.com/thread/141855?ContentTypeID=1</link><pubDate>Mon, 30 Jul 2018 08:57:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:40919032-b00e-4a80-b940-9be939c99f0b</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;I see. Since you only see this with the motor connected, then I think we can say with high certainty that the reset is actually due to a BOR, and that you need to revise your HW to prevent the supply voltage from ever falling below 1.7 V. You would need to get hold of an oscilloscope or similar to say for sure, though. (A multimeter is not sufficient, as the voltage drop might be very short in time.)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PWM stability issues (resetting)</title><link>https://devzone.nordicsemi.com/thread/141753?ContentTypeID=1</link><pubDate>Fri, 27 Jul 2018 17:19:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5e24b002-8f63-488e-b9da-0737bf36d2a6</guid><dc:creator>stellar7</dc:creator><description>&lt;p&gt;It&amp;#39;s possible. Unfortunately, I don&amp;#39;t have an oscilloscope. You&amp;#39;re correct that it doesn&amp;#39;t reset when the motor isn&amp;#39;t connected. I&amp;#39;ve watched the nrf52832 pin outs with a logic analyzer and they look good... and the h-bridge output with a multimeter and it&amp;#39;s what I would expect.. But yes, without an oscilloscope I can&amp;#39;t know for sure about the voltage dropping too low (I see the voltage drop from 3.3 to roughly 3.2 on the meter). Thanks for your suggestions.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PWM stability issues (resetting)</title><link>https://devzone.nordicsemi.com/thread/141605?ContentTypeID=1</link><pubDate>Fri, 27 Jul 2018 07:32:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:81ed8ade-f158-425f-84a0-f9917119dd3d</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Perhaps the reset reason really is brown-out, as indicated by the&amp;nbsp;RESETREAS register? I don&amp;#39;t know anything about your HW, but could it be that when the PWM signal causes the motor to run, the increased current consumption causes the supply voltage to drop below the minimum supply voltage (1.7 V)? Have you tried to meassure the supply voltage for the nRF52832 using an oscilloscope to see that it never drops below 1.7 V when you control the motor? Also, you could test and see if disconnecting the motor will prevent the resets.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PWM stability issues (resetting)</title><link>https://devzone.nordicsemi.com/thread/141555?ContentTypeID=1</link><pubDate>Thu, 26 Jul 2018 14:37:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6530d134-dc88-4729-bfff-3e567f2ba200</guid><dc:creator>stellar7</dc:creator><description>&lt;p&gt;I mean, I&amp;#39;m getting log data from RTT... I added the segger code and am only getting additional lines for the segger statements. When the chip resets, I have to reconnect RTT, and I see initialization info and still 0 for resetreas (he&amp;#39;s some output)...&lt;/p&gt;
&lt;p&gt;0&amp;gt; ###### Testing SEGGER_printf() ######&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; GPIOTE: Function: nrfx_gpiote_init, error code: NRF_SUCCESS.&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; GPIOTE: Function: nrfx_gpiote_in_init, error code: NRF_SUCCESS.&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; GPIOTE: Function: nrfx_gpiote_in_init, error code: NRF_SUCCESS.&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; pwr_mgmt: Init&lt;br /&gt; 0&amp;gt; &amp;lt;debug&amp;gt; nrf_sdh: State request: 0x00000000&lt;br /&gt; 0&amp;gt; &amp;lt;debug&amp;gt; nrf_sdh: Notify observer 0x0003B8D8 =&amp;gt; ready&lt;br /&gt; 0&amp;gt; &amp;lt;debug&amp;gt; nrf_sdh: State change: 0x00000000&lt;br /&gt; 0&amp;gt; &amp;lt;debug&amp;gt; nrf_sdh: State change: 0x00000001&lt;br /&gt; 0&amp;gt; &amp;lt;debug&amp;gt; nrf_sdh_ble: RAM starts at 0x20002A98&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; app: RESETREAS 0&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PWM stability issues (resetting)</title><link>https://devzone.nordicsemi.com/thread/141456?ContentTypeID=1</link><pubDate>Thu, 26 Jul 2018 06:53:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:28ce1209-d5d8-4d08-bfb9-9886280c1cf5</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;The reason I suggest this approach is that the device does not simply reset itself under normal situations, so it is likely that an error has been caught by an error check, and that the error handler is resetting the device as a consequence. From there, you can see what caused the error (file name, line number and error code) when you build the project with debug defined (-DDEBUG in your Makefile). See &lt;a href="https://devzone.nordicsemi.com/b/blog/posts/an-introduction-to-error-handling-in-nrf5-projects"&gt;An introduction to error handling in nRF5 projects&lt;/a&gt;&amp;nbsp;for details.&lt;/p&gt;
&lt;p&gt;By default, most SDK examples use UART logging, but you can configure RTT logging (via a debugger) instead if you want in the projects sdk_config.h. You can see information about logger configuration &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.0.0/lib_nrf_log.html?cp=4_0_0_3_26"&gt;here&lt;/a&gt;. Alternatively, if you struggle with logging, you can put a breakpoint in the error handler instead and read the relevant data (file, line, error code) from memory directly with the debugger.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PWM stability issues (resetting)</title><link>https://devzone.nordicsemi.com/thread/141335?ContentTypeID=1</link><pubDate>Wed, 25 Jul 2018 13:21:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e791271e-5b15-41fc-827f-bfcb5435b7d3</guid><dc:creator>stellar7</dc:creator><description>&lt;p&gt;First, thanks for the response. I changed to use&amp;nbsp;-O0 -g3 and -DEBUG. I also found a reference to -DDEBUG and tried it as well--not sure which is correct. Should I be able to see the errors in RTT? Or will I have to attach a full debugger.. I&amp;#39;m just building with gcc and no real IDE.&lt;/p&gt;
&lt;p&gt;If I do a soft reset,&amp;nbsp;through the reset pin, I get 1 for&amp;nbsp;&lt;span&gt;RESETREAS&amp;nbsp;.. and after a flash I see a 4, but still a 0 when it resets&amp;nbsp;when running the motor.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PWM stability issues (resetting)</title><link>https://devzone.nordicsemi.com/thread/141320?ContentTypeID=1</link><pubDate>Wed, 25 Jul 2018 12:26:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2ef30d9b-f042-495e-9b27-5f3f44cab7b0</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Typically, a reset is caused by an error caught by an error handler. The default error handler in the SDK will trigger a system reset unless DEBUG is defined for the project. Can you define DEBUG, enable logging&amp;nbsp; and build without optimization and use a debugger to check the state of the system at the time of the error? It should give some indication of what went wrong.&lt;/p&gt;
&lt;p&gt;Also, I would not expect the&amp;nbsp;RESETREAS to be 0 after a reset. It should only be 0 after a brownout reset or power on reset, unless you clear it in your application before you read it.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>