14972 views|16 replies

72

Posts

0

Resources
The OP

Help, STM32F103 ADC problem [Copy link]

I use two ADCs for data acquisition. No matter in independent mode or synchronous mode, PA0 (channel 0) will have burr-like signals, and PA1 (channel 1) will have a level of about 1.7V (half of the 3.3V power supply). Both pins are suspended, and the normal 0V is when the AD conversion is not started. And whether using ADC1 or ADC2, the situation is the same. Has any expert encountered this problem?

ADC_InitStructure.ADC_Mode = ADC_Mode_RegSimult;
ADC_InitStructure.ADC_ScanConvMode = DISABLE;
ADC_InitStructure.ADC_ContinuousConvMode = ENABLE; //Continuous conversion mode
ADC_InitStructure.ADC_ExternalTrigConv = ADC_ExternalTrigConv_None;
ADC_InitStructure.ADC_DataAlign = ADC_DataAlign_Right; //Data right-aligned
ADC_InitStructure.ADC_NbrOfChannel = 1;
ADC_Init(ADC1, &ADC_InitStructure);
ADC_RegularChannelConfig(ADC1, ADC_Channel_1, 1, ADC_SampleTime_55Cycles5);

ADC_InitStructure.ADC_Mode = ADC_Mode_RegSimult;
ADC_InitStructure.ADC_ScanConvMode = DISABLE;
ADC_InitStructure.ADC_ContinuousConvMode = ENABLE;
ADC_InitStructure.ADC_ExternalTrigConv = ADC_ExternalTrigConv_None;
ADC_InitStructure.ADC_DataAlign = ADC_DataAlign_Right;
ADC_InitStructure.ADC_NbrOfChannel = 1;
ADC_Init(ADC2, &ADC_InitStructure);
This post is from stm32/stm8

Latest reply

:) Good post marked  Details Published on 2015-6-9 01:49

76

Posts

0

Resources
2
                                 Correction: If PA0, PA1, and PA2 are all left floating, the situation is the same. When the ADC is started, the pin will have about 1/2 of the supply voltage. The previous situation of PA0 should be caused by the pull-down resistor. The situation is the same now. Is it a configuration problem? Has anyone encountered this?
This post is from stm32/stm8

75

Posts

0

Resources
3
                                 To prevent any influence, I left those pins floating. As long as the ADC is working, there will be a voltage of about 1.7V. I tried the examples that come with the library, using channel 14, and the situation is the same. My device is STM32F103RBT6, and I don't know where the problem is.
This post is from stm32/stm8

76

Posts

0

Resources
4
                                 I tested it again and it appears after the soft start conversion. It should appear during the conversion. If you choose the single conversion mode, it will return to 0V after the conversion. If you use an infinite loop to ADC_SoftwareStartConvCmd, it will always be at that level. Is there something wrong with the settings? The situation is the same when using the example program.
This post is from stm32/stm8

77

Posts

0

Resources
5
                                 Please do not leave the ADC input pin floating.
This post is from stm32/stm8

52

Posts

0

Resources
6
                                 Haha, this is a newbie's question. My input is based on resistor voltage division. I checked the relevant information and suspected that the input impedance is too large.
This post is from stm32/stm8

81

Posts

0

Resources
7


I didn't really pay attention to this problem when using AVR AD before, but I found that using STM32 ADC is more troublesome. I tried to input the measurement signal directly without voltage division before, but it directly affected the amplitude of the measurement signal. Do I really need to add a voltage follower? I am still debugging to see if there are other solutions.

I have already used ADC_SampleTime_239Cycles5. According to the information I found, the input impedance can reach 350K ohms. It still has problems. It is really not easy to use.
This post is from stm32/stm8

77

Posts

0

Resources
8
                                 There were many problems when I used it for the first time. I thought it was easy to use and there was no need to pay attention to many things. It seems that the analog input of STM32 has many requirements. Now I have made a large number of boards and it is almost unusable. Fortunately, AD acquisition is not the main function. Before, two 1K resistors were used to divide the voltage to measure the signal. Now it is changed to 51K, which has little effect on the original signal. (When it is 1K, the original 2V signal is increased to 1.3V when connected to STM32). It seems that I can only add a voltage follower next time.
This post is from stm32/stm8

73

Posts

0

Resources
9
Correction: If PA0, PA1, and PA2 are all left floating, the situation is the same. When the ADC is started, the pin will have about 1/2 of the supply voltage. The previous situation of PA0 should be caused by the pull-down resistor. The situation is the same now. Is it a configuration problem? Has anyone encountered this? ...
This is normal:
1) I actually saw a similar situation when using STM32 AD
2) ST seems to have explained this issue, and I remember that this situation is related to the structure of AD.

But then again, in actual use, AD input is generally not left floating.
This post is from stm32/stm8

66

Posts

0

Resources
10
There were many problems when I used it for the first time. I thought it was easy to use and there was no need to pay attention to many things. It seems that the analog input of STM32 has many requirements. Now I have made a large number of boards, and they are almost unusable. Fortunately, AD acquisition is not the main function. Before, two 1K resistors were used to divide the voltage to measure the signal, and now it has been changed to 51K, which has changed the original...
The AD of STM32 is actually not difficult to use. For example, one end of a 10k potentiometer is connected to the power supply voltage (the other end is grounded). In this case, using the AD of STM32 to measure the voltage divider output of the potentiometer is still very accurate.
This post is from stm32/stm8

68

Posts

0

Resources
11
                                 Look and listen to the expert's explanation
This post is from stm32/stm8

70

Posts

0

Resources
12
                                 Learn something!
This post is from stm32/stm8

66

Posts

0

Resources
13
                                 The power supply is very accurate, which is mainly related to the impedance and output current of the measurement signal output by the front stage. I did not find any problems when debugging the development board, so I did not look closely at the internal structure. I compared the ADC structure of AVR and STM32. There is an amplifier inside AVR, because this makes it possible for AVR to have no problems when measuring the level signal in the same circuit voltage division, but STM32 has similar problems. So when using ADC in the future, you should pay more attention to impedance and other issues. The safer method is of course to add a voltage follower.
This post is from stm32/stm8

80

Posts

0

Resources
14
                                 Why is it hanging?
This post is from stm32/stm8

71

Posts

0

Resources
15
                                 Yes, it is necessary to add a voltage follower at the output stage to ensure that the impedance is large enough.
This post is from stm32/stm8

73

Posts

0

Resources
16
                                 When collecting signals, the input impedance must be large enough
This post is from stm32/stm8

16

Posts

1

Resources
17
:) Good post marked
This post is from stm32/stm8

Find a datasheet?

EEWorld Datasheet Technical Support

Related articles more>>

    EEWorld
    subscription
    account

    EEWorld
    service
    account

    Automotive
    development
    circle

    Robot
    development
    community

    Copyright © 2005-2025 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
    快速回复 返回顶部 Return list