Hello everyone, I tried this yesterday and somehow missed the list, but I'll post with=20 more clues this time anyway. I'm using a 16F913 and having some trouble wit= h=20 the PWM output on RC5. I had set it up and had it working, but since then= =20 have added a lot of code and somewhere along the way the PWM broke without= =20 me noticing it. I've tried several fixes so far that include re ordering th= e=20 PWM module initialization code and rewriting the serial bit banged routines= =20 that are on the same port so that they have no read-modify-write=20 instructions.. I guess I should tell you what I know first..=20 The first thing is that I set the PWM period like this .... PR2 is 254,= =20 Tosc =3D 2.5e^(-7) (4MHz clk), TMR2prescale =3D 16.. from the formula in th= e=20 datasheet that gives: PWMperiod =3D 255*4*2.5e^(-7)*16 =3D .00408, so the PWM frequency should b= e=20 1/.00408 =3D 245.1 Hz. When I measure the frequency on that pin though, I g= et=20 around 9KHz. That is why I thought maybe my serial routines were causing th= e=20 PWM bit to flip since they had RMW instructions in them. I've made sure of things like TRISC, 5 is clear and that I'm writing to th= e=20 right registers in the right banks.. of course, there must be some mistake= =20 otherwise this would be working.=20 I'll be more than happy to post code, but I don't want to bog this message= =20 down with it until I see that I get on the list and someone is curious.=20 Thanks a lot for any help anyone can provide! James -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist