Tim ODriscoll a =E9crit : >=20 > On Sun, 22 Jun 2003, Gaston Gagnon wrote: > > Tim, > > Did my suggestion made it to the list or was it discarded for a l= ack of > > good sense ? > > Gaston > > > It did make it, but only after I sent my last email :( Time to cha= nge > ISPs I think... >=20 > I'll paste in your email here: > > I have not tried this but what about feeding your signal on one i= nput of > > a comparator while the other input is connected to the pwm output= trough > > a low pass filter? > > The comparator output is then used to make the pwm follow your an= alog > > signal. > > Could the time constant of the filter be made small enough ? > > Gaston >=20 > Hmm, I don't quite understand what you mean here.. I *think* you me= an to > watch the comparator 'match' flag, then read what the PWM pin was d= oing at > the that instance? If so, isn't the PWM output a square wave, so my= analog > input will only match if it hits vss or vdd? Or is that what the lo= w pass > filter fixes? The low pass filter output will average the pwm value. A simple RC network should do. The idea is to have the pwm output average to match your analog signa= l.=20 You watch the comparator output to determine if the pwm value should = be increased or decreased. The pwm value is the digital image of your analog signal. I hope this is clearer %^} Gaston =20 =20 >=20 > Cheers, >=20 > Tim >=20 > -- > http://www.piclist.com hint: The list server can filter out subtopi= cs > (like ads or off topics) for you. See http://www.piclist.com/#topic= s -- 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