> Sorry, Olin, I meant TRMT, not TXMT. Even more reason to use the mnemonics instead of fixed bit numbers. Actually I didn't even catch that. I was thinking TRMT. > Anyway, I don't see any bugs. See my other post. > Should I be disabling TXEN and reenabling after loading TXREG? No. > What's wrong with using the stack with calls from within an ISR? It's not inherently wrong, but it could be a lurking gotcha. Your main code has a certain call tree, which hopefully requires some finite maximum number of stack locations. If interrupts are enabled everywhere, then the stack location used by the interrupt routine must be left available at all times. If the interrupt routine calls other subroutines, then ALL these additional call stack locations must be left available whenever interrupts are enabled. If your interrupt routine calls one subroutine, then it uses 2 call stack locations. Your processor (16F877) 8 stack locations, so your main code can now use no more than 6. If that's not a problem, then it's OK. But you should be aware of the cost of calling subroutines during an interrupt every time you do it. ******************************************************************** Olin Lathrop, embedded systems consultant in Littleton Massachusetts (978) 742-9014, olin@embedinc.com, http://www.embedinc.com -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu