Dave Turner wrote : First, no, there isn't an "out-of-the-box" method to specify dynamicly which bit to bcf/bsf. The bit number is locked into the instruction at assembly time. There are code snippets to solve that, which you already understand, as I read it... Second, Scotts PWM code (which I saw the first time just a few minutes ago) must be some of the cleanest, best written and easy to follow code I've seen in a while. *I* would probably learn from it, and/or use it as a "component" and just integrate it with my own code. It *was* written for the old F84, but I see little that could be done better in any other PIC16 type. Maybe on a PIC18, but I didn't thought about that... Of course it more fun to write your own PWM code, but you will probably not write it *better* then Scott. :-) > BTW, I have a strange feeling this topic will soon be needing > an [OT] tag. Hm, no not yet, imho... Jan-Erik. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist