Electronic – STM32F103C8T6 ADC value problem

pcb-designstm32

We are designed and printed the PCB of the stm32f103c8t6 blue pill board as per stm rules..
After fabrication and assembly finished, we connect the board to Keil software and device detected and the program also uploaded perfectly… we faced some problems listed below…

1.ADC value varied in the difference of ( + or – 50 ) ..total range is (0 – 4095)

2.we crossed checked the program with stm bluepill ( amazon board )..it works fine…but our pcb boardADC
value varied…it means program is good and hardware is something wrong.

3.we removed the crystal oscillator (8Mhz) in our board..ADC value works fine in our board.

Anybody kindly helps me with this problem..?

I have attached below the schematic layout image..

STM32f103c8t6

stm32f103c8t6 layout

Best Answer

I agree with analogsystemsrf that the power supply of the MCU is the likely problem. But there are more problems than mentioned.

Have a look at Application Note AN2586 (Getting started with STM32F10xxx hardware development). It clearly outlines how the power supply should be designed. Several issues should be improved:

  • Decoupling capacitors should be close to each power supply pin of the MCU
  • Analog supply should have a separate set of decoupling capacitors
  • Both the analog and the digital supply should have an additional bigger capacitor (1µF or 4.7µF in addition to the several 100nF ones)
  • The board should have a ground plane
  • The AMS1117 output capacitor (1µF) is at the lower limit

Update

As an example for a STM32F103C8 design with components on a single side only, see the below board.

I don't have the schematic or PCB layout but I'm quite confident the capacitors near the corners of the STM32 MCU are the decoupling capacitors. The component near the pins A2/A3 might even be a ferrite bead for the analog supply.

STM32F103C8 design

Related Topic