I am using an MCP3008 ADC connected to a Seeed Studio Xiao nRF52840.
I am using the adafruit library #include <Adafruit_MCP3008.h>
It operates as expected, but after taking readings I would like the MCP to 'turn off' or enter into sleep mode.
Before I call the function adc.begin(pin_adcCS);
the current draw of the circuit is 150uA, once the MCP turns on, it draws about 1mA.
In the datasheet, it says you can set the CS pin high in order to set the MCP into "low-power" mode. However, I don't observe a change in current consumption.
I am attempting to put it into low-power mode by calling:
adc.begin(pin_adcCS); //turn on adc
doorVal = adc.readADC(1); //take reading
pinMode(pin_adcCS, OUTPUT); //change CS pinmode
digitalWrite(pin_adcCS, HIGH);//write to the MCP
delay(100);
pinMode(pin_adcCS, INPUT);//Change back to INPUT to reduce current consumption
I tried to keep the pin high for longer and see if the current dropped, but there was no change, it appears to have no effect.
Any ideas about what I could be missing here?
loop()
even after one conversion? \$\endgroup\$