cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F401CCU6 Black Pill faulty readings while interfacing external ADC

ATPL
Associate II

Hello Team,

I'm using STM32F401CCU6 Black Pill Board. I've used MCP3208 ADC from Microchip for my application. while interfacing with microcontroller, I'm unable to get readings for few test cases. as Vref is 5v and ADC is of 12bit resolution. I've tested for 0v, 2.5v and 5v. getting 4095 as correct readings while applying input to channel 5v but getting garbage/random readings on 0v and 2.5v.

I've tested with another microcontroller for the same and works well.

Kindly check this and let me know.

 

Hoping to hear from you soon.

 

Thanks and Regards,

Prajwal Bhuse

design@avyannatech.com

2 REPLIES 2
AScha.3
Chief II

Hi,

you run the MCP3208  at 5V ?

Then interface to cpu at 3v3 is a problem...

AScha3_0-1716042992246.png

... MCP needing 0.7*5 = 3.5V (but cpu has 3.3V ).

So you need some level shifter or lower the 5V supply to 3V3 .

 

If you feel a post has answered your question, please click "Accept as Solution".
ATPL
Associate II

Hi,
I've tested with MCP3208 keeping Vdd and Vref 3.3v. as ADC having 12 bits of resolution, so at 0v, nearby 0 readings are received, at 5v, 4095 is achieved but t 2.5v, value is not getting as 2048, it is showing 3000 - 3500.

Could you help me out in this scenario for achieving precise readings?

 

Kindly check this and let me know.

Hoping to hear from you soon.

 

Thanks for your support.

Thanks and Regards,

Prajwal Bhuse