STM32L476RG Differential ADC functioning as singled-ended
I am working on a project using the STM32L476RG microcontroller and have run into an issue with using the ADC in differential configuration. When using the ADC configured as differential the output from the ADC is the same as if it was configured as a single-ended channel, meaning it contains a DC-offset of 1/2 VDD and is 1/2 my expected amplitude. To further explore this I have tested several things:
- Scoped the input to both channels of the ADC and can confirm both channels' AFE are operational and sampling noise is present on both channels
- Configured the ADC as singled eneded for both the positive and negative channel (ADC1 IN 5 and 6). Both of these outputs are similar to the differential configured version.
- Sampled both channels and in software created a pesudo-differential configuation where I subtract channel 6 from channel 5 before logging.
- Set the device to debug and checked on in the ADC SFR for the diffsel bit. The bit has been set correctly.
Some background on the steup I am using CubeMX with the latest STM32L4 FW package to generate startup code. The ADC is sampling off of timer 6 at 16khz and running off of an 80MHz clock, I have tried various sample time configurations currenlty using 47.5 cycles. The ADC is running on DMA into a circular buffer. I have tried casting this buffer as both signed and unsigned int16 and neither has changed the outputs. Below is a screen shot of my CubeMxSettings for the ADC.
For my application I can get away with a pesudo-differntial configuration, but I am wondering if there is somthing I have not setup correctly with the differential ADC inputs.

