Does the nrf54l15 support ADC internal pull-down resistor?

I have an adc connection I want to sample quickly after an event. The connection has some capacitance which is limiting how fast my value can update, so I want to drain the voltage faster (in order to get a valid sample quicker). Since the circuit is already made, I was looking into software solutions. I can configure the gpio pin as a pull down for 1ms to drain the voltage, then disconnect it and sample, but it seems that the saadc peripheral doesn't like me doing that (the adc values take 10-20ms to stabilize afterward). I see some other nordic chips (nrf52) have adc pull-up/down resistors which can be enabled. Does the nrf54l15 have anything like that? 

Parents
  • Hi,

    You are right  that the nRF54L15 also has configurable pull resistors on GPIO pins. However, pull resistors cannot be used when the pin is used as analog input, as in that case the GPIO port is bypassed. See this figure from the GPIO chapter in the datasheet:

    So to enable the pull down, you will have to re-configure the PIN as GPIO (that means it is disconnected from the SAADC), and afterwards, configure it back as analog input. It is not entirely clear to me, but the way I read your post, that seems to be what you are doing already, and if so, I cannot see that there is more you can do from a software perspective.

  • Hi Einar,

    Thanks for the detailed response. You are right, re-configuring as a GPIO (input, pull-down) is what I tried to do. I saw on the scope that this does drain the voltage. However, after configuring it back as an analog input, the values I got out of the ADC for the next 20ms looked to be similar to the high values before the voltage was drained (20ms is also around how long the voltage took to drain without the pull-down). I would have expected that the ADC value read would reflect what the scope sees (low values in <1ms), at a slight delay from my ADC sampling time (I sample every 50us, x2 for previous scan in DMA buffer, so max of 100us delay). Should I be able to get valid values from my ADC in this situation, or is there some other effect from the configuration swap that would make this not work how I want it to?

  • Hi,

    I see. Perhaps a part of the problem here is a very high source resistance in the signal you are sampling? Conceptually the SAADC can be seen as having an internal capacitor, and then charging/discharging it takes longer time, where the acquisition time needs to be increased. This will by nature limit how fast you can sample, but here we should be talking about talking microseconds, and not milliseconds that you are describing.

    I think the next step here is to look more closely at your hardware, I am not able to say more than this from only the nRF perspective.

  • Hi,

    I found the issue actually stemmed from a different part of my code related to reading from the active ADC DMA buffer. Looking around, I don't see any examples of reading previous samples from the DMA buffer directly, so I'd be interested if you have any recommendations in order to do that. Marking your previous answer as verified as this new question is not directly related to the topic.

  • Hi,

    I am glad you found the issue.

    I am not sure I understand what you are describing here, though. After the current buffer is full and the END event is generated, you typically provide a new buffer and re-start sampling (if sampling continuously). The previous buffer is then not used by the SAADC anymore (until it is potentially re-used, for instance by being provided again if you for instance alternate between two buffers). That is then just as any other RAM buffer that can be read an arbitrary number of times.

  • Hi,

    The process you describe is how I generally use the buffers. For this particular case however, I was attempting to get samples from the active buffer before it filled up. I was using NRF_SAADC->RESULT.CURRENTAMOUNT to get the number of bytes finished in the buffer, and then went 2 samples back to make sure that I wasn't reading something that was currently being written. The issue was that for whatever reason, when I read these samples, they seemed to be much older than what 2 samples previous should be (2*50us).

  • Hi,

    I see. This approach is not recommended. The data is not guaranteed to be valid before the END event. From the EasyDMA section in the SAADC chapter in the datasheet:

    The EasyDMA will have finished accessing the RAM when the END or STOPPED event has been generated.

Reply Children
No Data
Related