<?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>Read multiple ADC samples on single channel</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/98387/read-multiple-adc-samples-on-single-channel</link><description>Hi, 
 I&amp;#39;m trying to read the battery voltage of a custom board from the VDDHDIV5 channel. I&amp;#39;m using FreeRTOS in my project. I would like to read trigger the ADC to read 5 samples(non-blocking) once every hour. I tried the below pseudo code to trigger</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 25 Sep 2023 06:23:18 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/98387/read-multiple-adc-samples-on-single-channel" /><item><title>RE: Read multiple ADC samples on single channel</title><link>https://devzone.nordicsemi.com/thread/447346?ContentTypeID=1</link><pubDate>Mon, 25 Sep 2023 06:23:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:596f303f-4d00-493b-8a6f-5f8711cc0d59</guid><dc:creator>TS Gowtham</dc:creator><description>&lt;p&gt;Hi Vidar,&lt;/p&gt;
&lt;p&gt;A bit late with my reply but my issue has been solved. I&amp;#39;m not sure on what the exact root cause for the issue was. The second&amp;nbsp;batch of my PCBs did not have this issue and a few PCBs on my first&amp;nbsp;batch had incorrect capacitors assembled. And these caps were connected to the nrf52833. While this could have been the issue, it still does not explain why the example project worked fine. Still, thanks for helping out with this issue!&lt;/p&gt;
&lt;p&gt;TLDR: Closing this thread since I&amp;#39;m no longer facing this issue.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read multiple ADC samples on single channel</title><link>https://devzone.nordicsemi.com/thread/429983?ContentTypeID=1</link><pubDate>Thu, 08 Jun 2023 12:13:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:86711466-3718-4069-8d2a-567821310fa3</guid><dc:creator>TS Gowtham</dc:creator><description>&lt;p&gt;I&amp;#39;m using the nrf52833 DK as a debugger for the custom PCB with SES v5.68&lt;/p&gt;
&lt;div id="gtx-trans" style="left:226px;position:absolute;top:23px;"&gt;
&lt;div class="gtx-trans-icon"&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read multiple ADC samples on single channel</title><link>https://devzone.nordicsemi.com/thread/429975?ContentTypeID=1</link><pubDate>Thu, 08 Jun 2023 11:47:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:85bf16ca-4c38-4cd8-bbe7-b63fb27877c4</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;Gowtham,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I&amp;#39;m not sure what the issue is, and it is difficult to troubleshoot when I can&amp;#39;t reproduce it here with the same project. What debugger do you use, and what is the version of SES?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read multiple ADC samples on single channel</title><link>https://devzone.nordicsemi.com/thread/429947?ContentTypeID=1</link><pubDate>Thu, 08 Jun 2023 10:20:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d7f36c2a-383a-40d3-8464-c679faa4f0d6</guid><dc:creator>TS Gowtham</dc:creator><description>&lt;p&gt;Hi Vidar,&lt;/p&gt;
&lt;p&gt;I think I made some changes in that project after I had uploaded the project zip here. I downloaded the same zip file I had uploaded and tested it. I can still observe the same issue.&lt;/p&gt;
&lt;p&gt;Can you help me with understanding the difference in the method of using the SAADC between the 2 projects I had uploaded since the saadc-pcb-test.zip project gives the correct values.&lt;/p&gt;
&lt;p&gt;Is this something to do with the usage of tasks?&lt;/p&gt;
&lt;p&gt;I&amp;#39;m ruling out a hardware issue since I&amp;#39;m getting proper values from the saadc-pcb-test project&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read multiple ADC samples on single channel</title><link>https://devzone.nordicsemi.com/thread/429943?ContentTypeID=1</link><pubDate>Thu, 08 Jun 2023 10:07:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a5388919-7a50-46ae-b058-6cc86e3550e6</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;Gowtham,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;What I noticed from the video recording you made is that the false readings appear to be left-shifted by 1 (i.e. multiplied by 2), which isn&amp;#39;t something I have seen before. I also noticed that you made some changes to the code compared to what you sent me.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read multiple ADC samples on single channel</title><link>https://devzone.nordicsemi.com/thread/429940?ContentTypeID=1</link><pubDate>Thu, 08 Jun 2023 10:01:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1f3e1e1b-9113-4ccc-a2bf-68cc0813e487</guid><dc:creator>TS Gowtham</dc:creator><description>&lt;p&gt;Hi Vidar,&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve tried commenting the line you have mentioned and I&amp;#39;m still facing the same issue. I tried the Debug variant and the issue is still seen.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read multiple ADC samples on single channel</title><link>https://devzone.nordicsemi.com/thread/429938?ContentTypeID=1</link><pubDate>Thu, 08 Jun 2023 09:56:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e5876135-b4fb-4e12-8533-7146173bce0a</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Do you see the same if you comment the &amp;#39;raw_value = *(p_event-&amp;gt;data.done.p_buffer);&amp;#39; line in your&amp;nbsp;saadc_handler() callback, and does it make any difference if you use the &amp;#39;Debug&amp;#39; build configuration instead of &amp;#39;Release&amp;#39;?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read multiple ADC samples on single channel</title><link>https://devzone.nordicsemi.com/thread/429875?ContentTypeID=1</link><pubDate>Thu, 08 Jun 2023 04:55:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f2baafe9-9dd9-4e87-b52f-09aa0b468594</guid><dc:creator>TS Gowtham</dc:creator><description>&lt;p&gt;Hey Vidar,&lt;/p&gt;
&lt;p&gt;Sorry for the delay in replying. I was able to make a recording of this issue. The battery voltage at the time of recording was around 3.97V.&amp;nbsp; You can notice that the first sample had a value close to the expected value while the next sample onwards it&amp;#39;s completely wrong.&lt;br /&gt;&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/blinky_5F00_FreeRTOS_5F00_pca10100.mp4"&gt;devzone.nordicsemi.com/.../blinky_5F00_FreeRTOS_5F00_pca10100.mp4&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read multiple ADC samples on single channel</title><link>https://devzone.nordicsemi.com/thread/422234?ContentTypeID=1</link><pubDate>Tue, 25 Apr 2023 09:41:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:184285ed-3e7e-4bc7-a431-1b5657bad928</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;Gowtham,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks for confirming. The problem is that&amp;nbsp;I am consistently&amp;nbsp;measuring 291 here with&amp;nbsp;minor deviation, both with breakpoints and watchpoints. Also don&amp;#39;t see why&amp;nbsp;this should have made any difference.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Have you tried to see if it behaves differently with different build configurations (i.e. Debug vs Release)&amp;nbsp;and would you mind&amp;nbsp;recording&amp;nbsp;a short screencast of when you are monitoring the sample buffer?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Vidar&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read multiple ADC samples on single channel</title><link>https://devzone.nordicsemi.com/thread/422164?ContentTypeID=1</link><pubDate>Tue, 25 Apr 2023 05:13:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:58abe559-5978-4e7a-a2af-91d846ac5a5c</guid><dc:creator>TS Gowtham</dc:creator><description>&lt;p&gt;Hi Vidar,&lt;/p&gt;
&lt;p&gt;I checked the value of MAINREGSTATUS and it is High when I tried both the projects.&lt;/p&gt;
&lt;p&gt;Additionally, please don&amp;#39;t check the value using a breakpoint and instead use the Watch window as I&amp;#39;ve noticed that I get the correct value sometimes when the code execution stops. And usually the first or second time it hits the breakpoint, it reads the correct value.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Gowtham&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read multiple ADC samples on single channel</title><link>https://devzone.nordicsemi.com/thread/421928?ContentTypeID=1</link><pubDate>Mon, 24 Apr 2023 06:37:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1c86efd6-f496-4c1f-9e63-626f29f38550</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;Gowtham,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Strangely I get the same measurement results with both&amp;nbsp;saadc-test-pcb and&amp;nbsp;blinky_freertos when testing this on a nRF52833 DK here. The measured value was ~291&amp;nbsp;when VVDH=5.084V.&lt;/p&gt;
&lt;p&gt;Please&amp;nbsp;confirm if the&amp;nbsp;MAINREGSTATUS register is set to high as shown below.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1682318243328v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read multiple ADC samples on single channel</title><link>https://devzone.nordicsemi.com/thread/421869?ContentTypeID=1</link><pubDate>Sat, 22 Apr 2023 06:20:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2154192b-860b-4db0-8d2a-5cb3080c4620</guid><dc:creator>TS Gowtham</dc:creator><description>&lt;p&gt;Hi Vidar,&lt;/p&gt;
&lt;p&gt;I am getting the correct raw value only on the saadc-test-pcb project which is based on the SAADC example. When I program the blink_freertos-adc-test project with the same setup, I&amp;#39;m getting an incorrect raw value of 600. A raw value of 600 translates to ~10.5V, which is wrong.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Gowtham&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read multiple ADC samples on single channel</title><link>https://devzone.nordicsemi.com/thread/421786?ContentTypeID=1</link><pubDate>Fri, 21 Apr 2023 13:48:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9040ee33-7245-41d2-8551-bae7c2edb7a1</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;It seems like you are measuring the correct raw value. Following the the macro from ble_app_proximity and multipling the ADC value by 5 I get 4042 mV.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define ADC_RESULT_IN_MILLI_VOLTS(ADC_VALUE)\
        ((((ADC_VALUE) * ADC_REF_VOLTAGE_IN_MILLIVOLTS) / ADC_RES_10BIT) * ADC_PRE_SCALING_COMPENSATION)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Calculation&lt;/p&gt;
&lt;p&gt;((230*5) * 600)/1024 * 6 = 4042&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read multiple ADC samples on single channel</title><link>https://devzone.nordicsemi.com/thread/421723?ContentTypeID=1</link><pubDate>Fri, 21 Apr 2023 11:38:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8f13afc3-d28c-4e04-9180-9804289ffd34</guid><dc:creator>TS Gowtham</dc:creator><description>&lt;p&gt;Hi Susheel,&lt;/p&gt;
&lt;p&gt;I would appreciate it if you do assign it to someone else as I&amp;#39;m on a tight deadline for this issue.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I still believe that this is not a FreeRTOS issue since the freeRTOS code i shared has only one task in it for the periodic ADC sampling.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Gowtham&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read multiple ADC samples on single channel</title><link>https://devzone.nordicsemi.com/thread/421636?ContentTypeID=1</link><pubDate>Fri, 21 Apr 2023 06:50:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:21dba61d-9202-4f57-8605-d400eac33523</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Gowtham,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Sorry for late response. I am on business travel next week and there are very few who can debug freertos applications.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I will have to mark this to to assign it to someone else (in case you cannot wait for a week). Sorry for the inconvenience.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read multiple ADC samples on single channel</title><link>https://devzone.nordicsemi.com/thread/420968?ContentTypeID=1</link><pubDate>Tue, 18 Apr 2023 10:00:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:efd2419c-cd44-4615-98bf-d78953ed6097</guid><dc:creator>TS Gowtham</dc:creator><description>&lt;p&gt;Hi Susheel,&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve attached 2 projects.&lt;/p&gt;
&lt;p&gt;1. blink_freertos-adc-test: Based on the blinky_freertos project. I&amp;#39;ve added a task to sample the SAADC VDDHDIV5 channel. The ADC value read is around 600 when the VDD value is around 4.06V&lt;/p&gt;
&lt;p&gt;2. saadc-pcb-test: Based on the saadc peripheral example. I&amp;#39;ve changed the channel to VDDHDIV5. The ADC value read is around 230 when the VDD value is around 4.06V.&lt;/p&gt;
&lt;p&gt;Both the projects are based on the nRF5 SDK v17.1.0 and were tested on the same PCB.&lt;/p&gt;
&lt;p&gt;I feel that this seems to be an issue with how the values are read rather than FreeRTOS.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/blinky_5F00_freertos_2D00_adc_2D00_test.zip"&gt;devzone.nordicsemi.com/.../blinky_5F00_freertos_2D00_adc_2D00_test.zip&lt;/a&gt;&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/saadc_2D00_pcb_2D00_test.zip"&gt;devzone.nordicsemi.com/.../saadc_2D00_pcb_2D00_test.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read multiple ADC samples on single channel</title><link>https://devzone.nordicsemi.com/thread/419892?ContentTypeID=1</link><pubDate>Wed, 12 Apr 2023 08:49:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fc582791-c876-4aef-8408-b424b3190b16</guid><dc:creator>TS Gowtham</dc:creator><description>&lt;p&gt;Hi Susheel,&lt;/p&gt;
&lt;p&gt;There are 2 tasks in the application. One task is to flush the nrf logger module and the other task is to read the values from the ADC.I don&amp;#39;t think it&amp;#39;s a deadlock or a race condition.&lt;/p&gt;
&lt;p&gt;The application was built in the debug configuration and I noticed the problem when I debugging the code. I&amp;#39;ll need to remove a few details and then I&amp;#39;ll share the project.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Gowtham&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read multiple ADC samples on single channel</title><link>https://devzone.nordicsemi.com/thread/419880?ContentTypeID=1</link><pubDate>Wed, 12 Apr 2023 08:16:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8f79f534-848b-4f76-b0e1-a99fdb637711</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Gowtham,&lt;/p&gt;
&lt;p&gt;Thanks for waiting. Have you tried your application in the debugger mode?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It seems like there might be some race conditions in your application causing some deadlock somewhere in your application context. Maybe wrong priorities within other tasks. It is hard to say without knowing all the contexts running in your application.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you do not find any race conditions or deadlocks in your application when you run this in the debug mode. Then please share your&amp;nbsp;project so that I try to find the context which probably is starving other contexts.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read multiple ADC samples on single channel</title><link>https://devzone.nordicsemi.com/thread/419837?ContentTypeID=1</link><pubDate>Wed, 12 Apr 2023 05:17:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d5faf429-04c4-4bd7-9e0e-31d660644733</guid><dc:creator>TS Gowtham</dc:creator><description>&lt;p&gt;Hey Raoul,&lt;/p&gt;
&lt;p&gt;Hope you had a great Easter! I just wanted to follow up and check if anyone got a chance to take a look at this problem.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Gowtham&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read multiple ADC samples on single channel</title><link>https://devzone.nordicsemi.com/thread/418843?ContentTypeID=1</link><pubDate>Mon, 03 Apr 2023 12:20:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c5ea665b-fa24-4c33-8fbb-fff3d9179c6a</guid><dc:creator>Raoul</dc:creator><description>&lt;p&gt;Hi Gowtham,&lt;/p&gt;
&lt;p&gt;Due to the Easter holiday season in Norway, we are low in staff. Our FreeRTOS expert is out of office and will be back after Easter to answer your question.&lt;/p&gt;
&lt;p&gt;Thanks for your patience!&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Raoul&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>