Searching \ for 'Sigma Delta Converter' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/index.htm?key=sigma+delta+converter
Search entire site for: 'Sigma Delta Converter'.

Truncated match.
PICList Thread
'Sigma Delta Converter'
1999\06\13@184542 by Russell McMahon

picon face
Has anyone implemented a Sigma Delta converter in software, whether
with a PIC or otherwise.
I haven't but I am probably about to.

For those who haven't met them, in their simplest form a sigma-delta
converter is an integrator followed by a comparator (effectively a 1
bit A2D) which tracks the signal. The mean output (digital) signal is
the input signal. This can be measured by averaging o=r by using a
digital filter. Essentially any desired sensible level of accuracy
can be achieved given enough conversion time.




regards


       Russell McMahon

1999\06\13@233854 by Tjaart van der Walt

flavicon
face
Russell McMahon wrote:
>
> Has anyone implemented a Sigma Delta converter in software, whether
> with a PIC or otherwise.
> I haven't but I am probably about to.
>
> For those who haven't met them, in their simplest form a sigma-delta
> converter is an integrator followed by a comparator (effectively a 1
> bit A2D) which tracks the signal. The mean output (digital) signal is
> the input signal. This can be measured by averaging o=r by using a
> digital filter. Essentially any desired sensible level of accuracy
> can be achieved given enough conversion time.

Walter has a full explanation and pictures too :
http://www.bytecraft.com/addaconv.html

If you pick Ri, Rf, and the sample times wisely, you
have zero maths to do, and the code becomes :
PinA := !PinB

--
Friendly Regards          /"\
                         \ /
Tjaart van der Walt        X  ASCII RIBBON CAMPAIGN
spam_OUTtjaartTakeThisOuTspamwasp.co.za  / \ AGAINST HTML MAIL
|--------------------------------------------------|
|  Cellpoint Systems SA    http://www.cellpt.com   |
|--------------------------------------------------|
|     http://www.wasp.co.za/~tjaart/index.html     |
|             WGS84 : -26.0124 +28.1129            |
|             Voice : +27 (0)11 2545100            |
|--------------------------------------------------|


'Sigma Delta Converter'
1999\07\12@092215 by Russell McMahon
picon face
I asked about this some weeks ago but a second query may be useful.

I am trialling a Sigma Delta analog to digital converter. This SHOULD
allow low cost high accuracy A2D with modest conversion speed.

Results to data only get so good (about 1/2 percent accuracy -
slightly worse than 8 bits)(plus a few worse results here and there)
and then seem to offer rapidly diminishing returns. Using more
conversion cycles doesn't seem top help much. I'm using 2048 counts
at present and would EXPECT much better results.

I have used both a standard microprocessor input pin as the sense
element (PIC) and an internal  comparator (Z8) and an external op-amp
(LM324) as comparator. I am aware of the poor performance of the
LM324 as a comparator but am compelled to use it if at all possible
due to cost considerations. If it CANT be used then something else
will be used but at around $US0.16 in volume for a quad op-amp it is
very attractive. I also need to deal with a  0 to 0.2V input signal
so an amplifier is desirable.

Anybody had better than about 1/2% accuracy results from a Sigma
Delta built discretely?
Any thoughts on the process?
This is a stunningly cheap and simple method for A2D if it would only
work :-) - once sorted it would/will prove a boon to other PIC users.


regards


Russell McMahon

1999\07\12@123411 by Reginald Neale

flavicon
face
 Russell asked:

>I asked about this some weeks ago but a second query may be useful.
>
>I am trialling a Sigma Delta analog to digital converter. This SHOULD
>allow low cost high accuracy A2D with modest conversion speed.
>

 lots skipped

>Any thoughts on the process?
>This is a stunningly cheap and simple method for A2D if it would only
>work :-) - once sorted it would/will prove a boon to other PIC users.
>

 Are you  aware of the article in SENSORS magazine 2-3 yrs ago
 on this topic? The authors were using it for a pressure sensor
 system.

 I'm at home without my resources but if this is of interest I'll find
 it for you.

 Regards,
 Reg Neale

1999\07\12@182135 by Dennis Plunkett

flavicon
face
At 01:13 13/07/99 +1200, you wrote:
{Quote hidden}

An LMC660 comes close to the bargin price, but the 324 should do. Some more
information is required, are you using a split supply for the OPAMP, if not
how close to 0V do you get. When you say 0.5% error at what voltage input
level is this? Is the error at the same input level or over the entire range?
The 324 has a 2mV offset that's up to 1% error in 200mV! Also are you using
dual slope conversion or single slope?
The number of counts not altering the value indicates that this is what the
converter is reading, so I would dare say that the reference is also ok.
But a Z8! Bad boy!
Please tell me more

Dennis

1999\07\12@204106 by Mike Keitz

picon face
On Tue, 13 Jul 1999 01:13:23 +1200 Russell McMahon <.....apptechKILLspamspam@spam@CLEAR.NET.NZ>
writes:

>I have used both a standard microprocessor input pin as the sense
>element (PIC) and an internal  comparator (Z8) and an external op-amp
>(LM324) as comparator. I am aware of the poor performance of the
>LM324 as a comparator

The 324's comparator brother the 339 (also offered in a dual unit, the
393) should be about the same cost.  But then you need two chips unless
you can make the 339 work well as an amplifier.  There was a chip with
324 type amplifiers and 339 comparators on one chip.  It's likely been
discontinued.  Probably the major problem with the 324 is its low
bandwidth.  If you slow the whole process down it may work better.

Amplifying the signal before appling it to a MCU pin ought to improve
that method.  Metal-gate (4000 series) CMOS gates biased into linear
operation make decent rock-cheap amplifiers.  The 4069UB is the best
choice, but other gates will work if you happen to also need a logic gate
in the circuit.  Also, amplifiers made from 2-input gates can be placed
in low-power shutdown easily by a logic signal applied to the other
input.  These amplifiers are maybe not so good for DC precision but work
well with small high-impedance AC signals.



___________________________________________________________________
Get the Internet just the way you want it.
Free software, free e-mail, and free Internet access for a month!
Try Juno Web: dl.http://www.juno.com/dynoget/tagj.

1999\07\13@035049 by Russell McMahon

picon face
Dennis,


I'm using a Z8 due to overwhelming cost advanateg at 10,000 up
quantity with hardware 20 KHz PWM and 1 comparator. I'd have been
happy to use a PIC but the price was nowhere near the Z8+ I'm using.

I have control of the FET which is supplying the current being
measured so can zero calibrate whenever I wish (subject to user not
noticing ;-))
This allows me to compensate for offsets and bias currents subject to
certain limitations. I can calibrate for fullscale (or any other 1
chosen operating point) during setup.

LMC660 is about 4 or 5 times dearer than LM324 as far as I can see.
So are most other "real" opamps. The 324 does some very nasty things
which have to be worked around, BUT its sooo cheap. IF you can use it
its the way top go. If you can't  you shout for joy and go and use
something real :-).

regards



Russell McMahon




{Original Message removed}

1999\07\13@035101 by Russell McMahon

picon face
Mike

Thanks for the thoughts.
I'm aware of using CMOS inverter s an amp - in this app its not too
good - I'm right on one rail of a 5 volt supply (0 - 0.2 volts to
sense). CMOS works best with voltage in refd to centre point.

339 is a MUCH better comparator (of course) but gain is not  a nice
trick - could make a class D amp (I considered it) but there would be
more problems there. I have used a Schmitt gate as an amplifier
before today - you get  a rail to rail pulse length modulated signal
out which can be low pass filtered - lots of fun.


Russell
-----Original Messag

e-----
From: Mike Keitz +ADw-mkeitz+AEA-JUNO.COM+AD4-
To: PICLIST+AEA-MITVMA.MIT.EDU +ADw-PICLIST+AEA-MITVMA.MIT.EDU+AD4-
Date: Tuesday, July 13, 1999 12:52 PM
Subject: Re: Sigma Delta Converter


+AD4-On Tue, 13 Jul 1999 01:13:23 +120- Russell McMahon
+ADw-apptech+AEA-CLEAR.NET.NZ+AD4-
+AD4-writes:
+AD4-
+AD4APg-I have used both a standard microprocessor input pin as the sense
+AD4APg-element (PIC) and an internal  comparator (Z8) and an external
op-amp
+AD4APg-(LM324) as comparator. I am aware of the poor performance of the
+AD4APg-LM324 as a comparator
+AD4-
+AD4-The 324's comparator brother the 339 (also offered in a dual unit,
the
+AD4-393) should be about the same cost.  But then you need two chips
unless
+AD4-you can make the 339 work well as an amplifier.  There was a chip
with
+AD4-324 type amplifiers and 339 comparators on one chip.  It's likely
been
+AD4-discontinued.  Probably the major problem with the 324 is its low
+AD4-bandwidth.  If you slow the whole process down it may work better.
+AD4-
+AD4-Amplifying the signal before appling it to a MCU pin ought to
improve
+AD4-that method.  Metal-gate (4000 series) CMOS gates biased into linear
+AD4-operation make decent rock-cheap amplifiers.  The 4069UB is the best
+AD4-choice, but other gates will work if you happen to also need a logic
gate
+AD4-in the circuit.  Also, amplifiers made from 2-input gates can be
placed
+AD4-in low-power shutdown easily by a logic signal applied to the other
+AD4-input.  These amplifiers are maybe not so good for DC precision but
work
+AD4-well with small high-impedance AC signals.
+AD4-
+AD4-
+AD4-
+AD4AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwB
fAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwB
fAF8AXwBfAF8AXwBfAF8AXw-
+AD4-Get the Internet just the way you want it.
+AD4-Free software, free e-mail, and free Internet access for a month+ACE-
+AD4-Try Juno Web: dl.http://www.juno.com/dynoget/tagj.
+AD4-

1999\07\13@093722 by Jack Shidemantle

flavicon
face
This may not apply directly to your situation. I tried rolling my own ÊV to
I converter to use as a single slope A/D converter with a PIC a year ago
(Similiar to one of their app notes). It worked ok but could not get good
stability and repeatability better than 0.5% to 1%. I needed 0.1% so was
forced to go with a commercial dual slope A/D. I would like to get a sigma
delta unit which will give me a good 14 bits. Understand Tel-Com is working
on one but not available yet. If you come up with something I would be very
interested.

@
Sent by: pic microcontroller discussion list <PICLISTspamKILLspamMITVMA.MIT.EDU>
07/13/99 08:25 AM ZE10
Please respond to pic microcontroller discussion list

To: .....PICLISTKILLspamspam.....MITVMA.MIT.EDU
cc:
bcc:
Subject: Re: Sigma Delta Converter


At 01:13 13/07/99 +1200, you wrote:
{Quote hidden}

An LMC660 comes close to the bargin price, but the 324 should do. Some more
information is required, are you using a split supply for the OPAMP, if not
how close to 0V do you get. When you say 0.5% error at what voltage input
level is this? Is the error at the same input level or over the entire
range?
The 324 has a 2mV offset that's up to 1% error in 200mV! Also are you using
dual slope conversion or single slope?
The number of counts not altering the value indicates that this is what the
converter is reading, so I would dare say that the reference is also ok.
But a Z8! Bad boy!
Please tell me more

Dennis

1999\07\13@100812 by John Griessen

flavicon
face
Your goal is low cost--skip dual slope for now...1/2% is way above that...

What strikes me from my lab bench experience with sigma delta front ends and
from some DSP code for
a sigma delta interpolator is the way this method always has a
part in the signal loop that drives as well as measures.  Look at the
way the input terminals of the comparator and/or amplifier  affect the
quality of the voltage on the interpolating capacitor and the quality of the
voltage
of the measured signal.  Either loading, or noise, or input current mismatch
could cause a lack of accuracy.  The 1/2% is likely an analog design
problem.

To keep your costs in the $US0.16 in volume for a quad op-amp
range it is hard to add resistors and
such...but that may account for the 1/2%.  See if you can think
of a way to use
the extra amps in the package as mirror image or chained pieces in the
signal path,(even if they cause an equal delay).  Use them to
create equal input offset currents--they are a matched set.  Use them
to reduce load on the measured signal.  Create noise immunity.
Where is their linear input operating voltage relative to the power
supply voltage available?--can their function as comparators be improved
economically by powering them from a separate voltage than the uP? (for 2
kinds of improvement potential--random noise, and DC operating point).

This economic balancing againxt performance
is the toughest and the most rewarding
part of the art--do not expect much help from any cookbook anywhere...
just trial, err, and observe observe observe...

John G. Austin TX

> {Original Message removed}

1999\07\13@214703 by Marcos Migliorini

flavicon
face
If you want a good sigma delta converter take a look at  http://www.linear-tech.com
(LTC2400 24 bits sigma delta a/d).

Marcos

----- Mensaje original -----
De: Jack Shidemantle <EraseMEJShidemantlespam_OUTspamTakeThisOuTYSI.COM>
Para: <PICLISTspamspam_OUTMITVMA.MIT.EDU>
Enviado: Martes, 13 de Julio de 1999 10:38 a.m.
Asunto: Re: Sigma Delta Converter


This may not apply directly to your situation. I tried rolling my own V to
I converter to use as a single slope A/D converter with a PIC a year ago
(Similiar to one of their app notes). It worked ok but could not get good
stability and repeatability better than 0.5% to 1%. I needed 0.1% so was
forced to go with a commercial dual slope A/D. I would like to get a sigma
delta unit which will give me a good 14 bits. Understand Tel-Com is working
on one but not available yet. If you come up with something I would be very
interested.

@
Sent by: pic microcontroller discussion list <@spam@PICLISTKILLspamspamMITVMA.MIT.EDU>
07/13/99 08:25 AM ZE10
Please respond to pic microcontroller discussion list

To: KILLspamPICLISTKILLspamspamMITVMA.MIT.EDU
cc:
bcc:
Subject: Re: Sigma Delta Converter


At 01:13 13/07/99 +1200, you wrote:
{Quote hidden}

An LMC660 comes close to the bargin price, but the 324 should do. Some more
information is required, are you using a split supply for the OPAMP, if not
how close to 0V do you get. When you say 0.5% error at what voltage input
level is this? Is the error at the same input level or over the entire
range?
The 324 has a 2mV offset that's up to 1% error in 200mV! Also are you using
dual slope conversion or single slope?
The number of counts not altering the value indicates that this is what the
converter is reading, so I would dare say that the reference is also ok.
But a Z8! Bad boy!
Please tell me more

Dennis

1999\07\13@215528 by Wagner Lipnharski

picon face
Pretty one, already tested.
DIP 8 small package... without nasty programming.
Some small problems with grounding, but works nice.
Wagner.

Marcos Migliorini wrote:
{Quote hidden}

--
--------------------------------------------------------
Wagner Lipnharski - UST Research Inc. - Orlando, Florida
Forum and microcontroller web site:  http://www.ustr.net
Microcontrollers Survey:  http://www.ustr.net/tellme.htm

1999\07\14@082136 by Tom Handley

picon face
re: LTC2400 24-Bit ADC

  Ditto Marcos and Wagner's comments. I use two of them with a
precision external reference hooked up to a PIC. Very easy to program.
The results have been excellent. These are ideal for precision
voltmeters which is what I'm doing (2-channel with differential inputs).
Two status Bits provide Sign and Extended Range information which make
it easy to implement an auto-ranging DVM. There are other features such
as an internal oscillator, 110db 50/60Hz rejection, Auto Shutdown, 12.5%
Overrange and Underrange, reference voltage range of 0.1V to 0.9 x VCC,
and a 3-wire SPI interface. All this in a SO-8 package.

  - Tom

At 09:53 PM 7/13/99 -0400, Wagner Lipnharski wrote:
>Pretty one, already tested.
>DIP 8 small package... without nasty programming.
>Some small problems with grounding, but works nice.
>Wagner.
>
>Marcos Migliorini wrote:
>>
>> If you want a good sigma delta converter take a look at
http://www.linear-tech.com
>> (LTC2400 24 bits sigma delta a/d).
>>
>> Marcos

1999\07\14@091207 by Jack Shidemantle

flavicon
face
That's on my todo list, thanks guys.



                   Wagner
                   Lipnharski            To:     PICLISTEraseMEspam.....MITVMA.MIT.EDU
                   <wagnerl@EARTH        cc:
                   LINK.NET>             Subject:     Re: Sigma Delta Converter
                   Sent by: pic
                   microcontrolle
                   r discussion
                   list
                   <PICLIST@MITVM
                   A.MIT.EDU>


                   07/13/99 09:53
                   PM
                   Please respond
                   to pic
                   microcontrolle
                   r discussion
                   list





Pretty one, already tested.
DIP 8 small package... without nasty programming.
Some small problems with grounding, but works nice.
Wagner.

Marcos Migliorini wrote:
>
> If you want a good sigma delta converter take a look at
http://www.linear-tech.com
{Quote hidden}

to
> I converter to use as a single slope A/D converter with a PIC a year ago
> (Similiar to one of their app notes). It worked ok but could not get good
> stability and repeatability better than 0.5% to 1%. I needed 0.1% so was
> forced to go with a commercial dual slope A/D. I would like to get a
sigma
> delta unit which will give me a good 14 bits. Understand Tel-Com is
working
> on one but not available yet. If you come up with something I would be
very
{Quote hidden}

more
> information is required, are you using a split supply for the OPAMP, if
not
> how close to 0V do you get. When you say 0.5% error at what voltage input
> level is this? Is the error at the same input level or over the entire
> range?
> The 324 has a 2mV offset that's up to 1% error in 200mV! Also are you
using
> dual slope conversion or single slope?
> The number of counts not altering the value indicates that this is what
the
> converter is reading, so I would dare say that the reference is also ok.
> But a Z8! Bad boy!
> Please tell me more
>
> Dennis

--
--------------------------------------------------------
Wagner Lipnharski - UST Research Inc. - Orlando, Florida
Forum and microcontroller web site:  http://www.ustr.net
Microcontrollers Survey:  http://www.ustr.net/tellme.htm

1999\07\14@185018 by Russell McMahon

picon face
Yes, LTC2400 is  a very nice product indeed but not suitable for my
application due to the need for ultimate low cost. The processor is
set due to other considerations and I must live withing its
constraints while costing approx nothing at all. What I have achieved
(see separate post) will do what I want (9 or 10 bits accuracy - 8
probably OK) using an LM324, 9 resistors (including an amplifier and
"reference", zener and 3 capacitors. Assembly costs and board space
costs all add up but still far below LTC2400 cost I imagine - I
couldn't find a price at Digikey, Pioneer or Netbuy. How much are you
buying them for?


RM



{Original Message removed}

1999\07\14@190509 by Wagner Lipnharski

picon face
Linear Technologies said about $14.
LM324 + Zener + 9 resistors + 3 capacitors would take you close to $4 to
$6, considering that the LTC2400 is 24 bits ADC, your cost is totally
proporcional to dollars per bits of resolution.
Remember that LTC2400 is quite new, less than 6 months old, some
distributors don't have it available yet since it is not consumed in
billions, but because its easy operation I believe it would has a nice
place into the marketshare of ADC's.
Wagner.

Russell McMahon wrote:
{Quote hidden}

1999\07\14@194917 by Richard Prosser

flavicon
face
I shouldn't comment on prices but for SMD
I'd guess at $US1.18 for LM324, 9 resistors, 3 caps & a zener - (or $NZ2.40
max) overall cost very dependent on pcb size, shape etc.

Displays, PCB, connectors and metalwork are the major cost items. Standard
electronic component costs are pretty well negligable by comparison.


Of course if you buy everything from RS......

By the way - what temperature are you running at. We have had to change to
LM224s to meet high temperature requirements (and we pay more as a
consequance).

Richard

> {Original Message removed}

1999\07\14@202249 by Dennis Plunkett

flavicon
face
At 11:46 15/07/99 +1200, you wrote:
>I shouldn't comment on prices but for SMD
>I'd guess at $US1.18 for LM324, 9 resistors, 3 caps & a zener - (or $NZ2.40
>max) overall cost very dependent on pcb size, shape etc.
>
>Displays, PCB, connectors and metalwork are the major cost items. Standard
>electronic component costs are pretty well negligable by comparison.
>
>
>Of course if you buy everything from RS......
>
>By the way - what temperature are you running at. We have had to change to
>LM224s to meet high temperature requirements (and we pay more as a
>consequance).
>

Rubbish!
The cost of any component is always to be considered. It seems that you may
be stuck in a less than 1000 production run world.
It is the total cost of the electronic components that has to be cinsidered
including the cost of one off components, size and other formfactot
problems that such may induce incluing manufacture and test cost. If an IC
costs $14 and the sperate components cost $2.40 (This indicates that you
have not had real exposure to large scale production), then one can expect
that the other costs including kitting storage and procurment will add
arounf %10, or $.24 for one case and $1.4 for the otehr case. This is then
altered by teh cost to manufacture $.02 per component, say $15.42 and $2.9,
then add the test cost (Around 40% of the manufatured cost (Complete) and
one can see that the componsnt cost is signifficant. To this assume that
the otehr compents eg metal work etc increase by %1, so if the case cost
$20 and the PCB $10, and packaging $3, the extra cost is now $6.2 vs $15.42
add test cost. I think that the difference is still large, around 1/2 the
cost.
Take this to the extrame with good component buying, and you can save the
company over $1M per year

Dennis

1999\07\14@211315 by Richard Prosser

flavicon
face
I seem to have been bitten! - Sorry - I don't think I made my point very
clear.

I was trying to point out the $4+ (US ?)estimate of the previous message was
somewhat inflated from my viewpoint.
Also I was trying to indicate that _standard_ components (commonly used
resistors, capacitors LM324's etc. which are used in a number of different
products) are so cheap that it is generally a cheaper option to use them
rather than a more expensive single component bought in especially for a
single product. This I think is your point also.

I am fully aware of the costs of procurement, inventory, kitting &
production - along with time to market and second sourcing questions.
Possibly I am overstating the case on the basis of the simple items I spend
most of my time working on but provided the PCB area requirement doesn't
increase to the point where we get less PCBs / panel the cost of a handful
of _standard_ parts is virtually nil.

Richard

> {Original Message removed}

1999\07\15@025945 by g.daniel.invent.design

flavicon
face
Russel,
are you using resonator,xtal or RC clok on yaw zillllog ?

I would assume that PSU voltage fluctuations will significantly affect
timing accuracy in RC mode, possibly to a lesser extent also with
resonator. This of caws wood spoil yaw S.D.G. rdng.

rgds,
G.D.

--
Steam engines may be out of fashion, but when you consider that an
internal combustion engine would require recovery of waste heat by
transfer just before top dead centre then fashion becomes rather
redundant, USE STRATIFIED HEAT EXCHANGERS ! and external combustion.

You heard it first from: Graham Daniel, managing director of Electronic
Product Enhancements.
Phone NZ 04 387 4347, Fax NZ 04 3874348, Cellular NZ 021 954 196.

1999\07\15@075919 by Russell McMahon

picon face
Currently using crystal.
Will almost certainly go to resonator at best.
Will examine possibility of RC once all other considerations are
obvious - these often pop up unextepctedly during development despite
best efforts to "design" from scratch.
With sigma-delta the short term clock stability (over one conversion
cycle of around 10 milliscecond) is all that matters.

RM


{Original Message removed}

1999\07\15@075924 by Russell McMahon

picon face
Target volume is 10,000 per year for this product.
COULD be much more.
The A2D is only small part.

Materials costs are around -
LM324      $US0.16
Resistors    $US0.01
Capacitors  $US0.04 to $US0.20 depending
Board area, insertion, testing etc add cost - still much much much
less than any alternative I have (yet) found.

RM



{Original Message removed}

1999\07\15@203452 by Scott Dattalo

face
flavicon
face
Russell McMahon wrote:
{Quote hidden}

A couple of years ago I tried this circuit:



Vin  o---/\/\/\---+---/\/\/\----> PIC
                  |
                 ===
                  |
                 ---
                 ///


It uses the same charge balancing trick that has been discussed here
before. The only twist is that only one I/O pin is used instead of two.
The basic algorithm goes something like:

1) make the I/O an input
2) If the input high then make the I/O pin an output and drive it low
else
  make the I/O pin an output and drive it high.
3) delay
4) goto 1

Theoretically the duty cycle - or the ratio the time the I/O spends high
to the sum of the times it's high and low - is proportional to the
analog input Vin.

It works - sort of. I found that it was good for about 5 bits. But it
certainly is low cost!

There are few problems with this circuit, with which I'm sure Russel
will agree. 1) It depends on the threshold of a digital input. The
hysteresis could be fairly large and hence would necessitate a
relatively large ripple on the capacitor. 2) The voltage on the cap will
drift towards the input voltage while the I/O line is programmed as an
input. This can be mitigated by using two I/O lines however (one
programmed as an input and monitoring the capacitor voltage the other as
an output). 3) The input impedance is fairly low, especially when
compared to an opamp.


There's another low-cost solution that substitutes these three problems
for another:



           +V          +V
            |           |
            \           |
            /           |
            \ R1        |
            /           |
            |          |V
            +----------|  2N3906
            |          |\
      Ri   |/            |
Vin --/\/\--|  2N3904     +-----------> to Pic
           |V            |   R3
            |            +-/\/\--+
            |                   ///
            |
            +---+----------/\/\------< from pic
            |   |            R4
            \   |
            /  === C1
          R2\   |
            /   |
            |   |
           --- ---
           /// ///

How it works:

The 3904 buffers the input and drives the R2/C1 network. The input
impedance is fairly high (~1meg if R2 and R4 are about 10k). If the
voltage at the 3904's emitter is too large or (equivalently) Vin is too
low, then the 3904 will be turned off. This turns off the 3906 as well.
The main purpose of the 3906 is to remove most of the dependence on the
pic's input threshold voltage. In other words, the 3906 is either going
to be saturated or off and its collector will be either high or low. I
realize that it's possible to balance this circuit so that the 3906
would be biased in the linear region, however the PIC is in the feedback
loop and the control signal it provides has a much lower frequency
response than the 3906.

The R2/R4/C1 filter and divide the pwm signal from the pic.

The problem is that now the circuit is somewhat temperature dependent.
The Vbe drop is about -2mv/degree C. This means that for a given input
voltage, the voltage at the 3904's emitter will have to be increased as
the temperature rises.

I haven't tried this circuit yet, btw. I'd be interested to hear
comments and improvements (especially a way to remove the temperature
dependence).

Scott

1999\07\16@215854 by Scott Dattalo

face
flavicon
face
FWIW,

I re-tried the 2-I/O pin and also 1-I/O pin a2d converter again and got
really good results. (The last time I tried a couple of years ago I
failed miserably.) The circuit is this:


                   +-----------> PIC (not used in 1-pin version)
                   |
Vin  o---/\/\/\---+-+-/\/\/\----< PIC
                  |
                 ===
                  |
                 ---
                 ///

The two resistors were 10k and the capacitor was a 0.56uF mylar film. I
didn't experiment much with these values, I basically took some stuff
out of one my junk piles.

I was able to fairly easily get 12-bits of dynamic range with the 2-I/O
pin version and about 8 with the 1-I/O pin version. I haven't attempted
to verify linearity, temperature dependence, long term stability, etc.
My conclusions on the dynamic range are subjectively based on how much
flickering I can observe in the least significant bit. YMMV

If you want to see the code go here:

http://www.interstice.com/~sdattalo/technical/software/pic/a2d.asm

but beware, the code looks almost as bad as my ratsnest prototype :).

The trick I employed this time is a pre-charge algorithm. In other
words, before beginning the actual a2d conversion I make sure that the
voltage on the capacitor is right at the switching threshold of the pic
I/O pin.

Oh, one more thing; I used only a 4Mhz crystal.

and one more thing: The 2 pin version could easily be scaled up for 4
analog inputs. The 1-pin version doesn't scale as nicely, but since it
only has 8-bits of dynamic range it is certainly a candidate for
vertical counters...



Scott


PS, the asin and arctan routines are now on my pic page:

http://www.interstice.com/~sdattalo/technical/software/software.html

More... (looser matching)
- Last day of these posts
- In 1999 , 2000 only
- Today
- New search...