This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Not able to read analog value from a Proteus III board (nrf52840 SoC)

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 is flashed on to Proteus III BLE Evaluation board. I was able to flash in few example projects and was able to successfully use the GPIO pins and BLE in the Proteus III Evaluation board. I am also sending analog signals from an anlog pin to a central (Developed mobile phone app) successfully on both NRFDK and Proteus Evaluation board. However, I am facing difficulties in sending correct analog readings from Proteus III Evaluation board. For debugging purpose, I have enabled the RTT and hence visualizing the signal through a serial monitor. 

I am able to read correct analog value from P0.02 (Analog Pin) of NRF52840 DK. When I try to read the value from the Proteus III evaluation board, I am always getting values around 3400+ (using a 12 bit SAADC). Connecting this analog pin to GND and VDD does not change the value in serial monitor. 

Here is a screenshot of the serial monitor reading the value from analog pin of Proteus III Evaluation Board. 

The Custom board does not contains an external low frequency clock. In order to run Nordic examples I have made all the required changes in the sdk.confic file suggested by the manufactures of the Proteus III module. I have also included proper board files for pin mapping. I am also using the internal DCDC voltage converter instead of LDO as suggested by the Proteus III manufactures. Kindly note that I am able to use digital pins and BLE features on Proteus board successfully. 

Here are some hardware descriptions and important notes from the documentations of the Proteus III evaluation board which I found relevant to this issue. 

Proteus III PinoutThis is the Pinout of Proteus III. 

Kindly note that the BOOT pin is used as an anlog pin. This is shown in the layout of the Proteus III evaluation board. 

Evaluation board Layout

Please refer this document to see the complete layout of the board (Page 19) and other details if required. 

In order to clarify, I am using BOOT pin as mentioned in the layout above. (BOOT -> AIN0 / P0.02).

An internal pull up register is connected with this pin and this explains the reading of 3400+ value of ADC as mentioned earlier. 

The firmware came with the Proteus III module might had configurations for BOOT Pin but I have erased the whole chip and I have written my own firmware. So this wouldn't be a problem to use BOOT pin as an analog Pin right?  

I am not understanding why the pin is not changing its analog value. Even when the pin is provided with GND and VDD, its output in serial monitor remains same. Quite confusing.

1. Included proper pin mapping (Board Files).

2. Added required configurations to use internal HFCLK.

3. Digital pins and BLE working properly with the nordic examples and custom Firmware.

I dont know what I am missing out. I would appreciate any valuable feedback on this issue. In order to makes much more clear, kindly refer the documents  in this page if required.

Thank you in advance.  

  • Sorry. I forgot to mention that I am using SDK version 17.02 and softdevice s140_nrf52_7.2.0_API. 

  • Hi,

    How is the jumper on pin header P1 and JP2 configured? What voltage do you measure if you measure directly on the pin?  

    btw: This was a very good explanation of your issue, and what steps you've tried to find the root cause. 

    regards

    Jared 

  • Hi Jared,

    Thanks for the reply. 

    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't know why. It's weird. But you can find the default configuration table for JP2 on this file. (Page 10, table 6) 

    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. 

    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.  

    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't be a problem. 

    I think I am missing out on some important points but I am stuck with this for a couple of days. 

    Waiting for your reply.

    regards,

    Adarsh

  • Hi,

    Are you using an example from the SDK or is it custom fw that you're running? Could you upload your application along with the SDK config file and the custom board file? 

    regards

    Jared 

  • Hi Jared, 

    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).

    Here is the file. 

    saadc_Proteus.zip

    regards,

    Adarsh

Related