Page 1 of 1

MCP356x1 Init problem

Posted: Wed Jul 23, 2025 9:52 am
by stefan.erni
Hi to All

If I use the MCP356x1 init macro I get an error.
C:/Users/Desktop/esp-idf-2/mtxesp32s_sdkconfig/main/esp-project.c: In function 'FCD_07892_ADC_MCP356X1__Initialise':
C:/Users/Desktop/esp-idf-2/mtxesp32s_sdkconfig/main/esp-project.c:533:10: error: 'FCR_RETVAL' is used uninitialized [-Werror=uninitialized]

Re: MCP356x1 Init problem

Posted: Wed Jul 23, 2025 3:08 pm
by BenR
Hi Stefan,

Thanks for letting us know, hopefully resolved for you now via library updates.

Re: MCP356x1 Init problem

Posted: Wed Jul 23, 2025 3:27 pm
by stefan.erni
Hi Ben

Yes. Perfect! It's working.
Thank you very much.

Stefan

Re: MCP356x1 Init problem

Posted: Mon Aug 04, 2025 11:16 am
by stefan.erni
Hi Ben

I can compile, but when I send measured values to uart, I get an invalid device handle from SPI instead of measured values.

from my terminal program:
2025-08-04_12-09-27.PNG
2025-08-04_12-09-27.PNG (32.5 KiB) Viewed 585 times

Re: MCP356x1 Init problem

Posted: Tue Aug 05, 2025 9:06 am
by stefan.erni
Hi Ben

It's working now.
First I tested in software mode SPI and it was ok.

Then I reduced the prescale from 40Mhz to 20Mhz like in the pdf from the MCP35x1 and now the value are ok and no messages

reduced:
SNAG-0020.PNG
SNAG-0020.PNG (63.01 KiB) Viewed 565 times
result:
2025-08-05_09-58-09.PNG
2025-08-05_09-58-09.PNG (89.09 KiB) Viewed 565 times