When you say "Jitter Free", do you mean that my software interrupt could be causing jitter? I am getting an *almost* insignificant amount of jitter on the motor output, about 2-3 degrees rotation over the span of 2-3 seconds. On the scope the PWM output looks nice and clean, but it jumps around every once in a while. I have an old-fashioned scope, so I can't actually save the trace to see what's causing the jump, but it appears as though I rapidly adjusted the trigger knob so the trace scrolled for just a split second, then resumes normal tracing. I'm wondering if this could be the jitter you're talking about? ----- Original Message ----- From: "Gerhard Fiedler" To: Sent: Saturday, April 24, 2004 5:12 AM Subject: Re: [PIC:] Slow PWM signal in hardware > One way to use PIC hardware to get a jitter-free slow PWM is to use the > Compare function of the CCP module. It will set the CCP pin to low or high > when the CCP register matches Timer1, and trigger an interrupt. In that > interrupt you reload the CCP register and change the mode (to toggle the > CCP pin in the other direction this time). > > This is not less software effort than doing it all "by hand" in a timer > interrupt, but it is jitter-free because the actual pin control is done by > hardware at the timer match. > > Gerhard > > > > Thanks for the suggestions. I wound up just doing it in software with (as > > usual) a crude hack that works pretty well. It was way less painful than I > > thought it would be, actually! Is there a reason Microchip doesn't make > > this a little easier? It seems it would be a fairly common task at least. > > >>> Are there any clever tricks that can slow it down to about a 17ms > >> > >> No, I don't think so, you'll probably have to use the timer(s) or s/w. > > -- > http://www.piclist.com#nomail Going offline? Don't AutoReply us! > email listserv@mitvma.mit.edu with SET PICList DIGEST in the body -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body