Skip to main content
Visitor II
May 18, 2024
Solved

STM32F401CCU6 Black Pill faulty readings while interfacing external ADC

  • May 18, 2024
  • 3 replies
  • 1750 views

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

    This topic has been closed for replies.
    Best answer by mƎALLEm

    Hello,

    ST resources are dedicated to supporting genuine ST products. We are not committed to ensuring that clones/fakes work properly with the firmware we provide.

    Thank you for your understanding.

    3 replies

    Super User
    May 18, 2024

    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 .

     

    ATPLAuthor
    Visitor II
    May 21, 2024

    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

    mƎALLEmAnswer
    Technical Moderator
    April 14, 2025

    Hello,

    ST resources are dedicated to supporting genuine ST products. We are not committed to ensuring that clones/fakes work properly with the firmware we provide.

    Thank you for your understanding.