Hi,
I am working on a project using the nRF52832 and the nRF5 SDK 17.1.0. We have a sensor with non linear behaviour and in our attempt to linearize it we found an article in which the author manipulates some pins in a certain way, to charge and discharge a capacitor. So, for example, the author mentions:
"We configure PortPin1 as a digital output, PortPin2 as an analog input, and PortPin3 as a digital output. We compute the time required to charge C40 to approximately 300 mV, and set PortPin1 high for that duration; then set PortPin1 to an analog input so no further current flows in or out there".
This action of changing digital out to analog in and vise versa is described a few more times within the article. So, my question is: What is the best way to simulate this functionality? I tried initializing and uninitializing SAADC channels to simulate the Dout to Ain and Ain to Dout transition (all 3 pins were connected to the AINX pins). Also, since the real reason for this seems to be "so no further current flows in or out there" i tried just disconnecting the pins instead of somehow transitioning them to analog in (this time the only analog pin was pin2 so i can measure the voltage of the capacitor, as described in the article). I was not able to make it work properly until now so i wanted to make sure that the problem is not the way i am handling these pins.
The article is this:
https://www.electronicdesign.com/technologies/analog/article/21801671/signal-conditioning-with-force-sensing-resistors
Thank you,
Giannis