<?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>NRF51822 Print Issue</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/8368/nrf51822-print-issue</link><description>Hi,
Here is the piece of code that is bugging me.
The code algo is at every 500ms timer2 interrupts, and the adc captures 1500 samples and stores it in an array .I always have to stop the timer2 for printing and calculations and then start when it is</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 31 Jul 2015 04:30:03 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/8368/nrf51822-print-issue" /><item><title>RE: NRF51822 Print Issue</title><link>https://devzone.nordicsemi.com/thread/30362?ContentTypeID=1</link><pubDate>Fri, 31 Jul 2015 04:30:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:068d9cb8-66ca-4d04-852f-adac9dcad46f</guid><dc:creator>curiousmech</dc:creator><description>&lt;p&gt;@Hung Bui: Thanks for your support. The issue is now resolved. Also, I would like to share that the minimum delay to be added is of 10 ms , greater than that didn&amp;#39;t gave proper result&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF51822 Print Issue</title><link>https://devzone.nordicsemi.com/thread/30361?ContentTypeID=1</link><pubDate>Tue, 28 Jul 2015 12:59:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3f8dffe7-271d-40d3-956d-5e4ab2b8a2de</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;@curiousmech: Most likely your printf use app_uart_fifo.c to print the text on uart. And there is a limited buffer size for that (UART_TX_BUF_SIZE). If you call printf too fast, this buffer will be overflow. And if you don&amp;#39;t handle this event from app_uart_fifo, you won&amp;#39;t be able to printf any more.
You can test this by adding a small delay (nrf_delay_ms), say 10ms every time you call printf.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF51822 Print Issue</title><link>https://devzone.nordicsemi.com/thread/30360?ContentTypeID=1</link><pubDate>Mon, 27 Jul 2015 17:40:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4b8a46d5-adec-46f1-94df-c9c773585617</guid><dc:creator>curiousmech</dc:creator><description>&lt;p&gt;@Hung Bui: I have only printed the &amp;quot;j&amp;quot; values which is defined as an integer and increments till 1500. I have disabled the ADC part to check why the garbage values are occuring and I am not reading any values just free processing the controller. If u look at the screenshot it is still providing the garbage values after printing certain &amp;quot;j&amp;quot; values.
I&amp;#39;ll also test your mentioned suggestion about memory part,as the product specification says
&amp;quot;Each block is divided into two 4 kByte RAM sections with separate RAM AHB slaves.&amp;quot; so if I fill the array almost 4kB it won&amp;#39;t be a problem.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF51822 Print Issue</title><link>https://devzone.nordicsemi.com/thread/30359?ContentTypeID=1</link><pubDate>Mon, 27 Jul 2015 12:42:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6381f90a-c158-4df7-8153-9392cbcece68</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;How do you declare the array newsamples ? Note that float is 4 bytes, if you define it with the size 1500 elements it will be 6kB which maybe over the size of RAM available for the 16kB RAM mRF51 variant. You can try to reduce the size of the array to 50 for testing, for example.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF51822 Print Issue</title><link>https://devzone.nordicsemi.com/thread/30358?ContentTypeID=1</link><pubDate>Mon, 27 Jul 2015 12:15:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:52cb4f11-d022-4b49-bc1a-cf4aebff6754</guid><dc:creator>curiousmech</dc:creator><description>&lt;p&gt;@Hung Bui: Thanks for correcting me. I tried the above mentioned suggestions, but same garbage values are occuring after certain values.
Now what I did is stopped the adc interrupt and closed the adc part. Now I am only printing values of var j after running timer2 only once to check if their is a problem of interrupt or not. But after printing j value till count 22 the same garbage is occuring as u can see in the screenshot provided.
&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/screen1.png"&gt;screen1.png&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF51822 Print Issue</title><link>https://devzone.nordicsemi.com/thread/30357?ContentTypeID=1</link><pubDate>Mon, 27 Jul 2015 10:47:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:54fd9f9f-6ff8-4399-a175-cdf5afc990db</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;@Curiousmech: I see 2 issue in your code. First you only start adc nrf_adc_start(); at the end of the timer timeout handler, after you already read the result out. You should start it before you read the result.&lt;/p&gt;
&lt;p&gt;Secondly, as mentioned in the nRF51 Reference Manual: &amp;quot;The ADC itself only supports one-shot operation, this means every single conversion has to be explicitly started using the START task.&amp;quot; (chapter31 ). You need to start the ADC conversion (call nrf_adc_start() ) every time you want the ADC to sample, not just once for 1500 samples.&lt;/p&gt;
&lt;p&gt;Please follow the adc_simple example we provided in the SDK.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF51822 Print Issue</title><link>https://devzone.nordicsemi.com/thread/30356?ContentTypeID=1</link><pubDate>Sun, 26 Jul 2015 07:52:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d0cea4a9-0ed8-434d-abf5-1c7430f80790</guid><dc:creator>curiousmech</dc:creator><description>&lt;p&gt;Anyone who can help?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>