MCP356x1 Set to Full Shutdown mode

Post here to discuss any new features, components, chips, etc, that you would like to see in Flowcode.
Post Reply
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

MCP356x1 Set to Full Shutdown mode

Post by stefan.erni »

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
2026-09-01_14-40-36.PNG
2026-09-01_14-40-36.PNG (147.2 KiB) Viewed 1552 times
2026-09-01_14-42-33.PNG
2026-09-01_14-42-33.PNG (139.22 KiB) Viewed 1552 times
2026-09-01_14-46-14.PNG
2026-09-01_14-46-14.PNG (175.07 KiB) Viewed 1552 times
an ESP32 is simple to set in deep sleep mode:
2026-09-01_15-16-38.PNG
2026-09-01_15-16-38.PNG (30.72 KiB) Viewed 1552 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

Post by BenR »

Hello,

I've made a new function (SetShutdownMode) for you now and rolled it out to the library update system.

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

Post by stefan.erni »

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.

2026-09-02_14-55-26.PNG
2026-09-02_14-55-26.PNG (83.87 KiB) Viewed 1509 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

Post by BenR »

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.

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

Post by stefan.erni »

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

Post by BenR »

Hmm could be my retry timeout count is too high. I'll think if there's a better way to do this.

Post Reply