打印

STM32F103RB ADC遇到的奇怪问题

[复制链接]
4945|23
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
测量一个大电流,用2个1毫欧的电阻并联取样电压,OP2335放大50倍;
STM32的Vadd用REF3025供电的,最大测量电流为2.5/(0.5毫欧*50)=100A
图纸如下:
现在的问题是:当负载电流1A时,理论上运放输出为1A*0.5毫欧*50=25mv,在不接STM32时,是正常的;如果输出连接到cpu,信号就被拉低到几乎0V了。经过测试,负载电流至少2A时,STM32引脚输入才会有20多mv的变化;在图纸的运放后面,再加一个OP2335构成的射随,也不管用。
如果不接cpu,将op2335的输出加一个10K电阻到GND,信号有一点点衰减,但是正常。
总结:运放输出不接cpu引脚,电平正常;接引脚,被拉低。如果这样,电流的采样分辨率就太低了。
stm32的AD设置用DMA转移书据,设置为连续扫描和单次采样,都没有用;采样时间是239.5周期的,Fadc=14M。
是不是运放的接法有问题?还是STM32的输入阻抗问题?

1.jpg (66.72 KB )

1.jpg
沙发
ghostzjl|  楼主 | 2011-11-9 20:23 | 只看该作者
stm32F103RB是64脚的,VDDA接2.5V;

使用特权

评论回复
板凳
香水城| | 2011-11-9 21:13 | 只看该作者
VDD与VDDA之间的电压差不能超过0.3V,否则不能保证正常工作。

使用特权

评论回复
地板
airwill| | 2011-11-10 07:59 | 只看该作者
如果输出连接到cpu,信号就被拉低到几乎0V了。这个几乎0V 是 ADC 采样的结果,还是你用万用表量到的?
有个直觉, 处理楼上说的 VDDA 的问题,似乎还有可能是地线的问题

使用特权

评论回复
5
ghostzjl|  楼主 | 2011-11-10 09:54 | 只看该作者
To 香水城,
103 的VDDA用3.3V供电,无效;
To airwill
是用万用表量的,fluke111。但是103的采样结果也是0,在大电流和小电流时的AD值与万用表的测量值几乎一致;

新的测试:
将opA2335的输出直接接1K电阻到GND,信号也是正常的,说明OPA2335的输出驱动能力不算很低;
1.03A -25mv
0.82A - 10mV
0.7A - 2mv
也就是说电流低到0.7A时,运放输出基本上就没有电压了。
此时运放输入端电压0.5毫欧*0.7A=0.35mv,理论值。

使用特权

评论回复
6
ghostzjl|  楼主 | 2011-11-10 10:08 | 只看该作者
运放输入端加20mV信号,103的输入端是有信号的,幅度和理论值差不多。
由此可见,运放输出小信号时,50mV以下,再接到103的AD端,会衰减的非常厉害;如果是大信号,应该也有衰减,只是不明显;
推论:运放输出阻抗高于103的输入阻抗,因此小信号经过分压后,衰减大。
但是与下面2条矛盾:
1。OP2335直接带1K电阻到gnd时,信号正常。
2。103官方文档里说的:239.5周期-350K,1.5周期-1.2K的输入阻抗; ----- 这个我没找到,网上介绍的。

使用特权

评论回复
7
ghostzjl|  楼主 | 2011-11-10 10:14 | 只看该作者
调试直播,呵呵!
如果上面那个图,不加射随,带1K的电阻到gnd,效果和加射随是一样的,电压正常,和理论计算值一致;
0.5毫欧*1A*50倍=25mv

使用特权

评论回复
8
ghostzjl|  楼主 | 2011-11-10 10:29 | 只看该作者
用segger-Erase sectors,Erase chip,擦出103里面的程序,再测试,无效,OPA2335的输出仍然被拉低,1A负载电流时,103的输入引脚上电压接近4mv,理论应该为25mv;

使用特权

评论回复
9
skyfight| | 2011-11-10 10:45 | 只看该作者
关注中。。。。

使用特权

评论回复
10
ghostzjl|  楼主 | 2011-11-10 11:17 | 只看该作者
图片和文字插入太麻烦了,直接用图片传。

2.jpg (124.91 KB )

2.jpg

3.jpg (30.67 KB )

3.jpg

使用特权

评论回复
11
ghostzjl|  楼主 | 2011-11-10 11:42 | 只看该作者
更换为TI的TLV2252A,因为它与358的结构不同,从结构上看,它的输出能力应该更强一点,因为内部没有接输出电阻。

4.jpg (41.91 KB )

4.jpg

使用特权

评论回复
12
ghostzjl|  楼主 | 2011-11-10 11:43 | 只看该作者
运放的输出是开路的,啥都没接。但2252的输出电压比2335要低一倍,不知道什么原因?

使用特权

评论回复
13
ghostzjl|  楼主 | 2011-11-10 11:45 | 只看该作者
3个运放的内部简图

5.jpg (34.19 KB )

5.jpg

6.jpg (25.11 KB )

6.jpg

使用特权

评论回复
14
airwill| | 2011-11-10 11:47 | 只看该作者
2335 在 DATASHEET 的 SBOS245D 第一页说输出 ±10mA。
第三页
OUTPUT
Voltage Output Swing from Rail RL
= 10kΩ, Over Temperature 15 100 mV
Voltage Output Swing from Rail RL
= 100kΩ, Over Temperature 1 50 mV
Short-Circuit Current ISC ±50 mA
Capacitive Load Drive CLOAD See Typical Characteristics

输出能力也不算太差。
是不是电源电压小于它允许的最小值 2.7V 了?

使用特权

评论回复
15
ghostzjl|  楼主 | 2011-11-10 12:07 | 只看该作者
2335是5V供电的,第一页图上有,测量也是准确的;

使用特权

评论回复
16
HighCall| | 2011-11-10 15:52 | 只看该作者
[img][/img]

使用特权

评论回复
17
HighCall| | 2011-11-10 15:55 | 只看该作者
Important notes STM32F103xx
76/79
Appendix A Important notes
The notes listed below apply to STM32F103xx devices Revision Z. For more details on how
to identify the device Revision, please refer to section 20.6.1 MCU device ID code in the
STM32F10xxx reference manual.
A.1 PD0 and PD1 use in output mode
The use of PD0 and PD1 in output mode is limited as in this mode, PD0 and PD1 can only
be used at 50 MHz.
A.2 ADC auto-injection channel
When the ADC clock prescaler ranges from 4 to 8, a delay of 1 ADC clock period is
automatically inserted when switching from regular to injected conversion (and conversely,
from injected to regular). When the ADC clock prescaler is set to 2, the delay is 2 ADC clock
periods.
A.3 ADC combined injected simultaneous + interleaved
When the ADC clock prescaler is set to 4, the interleaved mode does not recover with
evenly spaced sampling periods: the sampling interval is 8 ADC clock periods followed by 6
ADC clock periods, instead of 7 clock periods followed by 7 clock periods.
A.4 Voltage glitch on ADC input 0
A low-amplitude voltage glitch can be generated on ADC input 0, when the ADC is
converting with injection trigger, in very specific cases.
It is generated by internal coupling and synchronized to the beginning and the end of the
injection sequence, whatever the channel(s) to be converted.
It has an amplitude of less than 150 mV and a typical duration of 10 ns (measured with the
I/O left unconnected). This has no influence on the digital output signals or the digital inputs,
providing that they are driven with a reasonably low impedance.

使用特权

评论回复
18
jxk304| | 2011-11-10 16:40 | 只看该作者
我有个疑问,1毫欧的电阻,精度得达到多少,才能让取样出来的电压准确?现在的电阻精度有这么高了?我真的不知道,请大家指教。

使用特权

评论回复
19
huanben| | 2011-11-10 19:51 | 只看该作者
你这运放是什么电路啊?

电流源直接接到正向端,那正向端的电压跟输入电流什么关系?

使用特权

评论回复
20
zhang@long| | 2011-11-10 20:47 | 只看该作者
学习中!

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

18

主题

79

帖子

0

粉丝