At 10:39 1998-05-02 -0400, you wrote: >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 need to have stabel output level between output changes. I will have a loop which make about 50 A/D conversions per second on a few channels, and I want to update the analog out 25 times per second if possible, and keep it stable in between. It must make a full change every time or else I will have oscillation in the whole system (a kind of balance system) But I believe 8-bit (linear) resolution is enough. >I personally have had trouble >getting '16' bit performance out of the part. I am curious to know what usable >performance you get. Right, the noise level is higher than I expected, and right now i begin implementing a filter for the A/D-read. Strangely it make very little effect if cpu is on or in sleep during conversion. Right now I am not sure where the noise come from: ramp generator, comparator (probably) or my preamp (probably too (it«s cheap). Supply is very stable. > >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 / > > > >Attachment Converted: "C:\EODORALT\Attach\vcard2.vcf" > / Morgan Olsson, MORGANS REGLERTEKNIK, SE-277 35 KIVIK, Sweden \ \ mrt@iname.com, ph: +46 (0)414 70741; fax +46 (0)414 70331 /