<?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>Not able to read analog value from a Proteus III board (nrf52840 SoC)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/67343/not-able-to-read-analog-value-from-a-proteus-iii-board-nrf52840-soc</link><description>Hello, 
 
 I am working on a Proteus III module which work with a nrf52840 SoC. I am using nrf52840 DK to test and develop code and at the same time testing the codes in the Proteus III module by flashing the firmware using SWD interface. The firmware</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 23 Oct 2020 07:42:44 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/67343/not-able-to-read-analog-value-from-a-proteus-iii-board-nrf52840-soc" /><item><title>RE: Not able to read analog value from a Proteus III board (nrf52840 SoC)</title><link>https://devzone.nordicsemi.com/thread/276553?ContentTypeID=1</link><pubDate>Fri, 23 Oct 2020 07:42:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0e9a9703-eff2-4ab3-9335-be81c8cb3c23</guid><dc:creator>Adarsh_1</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Yes it was it. A wrong Pin mapping. The files came along with the product was wrong. Thank you so much. Now it is working as expected.&lt;/p&gt;
&lt;p&gt;regards,&lt;/p&gt;
&lt;p&gt;Adarsh&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not able to read analog value from a Proteus III board (nrf52840 SoC)</title><link>https://devzone.nordicsemi.com/thread/276506?ContentTypeID=1</link><pubDate>Thu, 22 Oct 2020 19:42:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:293bf7a4-02f0-4f17-ba53-38688a23537a</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;This is a bug:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;    nrf_saadc_channel_config_t channel_config =
        NRF_DRV_SAADC_DEFAULT_CHANNEL_CONFIG_SE(NRF_PIN_BOOT);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;See edit above&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not able to read analog value from a Proteus III board (nrf52840 SoC)</title><link>https://devzone.nordicsemi.com/thread/276492?ContentTypeID=1</link><pubDate>Thu, 22 Oct 2020 15:49:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bae62234-4267-405a-8481-fac7352d2d0f</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;Edit:&lt;/p&gt;
&lt;p&gt;This is a bug:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    nrf_saadc_channel_config_t channel_config =
        NRF_DRV_SAADC_DEFAULT_CHANNEL_CONFIG_SE(NRF_PIN_BOOT);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;It uses 2 as a parameter, which is AIN1 not AIN0. Change to this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    nrf_saadc_channel_config_t channel_config =
        NRF_DRV_SAADC_DEFAULT_CHANNEL_CONFIG_SE(NRF_SAADC_INPUT_AIN0);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;See the enum:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define SAADC_CH_PSELP_PSELP_AnalogInput0 (1UL) /*!&amp;lt; AIN0 */
#define SAADC_CH_PSELP_PSELP_AnalogInput1 (2UL) /*!&amp;lt; AIN1 */

/**
 * @brief Input selection for the analog-to-digital converter.
 */
typedef enum
{
    NRF_SAADC_INPUT_DISABLED = SAADC_CH_PSELP_PSELP_NC,           ///&amp;lt; Not connected.
    NRF_SAADC_INPUT_AIN0     = SAADC_CH_PSELP_PSELP_AnlogInput0, ///&amp;lt; Analog input 0 (AIN0).
    NRF_SAADC_INPUT_AIN1     = SAADC_CH_PSELP_PSELP_AnalogInput1, ///&amp;lt; Analog input 1 (AIN1).
    NRF_SAADC_INPUT_AIN2     = SAADC_CH_PSELP_PSELP_AnalogInput2, ///&amp;lt; Analog input 2 (AIN2).
    NRF_SAADC_INPUT_AIN3     = SAADC_CH_PSELP_PSELP_AnalogInput3, ///&amp;lt; Analog input 3 (AIN3).
    NRF_SAADC_INPUT_AIN4     = SAADC_CH_PSELP_PSELP_AnalogInput4, ///&amp;lt; Analog input 4 (AIN4).
    NRF_SAADC_INPUT_AIN5     = SAADC_CH_PSELP_PSELP_AnalogInput5, ///&amp;lt; Analog input 5 (AIN5).
    NRF_SAADC_INPUT_AIN6     = SAADC_CH_PSELP_PSELP_AnalogInput6, ///&amp;lt; Analog input 6 (AIN6).
    NRF_SAADC_INPUT_AIN7     = SAADC_CH_PSELP_PSELP_AnalogInput7, ///&amp;lt; Analog input 7 (AIN7).
    NRF_SAADC_INPUT_VDD      = SAADC_CH_PSELP_PSELP_VDD           ///&amp;lt; VDD as input.
} nrf_saadc_input_t;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Maybe try some explicit setting in &lt;em&gt;saadc_init()&lt;/em&gt; like this (removes the bbug):&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    nrf_saadc_channel_config_t channel_config =
        //NRF_DRV_SAADC_DEFAULT_CHANNEL_CONFIG_SE(NRF_PIN_BOOT);
    {
        .resistor_p = NRF_SAADC_RESISTOR_DISABLED,
        .resistor_n = NRF_SAADC_RESISTOR_DISABLED,
        .gain       = NRF_SAADC_GAIN1, //1_6,
        .reference  = NRF_SAADC_REFERENCE_INTERNAL,
        .acq_time   = NRF_SAADC_ACQTIME_40US,
        .mode       = NRF_SAADC_MODE_SINGLE_ENDED,
        .burst      = NRF_SAADC_BURST_DISABLED,
        .pin_p      = NRF_SAADC_INPUT_AIN0,
        .pin_n      = NRF_SAADC_INPUT_DISABLED
    };&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Edit: Just a thought, is the SoftDevice enabled? If so PPI changes have to use the sd functions:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;uint32_t 	sd_ppi_channel_enable_get (uint32_t *p_channel_enable)
 	Get PPI channel enable register contents. More...
 
uint32_t 	sd_ppi_channel_enable_set (uint32_t channel_enable_set_msk)
 	Set PPI channel enable register. More...
 
uint32_t 	sd_ppi_channel_enable_clr (uint32_t channel_enable_clr_msk)
 	Clear PPI channel enable register. More...
 
uint32_t 	sd_ppi_channel_assign (uint8_t channel_num, const volatile void *evt_endpoint, const volatile void *task_endpoint)
 	Assign endpoints to a PPI channel. More...
 
uint32_t 	sd_ppi_group_task_enable (uint8_t group_num)
 	Task to enable a channel group. More...
 
uint32_t 	sd_ppi_group_task_disable (uint8_t group_num)
 	Task to disable a channel group. More...
 
uint32_t 	sd_ppi_group_assign (uint8_t group_num, uint32_t channel_msk)
 	Assign PPI channels to a channel group. More...
 
uint32_t 	sd_ppi_group_get (uint8_t group_num, uint32_t *p_channel_msk)
 	Gets the PPI channels of a channel group. More...&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not able to read analog value from a Proteus III board (nrf52840 SoC)</title><link>https://devzone.nordicsemi.com/thread/276396?ContentTypeID=1</link><pubDate>Thu, 22 Oct 2020 09:50:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:165b821f-bf08-438a-bbe0-754fa58ce025</guid><dc:creator>Adarsh_1</dc:creator><description>&lt;p&gt;Hai Jared,&lt;/p&gt;
&lt;p&gt;If you go in the &amp;quot;boards.h&amp;quot; header file which is included in the program, you can see that the custom board (&amp;quot;ProteusIII.h&amp;quot;) file is included as you have mentioned above. I have linked the Proteus III hardware instead of BOARD_PCA10056 in PREPROCESSOR -&amp;gt; SET PREPROCESSOR DEFINISION according to&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/63444/flashing-a-wurth-proteus-iii-with-the-nrf-mesh-sdk/259487#259487"&gt;this post.&lt;/a&gt; Is there a need to add the step you mentioned even after adding the board in the preprocessor?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If so, can you refer some links on how to do it.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I am certain that the compiler is already linked with the board files since I am able to provide digital signals to different pins in the custom board using the same application and header file.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you&lt;/p&gt;
&lt;p&gt;regards,&lt;/p&gt;
&lt;p&gt;Adarsh&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not able to read analog value from a Proteus III board (nrf52840 SoC)</title><link>https://devzone.nordicsemi.com/thread/276349?ContentTypeID=1</link><pubDate>Thu, 22 Oct 2020 07:38:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:573fe38d-900b-44a9-bfa7-cc58e86c52e9</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I see that you&amp;#39;ve included the custom board file but where do you tell the application to use that instead of the nRF52840 standard board file?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&amp;quot;To add support for a custom board, you must create a custom board support file with the name custom_board.h. This file must be located in a directory in the Include path. You can then select to use the custom board by adding the define statement&amp;nbsp;&lt;code&gt;#define&lt;/code&gt;&amp;nbsp;&lt;code&gt;BOARD_CUSTOM&amp;quot;&lt;/code&gt;.&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not able to read analog value from a Proteus III board (nrf52840 SoC)</title><link>https://devzone.nordicsemi.com/thread/276189?ContentTypeID=1</link><pubDate>Wed, 21 Oct 2020 12:34:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f61f53bc-05ff-4623-8ae8-ce46df4a3bf4</guid><dc:creator>Adarsh_1</dc:creator><description>&lt;p&gt;Hi Jared,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I am using a custom fw but I tried to use the saadc nordic example as well. I will upload the project with nordic saadc example including the confic files and board files. Here I have used 12 bit SAADC and receives an output like this. It does not change its values at all. (Even after applying GND and VDD to the Pin).&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/second.JPG" /&gt;&lt;/p&gt;
&lt;p&gt;Here is the file.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/saadc_5F00_Proteus.zip"&gt;devzone.nordicsemi.com/.../saadc_5F00_Proteus.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;regards,&lt;/p&gt;
&lt;p&gt;Adarsh&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not able to read analog value from a Proteus III board (nrf52840 SoC)</title><link>https://devzone.nordicsemi.com/thread/276127?ContentTypeID=1</link><pubDate>Wed, 21 Oct 2020 09:28:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0371e6e7-0a3b-4059-822b-a85bb892df89</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Are you using an example from the SDK or is it custom fw that you&amp;#39;re running? Could you upload your application along with the SDK config file and the custom board file?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;regards&lt;/p&gt;
&lt;p&gt;Jared&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not able to read analog value from a Proteus III board (nrf52840 SoC)</title><link>https://devzone.nordicsemi.com/thread/275939?ContentTypeID=1</link><pubDate>Tue, 20 Oct 2020 12:59:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ce318268-86f2-4e0f-993c-d1c1aaca8813</guid><dc:creator>Adarsh_1</dc:creator><description>&lt;p&gt;Hi Jared,&lt;/p&gt;
&lt;p&gt;Thanks for the reply.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;All the jumpers on JP2 are connected except for (1,2) and (3,4). This is the default configuration. I am sorry I am not able to upload images and I don&amp;#39;t know why. It&amp;#39;s weird. But you can find the default configuration table for JP2 on this&amp;nbsp;&lt;a href="https://www.we-online.com/catalog/manual/2611019024001_Proteus-III%20EV%202611019204001%20Manual_rev1.pdf"&gt;file.&lt;/a&gt;&amp;nbsp;(Page 10, table 6)&amp;nbsp;&lt;/p&gt;
&lt;p&gt;There are no jumpers at PI as you can see from the same file. Pin 2 of Pinheader P1 is BOOT pin and is configured as an analog pin in my code.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;When I measure directly on pin 2 of Pin header P1, I almost get a very low voltage value (3mV or so). I tried connecting Pin 1(VDD) to Pin 2(AIN) of Pin header P1, measuring a voltage of 2.95V on Pin 2 but still, the value in the serial monitor is not changing.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I thought this might be a hardware issue, but I cannot actually find it out. When I contacted the board manufacturers, they told me that all the Nordic examples are supposed to work on their board provided that I use the internal HFCLK and board header files. Everything works perfectly fine but cannot read analog pins properly. In their firmware, BOOT pin was used for OTA bootloader settings but I have erased the chip completely before flashing the softdevice and firmware. And so this wouldn&amp;#39;t be a problem.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I think I am missing out on some important points but I am stuck with this for a couple of days.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Waiting for your reply.&lt;/p&gt;
&lt;p&gt;regards,&lt;/p&gt;
&lt;p&gt;Adarsh&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not able to read analog value from a Proteus III board (nrf52840 SoC)</title><link>https://devzone.nordicsemi.com/thread/275887?ContentTypeID=1</link><pubDate>Tue, 20 Oct 2020 11:50:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f0e1f1d6-d9cd-4f75-9f28-4edd354d5b4b</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;How is the jumper on pin header P1 and JP2 configured? What voltage do you measure if you measure directly on the pin? &amp;nbsp;&lt;/p&gt;
&lt;p&gt;btw: This was a very good explanation of your issue, and what steps you&amp;#39;ve tried to&amp;nbsp;find the root cause.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;regards&lt;/p&gt;
&lt;p&gt;Jared&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not able to read analog value from a Proteus III board (nrf52840 SoC)</title><link>https://devzone.nordicsemi.com/thread/275671?ContentTypeID=1</link><pubDate>Mon, 19 Oct 2020 14:05:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fbdeade1-8b93-4182-bad1-c00ed50c040b</guid><dc:creator>Adarsh_1</dc:creator><description>&lt;p&gt;Sorry. I forgot to mention that I am using SDK version 17.02 and softdevice s140_nrf52_7.2.0_API.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>