ya..true. You know I'd love to start writing in C, I own a compiler, but its the old adage...can't stop cutting the wood to sharpen the saw. I honestly haven't written anything in C for about 8 years now..and then it wasn't embedded C, but on a unix box. Its a matter of spinning up and taking advantage of it. I just need to be a little less busy.... "Timothy J. Weber" wrote: alan smith wrote: > OK.....so to answer the couple of questions... > > why did I set and clear the TXEN bit? only because when I put the module together I was making sure on entry and exit it would be a known state, but once I had the calls and other structure put together, I could clean that up..which I did. > > So it appears the real culprit was the btfss vs btfsc > > Sometimes you can't see the forest for the trees :-) It's also an interesting example of how when we (I) find one issue, we stop looking! But another pattern I see here is that it would have been easier (for me!) to see that bug in C. E.g., compare these: _txCharLoop call DEBOUNCE btfsc TXSTA,TRMT ; check buffer, wait till empty (1=empty) goto _txCharLoop vs.: // check buffer, wait till empty (1=empty) while (txsta.TRMT == 1) ; ...or even... inline bool serialReadyToTransmit(void) { return txsta.TRMT == 1; } ... // check buffer, wait till empty while (serialReadyToTransmit) ; For me, either of the C examples would make it easier to spot the bug (and harder to write it wrong in the first place). And they would probably produce identical assembly. I know, the HLL vs. assembly debate is an old one and I don't want to drag it out again... -- Timothy J. Weber http://timothyweber.org -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist --------------------------------- Take the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail, news, photos & more. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist