打印

PSoC牛人**

[复制链接]
1536|8
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
Go_PSoC|  楼主 | 2013-2-18 10:27 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
PSOC, AN, ST, TI, TE


http://electronicdesign.com/analog/my-favorite-modulator-only-needs-leftover-components

DAVE是PSOC专家中的专家,他的文章还是很值得一看的

I’ve spent a lot of my career building analog-to-digital converters (ADCs) from whatever bits of stuff I can find lying around. In many cases, someone has decided that an analog signal needs to be digitized but has neglected to include an ADC to do it. This is where modulators shine. They allow an analog signal to be converted to a single logic stream where the percentage that the signal is high (density) is proportional to the original analog signal.
An ADC in its simplest form is a comparator, a digital-to-analog converter (DAC), and some processing smarts (Fig. 1). The control can be discrete logic, programmable logic, or a CPU. I once built a temperature control system where the control logic was a grad student. It was a very efficient design, since you don’t pay grad students anything, but difficult to ship in volume.



1. With a comparator, a DAC, and some logic, it’s possible to determine the value of an analog input within the resolution of the DAC.
The processing algorithm can be as easy as simply incrementing the DAC until a correct value is obtained, or it can use a complicated predictive coding technique. The most common approach is to use a binary search, also known as a successive approximation register (SAR) technique, probably because it makes for a better acronym.
You can make an inexpensive DAC by putting a pulse-width modulation (PWM) signal into an RC filter to produce an analog value. Most engineers have done this, and it’s often called the poor man’s DAC. The output value is proportional to the logic’s voltage level and the PWM duty cycle (density):
VDAC = VLogic • Density            (1)
If the RC filter is set at a low enough frequency to remove ripples, a 5-V pulse-width modulator with a 40% density (duty cycle) produces a 2-V output. Figure 2 shows what you get when you substitute the ADC’s DAC with this poor man’s DAC.



2. Replacing the DAC with a poor man’s DAC will simplify and reduce the cost of this circuit.
For this design, the logic must produce the correct density to determine the analog input. There are many different methods to generate the density and control the feedback loop. The density value either can be measured or is already known by the control logic. With this density and the logic’s voltage level, the analog input voltage can be calculated with the previous derived equation.
The simplest feedback scheme I know is to drive the input of the DAC filter high when its output is less than the input value and conversely drive the input to the filter high when the filter output is greater than the input. This is called a self modulator (Fig. 3).



3. A single flip flop can be used as the control of a self-modulator.
It’s my favorite modulator topology! It’s extremely simple to construct, and it can be easily constructed with leftover components in your system. Find a comparator, a flip flop, and a couple of passives, and you have an analog-to-density modulator. Couple this with a counter to measure the density, and you have an ADC.
Limits And Features
One limitation, if you consider it a limitation, is that it doesn’t respond immediately to quick-changing input signals. If the input changes faster than the RC filter can slew, the filter can’t immediately respond. The RC values determine the maximum allowable input slew.
I don’t consider this a limitation. I consider it a feature. A circuit that does not respond to fast moving signals is rejecting them and can be considered a slow-pass filter; i.e., passing slow moving signals and rejecting fast moving signals. Figure 4 shows that the addition of a differential unity gain amplifier allows the generation of slow-pass and fast-pass outputs.



4. When you stop thinking of slew as always a bad thing, interesting circuits can be constructed—in this case, a slew limited filter.
The nice thing about rejecting or isolating impulses with slew instead of phase is that the filters don’t ring. The disadvantage is that they are nonlinear and standard filter theory is of no use. Slew rate filters are best designed with PSPICE with follow-up construction and bench testing.
Another limitation is that the common-mode performance of the comparator’s inputs limits the input range. Few comparators will function well with inputs close to or at their supply rails and even worse outside the power rails. If performance outside out a comparator’s common-mode range is needed, consider the variation shown in Figure 5.



5. The addition of a gain setting resister and an offset voltage allows the input range to be modified, even outside the rails of the comparator.
By bringing the input into the negative input of the comparator through a resistor and then setting the positive input to a selectable offset voltage, the comparator’s input now functions in a desirable space between the rails. Equation 2 defines the input as a function of density, logic level voltage, resister values, and offset:



The equation shows that setting the ratio of the two resistors sets the gain or attenuation of the input. Setting RIn > ROut allows signals to be measured outside the rails of the comparator. Setting RIn < ROut amplifies the input signal, allowing the whole modulator range to be used for smaller signals. The offset voltage allows the adjustment of the center of the range, which can be set with either a DAC or the resistor divider.
What if you don’t have a spare comparator, or maybe you just want to show off? It’s possible to build a modulator with only a flip flop (Fig. 6). This circuit exploits the fact that the flip flop’s D input has a well-defined logic level threshold voltage. If you’re lucky, it’s maybe half the supply voltage.



6. Using the threshold of the flip flop’s input as the modulator’s compare point, this has to be the simplest analog-to-density modulator possible.
By feeding back the inverted output, negative feedback and modulation is achieved. It has the same range as the precious circuit, but the offset variable is replaced with the logic threshold value. Is it a very good modulator? You have to remember that it’s made with a single flip flop!
Conclusion
Just because you don’t have an ADC doesn’t mean you can’t digitize analog signals. The technique I’ve described here is the backbone of mixed-signal design. I define “mixed signal” as the cheapest analog you can get away with and fixing it up in the digital domain.
Since mixed signal is mostly digital, it will follow most digital design constraints, use most digital design tools, take mostly digital logic space, and follow a mostly digital price curve. It is a technique that will help you design cost-effective circuitry, and it’s necessary to understand to remain a competitive designer. Once mastered, it will open new dimensions to your designs.
To quote Elbert Hubbard, “Fences are for those who can not fly.” Time to fly!
DAVE VAN ESS is an application engineer, MTS, with Cypress Semiconductor. He has a BSEE from the University of Calif., Berkeley.

沙发
icecut| | 2013-2-18 14:30 | 只看该作者
这几个图不错

使用特权

评论回复
板凳
haidixibahe| | 2013-2-19 21:54 | 只看该作者
哎呀 看到公式就头疼呢

使用特权

评论回复
地板
chao11yue| | 2013-2-19 22:41 | 只看该作者
恩,很值得看看

使用特权

评论回复
5
engtafanzhuan| | 2013-2-19 22:44 | 只看该作者
专家中的专家果然厉害

使用特权

评论回复
6
xichengmadia| | 2013-2-19 23:03 | 只看该作者
果然很值得一看

使用特权

评论回复
7
beiwaroad| | 2013-2-19 23:05 | 只看该作者
确实给人一种耳目一新的感觉

使用特权

评论回复
8
taihezhibanh| | 2013-2-19 23:13 | 只看该作者
很有启发性

使用特权

评论回复
9
heibaiyinjiag| | 2013-2-19 23:15 | 只看该作者
说实话 没怎么看懂 晕

使用特权

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

本版积分规则

个人签名:迷你,但包含一切——隆重推荐Cypress中文迷你网站:http://cypress.21ic.com/ 赛普拉斯官方微博开通啦!http://e.weibo.com/cypresschina

898

主题

5336

帖子

15

粉丝