On Sun, Sep 29, 2002 at 08:10:13AM -0400, Olin Lathrop wrote: > > Olin, you do bring up an interesting point. If the duty cycle is set to 0 > > then does the output stay a flat low? Or does it glitch every cycle? > > I think the output will stay flat low. That's good. > > > For this purpose it probably doesn't matter. I was still interested in the > > TRIS register because it only required manipulating a single bit and not > have > > to track the value in the ducy cycle register. > > You only have to write two values to the duty cycle register, 0 for off and > whatever you want the duty cycle to be for on. Duty cycle changes won't > take effect until the start of the next PWM cycle, but keeping track of > whole carrier pulses is probably a good idea anyway. I would assume you > describe the various on and off times in numbers of carrier pulses anyway. I hadn't planned to. 26.3 uS, the period of a 38 Khz carrier, isn't exactly conducive to clean manipulation. I think that's probably the one advantage to controlling the output buffer directly, precise turnon/turnoff without having to wait until the end of the cycle. BAJ -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads