Morgan, I think (puzzled look) I understand your method, but you have me thinking in a diferent direction. What if you use a PWM that you write yourself (12 or 14 or 16 bit count off of the TMR0, pre-stuff for high speed?) to generate a target output, and use the A/D input to qualify it? This assumes you have filtered your home made PWM to the quality you wish. I personally have had trouble getting '16' bit performance out of the part. I am curious to know what usable performance you get. Chris Eddy Pioneer Microsystems, Inc. Morgan Olsson wrote: > PIC14000 has A/D circuitry consisting of ramp generator and a 16bit fast > counter which capture the count when a comparator say the measured input is > the same as the ramp. > > As it is possible to backward calculate the exact count for a desired > voltage we can make a high resolution D/A if we trigger a sample/hold > cirquit to lock the value of the ramp at the desired count. > > It is easy just to continuously read teh counter and send a trigger pulse > at a desired value. BUT the datasheet say we should not read the counter > while it is running. > Why? > Anybody tried? > Will the read make it *count* false? > Or do we risk *readig* erroneous value? > Probably the latter, as the counter is normally driven very fast, by the > oscillator directly (4MHz typ), and the counter is probably not synchronous > binary counter type (more silicon need), so the count might not have > propagated through the whole counter when it is read by the cpu? That is > of course dependant on mainly clock frequency, but also the individual > chip, temperature, supply voltage... > > But I believe there should be a osc frequency below which it is guaranteed > to work OK. > > Ideas? > > We can also use the 8-bit timer to generate interrupts, but i need it for > other stuff, and it is more complicated to get it all work. > > /Morgan > > / Morgan Olsson, MORGANS REGLERTEKNIK, SE-277 35 KIVIK, Sweden \ > \ mrt@iname.com, ph: +46 (0)414 70741; fax +46 (0)414 70331 / Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf" Content-Transfer-Encoding: 7bit Content-Description: Card for Christopher Eddy, PE Content-Disposition: attachment; filename="vcard.vcf" Attachment converted: wonderland:vcard.vcf 1 (TEXT/CSOm) (000063C9)