cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F373 SDADC configuration mystery, how should it work

I'm trying to use SDADC1 and SDADC2 to convert four signal (2 each) and I'm not getting good data. I'm using CubeMX to do the setup and I've selected Gain=1 Single-Ended zero reference for all inputs so I can convert a signal range of 0 to VDD on all inputs. SDADC2 is synced to SDADC1 and timer 13 is my trigger source for SDADC1. I can see conversions are happening as expected but the data for each first conversion is badly scaled and each second conversion result is always 32767. What should I look at?0693W00000Dq5jWQAR.png

3 REPLIES 3

Progress for anyone finding the same problem. The documentation is pretty deficient as there's no explanation of the SDADC output codes for the different modes, and I had to experiment to determine how it works. I hate that, engineering isn't a game where you have to solve puzzles set by chip suppliers. Anyway, in zero offset mode you only get to use half the ADC span and you only get out half the codes. Quite what the purpose is I don't know, but my signals were in the wrong half so the output was clipped. Changing to offset mode means I can convert the whole span.

Hello Olivier,

I am having a similar problem, with data clipping to 32767. Indeed the documentation is pretty deficient. In my case, I am using single-ended offset mode as well, to connect the negative input internally to 0 V. What's different is that I am using regular conversion instead of injected conversion. Have you ever tried this configuration?

I'll switch to injected conversion and see what happens.

Thanks for updating your own question.

Best regards,

Luiz Guilherme Enger

Luiz, I didn't try regular conversion but I would guess the scaling would be the same. My signals are negative going relative to the supply rail so I had to change the PCB, which was disappointing.