Hi Ben
The MCP356x1 is a nice 24Bit Ad converter.
There is a one-channel, two-channel, and four-channel version
with SPI and many possibilities and features.
The AD converter is working perfect with FC11
But especially with battery-powered devices, which are usually most time turned off, the Full Shutdown mode
would help reduce power consumption during deep sleep
Would it be possible to create two command?
Set Full Shutdown Mode
Exit Full Shutdown Mode
an ESP32 is simple to set in deep sleep mode:
MCP356x1 Set to Full Shutdown mode
-
stefan.erni
- Valued Contributor
- Posts: 1280
- http://meble-kuchenne.info.pl
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 245 times
- Been thanked: 257 times
-
BenR
- Matrix Staff
- Posts: 2289
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 634 times
- Been thanked: 840 times
Re: MCP356x1 Set to Full Shutdown mode
Hello,
I've made a new function (SetShutdownMode) for you now and rolled it out to the library update system.
I've made a new function (SetShutdownMode) for you now and rolled it out to the library update system.
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
-
stefan.erni
- Valued Contributor
- Posts: 1280
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 245 times
- Been thanked: 257 times
Re: MCP356x1 Set to Full Shutdown mode
Hi Ben
Perfect! It's working nice.
Normal working, the current from the Board is 61.8mA
The deepsleep current goes down to1.6mA and to 0.3mA (300uA) with shutdown the ADC.
Soon I include a LDO to turn off Analog part and and then I expect less than 200 μA
One more little thing.
Before I set the ADC to shutdown mode, I have to stop sampling; otherwise, the program crashes and restarts instead of going into deep sleep.
Perfect! It's working nice.
Normal working, the current from the Board is 61.8mA
The deepsleep current goes down to1.6mA and to 0.3mA (300uA) with shutdown the ADC.
Soon I include a LDO to turn off Analog part and and then I expect less than 200 μA
One more little thing.
Before I set the ADC to shutdown mode, I have to stop sampling; otherwise, the program crashes and restarts instead of going into deep sleep.
-
BenR
- Matrix Staff
- Posts: 2289
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 634 times
- Been thanked: 840 times
Re: MCP356x1 Set to Full Shutdown mode
Excellent glad that's working well.
I expect there is a wait for sample to be complete that is never returning once the ADC is in deep sleep mode. I'll have a look and see if we need to implement some kind of timeout to avoid hanging the entire application.
Edit: yes the SampleADC macro will block until the sample is complete. I'll add in a timeout mechanism.
Edit2: Timeout now implemented and added to the library updates. Hopefully with no negative consequences.
I expect there is a wait for sample to be complete that is never returning once the ADC is in deep sleep mode. I'll have a look and see if we need to implement some kind of timeout to avoid hanging the entire application.
Edit: yes the SampleADC macro will block until the sample is complete. I'll add in a timeout mechanism.
Edit2: Timeout now implemented and added to the library updates. Hopefully with no negative consequences.
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
-
stefan.erni
- Valued Contributor
- Posts: 1280
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 245 times
- Been thanked: 257 times
Re: MCP356x1 Set to Full Shutdown mode
Nothing has changed; I need to stop the IRQ, otherwise the system will crash and restart.
-
BenR
- Matrix Staff
- Posts: 2289
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 634 times
- Been thanked: 840 times
Re: MCP356x1 Set to Full Shutdown mode
Hmm could be my retry timeout count is too high. I'll think if there's a better way to do this.
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel