Searching \ for '[PIC]: DAC with 1 ADC pin ?' 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/microchip/ios.htm?key=adc
Search entire site for: 'DAC with 1 ADC pin ?'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: DAC with 1 ADC pin ?'
2003\05\07@175807 by Stef

flavicon
face
hi All,

I wondered if it was possible to create a DAC with just 1 ADC pin.
The reason is that I have just a few pins and pwm is too slow.


Stef Mientki

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2003\05\07@180452 by Dave VanHorn

flavicon
face
At 11:58 PM 5/7/2003 +0200, Stef wrote:
>hi All,
>
>I wondered if it was possible to create a DAC with just 1 ADC pin.
>The reason is that I have just a few pins and pwm is too slow.

With only one pin, AFAIK PWM is the only choice you have.

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2003\05\07@184012 by Wagner Lipnharski

flavicon
face
Dave VanHorn wrote:
> At 11:58 PM 5/7/2003 +0200, Stef wrote:
>> hi All,
>>
>> I wondered if it was possible to create a DAC with just 1 ADC pin.
>> The reason is that I have just a few pins and pwm is too slow.
>
> With only one pin, AFAIK PWM is the only choice you have.

Not really, hmmm.

A series capacitor (discriminator) could leads to a rectify and turns to be
a "frequency-to-voltage" converter, so, even with a 50% simetry square-wave
you can produce differente DC voltages.

But what is this of "DAC with just 1 ADC pin"... I got confused.

Wagner.

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2003\05\07@184020 by Picdude

flavicon
face
Just a quick thought...
How about adding another small chip ... specifically a serial-in, parallel-out shift register.  Send serial data out from 2 pins and let the shift reg perform the DAC function.

Cheers,
-Neil.


On Wednesday 07 May 2003 17:04, Dave VanHorn scribbled:
> At 11:58 PM 5/7/2003 +0200, Stef wrote:
> >hi All,
> >
> >I wondered if it was possible to create a DAC with just 1 ADC pin.
> >The reason is that I have just a few pins and pwm is too slow.
>
> With only one pin, AFAIK PWM is the only choice you have.

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2003\05\07@184025 by Des Bromilow

flavicon
face
The other option is a variation on Roman Black's BTC method (which incidently I still haven't got working, but I suspect the problems lay within my code and cct)

Des

>>> spam_OUTdvanhornTakeThisOuTspamCEDAR.NET 8/05/03 8:04:30 am >>>
At 11:58 PM 5/7/2003 +0200, Stef wrote:
>hi All,
>
>I wondered if it was possible to create a DAC with just 1 ADC pin.
>The reason is that I have just a few pins and pwm is too slow.

With only one pin, AFAIK PWM is the only choice you have.

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

________________________________________________________________________
This email has been scanned for viruses by the CITEC Email Anti-Virus service powered by MessageLabs. For more information on a proactive email anti-virus service working around the clock, around the globe, visit http://www.citec.com.au ________________________________________________________________________


________________________________________________________________________
This email has been scanned for viruses by the CITEC Email Anti-Virus service powered by MessageLabs. For more information on a proactive email anti-virus service working around the clock, around the globe, visit http://www.citec.com.au
________________________________________________________________________

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2003\05\07@190633 by Stef

flavicon
face
Des Bromilow wrote:

>The other option is a variation on Roman Black's BTC method (which incidently I still haven't got working, but I suspect the problems lay within my code and cct)
>
Oh that's indeed an interesting scheme.
I guess you can even improve it by allowing the output pin go into
tristate (switch to input).

But what I had in mind was feedback of the integrated signal.
I expect to need much less filtering then with pwm.
So I can achieve high frequency spikes.

I've just a quick test and it seems to work, although I've to find the
correct values.
I'm also not sure if the results are better then with plain pwm.

Stef

{Quote hidden}

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2003\05\07@192314 by Dave VanHorn

flavicon
face
>
>A series capacitor (discriminator) could leads to a rectify and turns to be
>a "frequency-to-voltage" converter, so, even with a 50% simetry square-wave
>you can produce differente DC voltages.

Just a different method of PWM

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2003\05\07@192458 by Dave VanHorn

flavicon
face
At 05:38 PM 5/7/2003 -0500, Picdude wrote:
>Just a quick thought...
>How about adding another small chip ... specifically a serial-in,
>parallel-out
>shift register.  Send serial data out from 2 pins and let the shift reg
>perform the DAC function.

But that's twice as many pins as he's got.
I wouldn't be surprised though, if one of the other pins could be
multiplexed for this.
I'm doing the same thing in a couple of spots in my printer.
Two pins drive five LEDs and three IRDA transceiver enables, using an HC164
gate.

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2003\05\07@192911 by Dwayne Reid

flavicon
face
At 11:58 PM 5/7/03 +0200, Stef wrote:
>hi All,
>
>I wondered if it was possible to create a DAC with just 1 ADC pin.
>The reason is that I have just a few pins and pwm is too slow.

Robert Rolf suggested a method to me many, many years ago: 100R from pin to
1u0 cap +.  Other side of cap is Gnd.  Output voltage comes from cap
+.  This is a high impedance output - buffer as required.

Read the voltage on the pin and compare to the desired value, then set the
pin as output (either HI or LO, as required) for a very short period to
'nudge' the voltage in right direction.  The voltage on the cap will track
the desired value.

The requires frequent reading of the ADC - stick the routine in your
background task.

It is possible to make this reasonably fast: make the output pulse width
wider as you get farther away from the desired value.  A simple subtract
and some right shifts to approximate the required delay time is all that is
needed.

I've been told this works quite well.

dwayne

--
Dwayne Reid   <dwaynerspamKILLspamplanet.eon.net>
Trinity Electronics Systems Ltd    Edmonton, AB, CANADA
(780) 489-3199 voice          (780) 487-6397 fax

Celebrating 19 years of Engineering Innovation (1984 - 2003)
 .-.   .-.   .-.   .-.   .-.   .-.   .-.   .-.   .-.   .-
    `-'   `-'   `-'   `-'   `-'   `-'   `-'   `-'   `-'
Do NOT send unsolicited commercial email to this email address.
This message neither grants consent to receive unsolicited
commercial email nor is intended to solicit commercial email.

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2003\05\07@193119 by Scott Dattalo

face
flavicon
face
On Thu, 8 May 2003, Stef wrote:

> Des Bromilow wrote:
>
> >The other option is a variation on Roman Black's BTC method (which incidently I still haven't got working, but I suspect the problems lay within my code and cct)
> >
> Oh that's indeed an interesting scheme.
> I guess you can even improve it by allowing the output pin go into
> tristate (switch to input).
>
> But what I had in mind was feedback of the integrated signal.
> I expect to need much less filtering then with pwm.
> So I can achieve high frequency spikes.

The only way a pulse modulation scheme like the one Roman proposes will
work is if the impedance of the load is well characterized. (Or a more
accurate statement is that the accuracy depends on how well the firmware
knows the characteristics of the load.) There is no feed back, so the
internal software integrator needs to match the external hardware one. If
feedback is added as you suggest, then this problem can be avoided. Adding
feedback and still maintaining the single-pin requirement is, well,
challenging! There's a single pin ADC on my web page:

www.dattalo.com/technical/software/software.php
http://www.dattalo.com/technical/software/pic/a2d.asm

However, it's very slow and probably not suitable as a feed back pin for a
one pin DAC. But for a two pin solution...

Scott

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2003\05\07@200048 by Picdude

flavicon
face
On Wednesday 07 May 2003 18:23, Dave VanHorn scribbled:
> But that's twice as many pins as he's got.

Well, he did also say that he had a few pins (not verbatim).  It is an option nonetheless.


> I wouldn't be surprised though, if one of the other pins could be
> multiplexed for this.
> I'm doing the same thing in a couple of spots in my printer.
> Two pins drive five LEDs and three IRDA transceiver enables, using an HC164
> gate.

Right now, I'm wracking my brain over a pin-resource problem myself.  Been shuffling pins among ports to avoid any additional HW, but it's looking grim :-)

Cheers,
-Neil.

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2003\05\07@203122 by Russell McMahon

face
flavicon
face
> >I wondered if it was possible to create a DAC with just 1 ADC pin.
> >The reason is that I have just a few pins and pwm is too slow.
>
> Robert Rolf suggested a method to me many, many years ago: 100R from pin
to
> 1u0 cap +.  Other side of cap is Gnd.  Output voltage comes from cap
> +.  This is a high impedance output - buffer as required.
>
> Read the voltage on the pin and compare to the desired value, then set the
> pin as output (either HI or LO, as required) for a very short period to
> 'nudge' the voltage in right direction.  The voltage on the cap will track
> the desired value.

How utterly obvious.
How utterly brilliant !!!
The ATtiny26 that I happen to be using, which has zillions of A2D inputs,
suddenly acquires new capabilities.
Some playing with time constants would be needed to optimise results.
Now we need an 8 channel analog buffer :-)


       Russell McMahon

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2003\05\07@234930 by Scott Dattalo

face
flavicon
face
On Thu, 8 May 2003, Russell McMahon wrote:

> > >I wondered if it was possible to create a DAC with just 1 ADC pin.
> > >The reason is that I have just a few pins and pwm is too slow.
> >
> > Robert Rolf suggested a method to me many, many years ago: 100R from pin
> to
> > 1u0 cap +.  Other side of cap is Gnd.  Output voltage comes from cap
> > +.  This is a high impedance output - buffer as required.
> >
> > Read the voltage on the pin and compare to the desired value, then set the
> > pin as output (either HI or LO, as required) for a very short period to
> > 'nudge' the voltage in right direction.  The voltage on the cap will track
> > the desired value.
>
> How utterly obvious.
> How utterly brilliant !!!
> The ATtiny26 that I happen to be using, which has zillions of A2D inputs,
> suddenly acquires new capabilities.
> Some playing with time constants would be needed to optimise results.
> Now we need an 8 channel analog buffer :-)

This is exactly what I that when Walter Banks showed it to me about 5
years ago. This was before AVR though. But the (poorly commented) pic
version is here:

http://www.dattalo.com/technical/software/pic/a2d.asm

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2003\05\08@040212 by Alan B. Pearce

face picon face
>The ATtiny26 that I happen to be using, which has zillions of
>A2D inputs, suddenly acquires new capabilities.
>Some playing with time constants would be needed to optimise
>results. Now we need an 8 channel analog buffer :-)

Shucks, if you are going down the road of adding another chip you may as
well use one of the Maxim or Analog Devices chips with zillions of DAC's in
them.

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2003\05\08@152818 by Wagner Lipnharski

flavicon
face
Dave VanHorn wrote:
>> A series capacitor (discriminator) could leads to a rectify and
>> turns to be a "frequency-to-voltage" converter, so, even with a 50%
>> simetry square-wave you can produce differente DC voltages.
>
> Just a different method of PWM

I need to disagree, PWM implies that to change the output voltage you need
to change the simetry of the square wave. Frequency to Voltage conversion
uses a fixed simetry, even that PWM "could" be used for output voltage fine
tunning, or linearity.

Wagner.

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

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