What do you mean by 2r 2 times r? Andrew On Fri, 17 Mar 2000 13:44:44 -0600 Don Hyde writes: > An R-2R ladder can be used to turn a group of PIC output pins into a > DAC for > a few cents. Below is a 3-bit DAC. Using 3 PIC output pins (beware > of the > odball open drain pins, they're no good for this), this circuit will > provide > 0 - Vcc*(7/8) volts out, with a 2R source impedence. > > It can be extended to more bits by replicating the MSB R-2R end of > the > ladder. > > Up to 4 bits can be achieved with 5% resistors. > > Up to 6 bits can be achieved with 1% resistors. I know this works > because > I've used it. R=10K works fine. > > Up to 10 bits might be achieved with .1% resistors. Beware, this > circuit > uses Vcc as its reference, so you would have to use a precision > reference > for your Vcc to achieve this accuracy, and I would still figure it > was > doubtful due to FET on-resistance, digital noise, etc. Besides, .1% > resistors are pricey enough that you still might be ahead to buy a > DAC in a > chip. > > In many applications, it would be advisable to buffer the output > with an > op-amp. > > A circuit like this can achieve waaay higher output frequencies than > PWM, > and can be easier to filter, at the expense of using up a bunch of > PIC pins. > > OUT o--+-/\/\/\/\----o MSB > | 2R > \ > / > \ R > / > | > +-/\/\/\/\----o Middle bit > | 2R > \ > / R > \ > / > +-/\/\/\/\----o LSB > | 2R > \ > / > \ 2R > / > | > --- > /// > > > -----Original Message----- > > From: Andrew Kelley [mailto:kelleyat@JUNO.COM] > > Sent: Friday, March 17, 2000 12:35 PM > > To: PICLIST@MITVMA.MIT.EDU > > Subject: Re: D/A with an f84 > > > > > > It is not critical at all. I just want to be able to control > > the speed > > of a motor like slow medium or fast. > > > > > > Andrew > > > > On Fri, 17 Mar 2000 12:06:17 -0600 Scott Dattalo > > > writes: > > > On Fri, 17 Mar 2000, Andrew Kelley wrote: > > > > > > > Does anyone know how to make an analog voltage/signal with an > f84? > > > > > > > > > This will make a DC signal on the lsb of porta: > > > > > > bsf porta,0 > > > > > > as will this: > > > > > > bcf porta,0 > > > > > > A "strategic" combination of these can be concatenated to > produce a > > > waveform > > > whose average value can be used to produce an analog voltage. > > > > > > Or as we prefer to say on the list every few days: PWM. Here's a > > > software pwm > > > that works on the f84: > > > > > > http://www.dattalo.com/technical/software/pic/pwm256.txt > > > > > > > > > But it's probably overkill for what you want to do. But, OTOH, I > > > have no idea > > > what you exactly want... > > > > ________________________________________________________________ > > YOU'RE PAYING TOO MUCH FOR THE INTERNET! > > Juno now offers FREE Internet Access! > > Try it today - there's no risk! For your FREE software, visit: > > http://dl.www.juno.com/get/tagj. > > ________________________________________________________________ YOU'RE PAYING TOO MUCH FOR THE INTERNET! Juno now offers FREE Internet Access! Try it today - there's no risk! For your FREE software, visit: http://dl.www.juno.com/get/tagj.