Herbert Graf wrote: > I'm using a dsPIC30F2010. I've configured the PWM for free running mode, > no post scale, no pre scale, no dead time (yet), nothing fancy. > > I load PTPER with 99 (comes from a macro, value confirmed with the > ICD2), and then load PDC1 with whatever I want. > > I put a scope to the PWM pin and voila, a duty cycle of half what I > expect!??! First, which PWM generator are you using? The one that is most like other PICs is called the "output compare" module. The "motor control PWM" is a new and different beast. I have used both of these, and never encountered such a symptom. There were some flakys is early versions of the '2010 output compare module, but those have all been fixed. Anyway, those had to do with spurious pulses caused by unrelated events. The motor control PWM module has a lot of options. I'm guessing you are using it and have the mode set incorrectly in one of the many control registers. A factor of two sounds suspiciously like you are thinking single slope and it's doing dual slope, or the other way around. I vaguely remember that there was a factor of two difference between some of the modes. Do you really need all the flexibility of the motor control PWM, or will the simpler output compare module do it? Unlike other PICs where everything you need is in the data sheet, on the dsPIC you need their equivalent of the midrange reference manual. It's called "dsPIC30F Family Reference Manual". Unfortunately there isn't a single DS number for this manual because they gave each chapter a different one. You need to read section 15, "Motor Control PWM" (if that's what you're using) completely and thoroughly. Actually, I've found it's useful to skim a section once to get the general flavor, then read it carefully word for word. Only then are you ready to write code. ***************************************************************** Embed Inc, embedded system specialists in Littleton Massachusetts (978) 742-9014, http://www.embedinc.com _______________________________________________ http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist