>> If you have MS Excel, why not just use the Excel spreadsheet for >> calculating SPRIG values I submitted last week? > >Because then you still just end up with hard coded constants in your code, >even if they are more likely to be right. > >In my opinion, the best answer is to have the assembler calculate the >SPBRG value from the oscillator frequency and the desired baud rate. This >is what my UART_BAUD macro does, in addition to some error checking and >handling of different PIC UART variants. The UART_BAUD macro is available >in STD.INS.ASPIC at http://www.embedinc.com/pic. I would agree with Olin here. and then there is the situation where you find you need to use a different crystal because your code is taking just that little too long in the interrupt handler and you start to miss interrupts, so you decide to change the crystal frequency. Changing one constant in the source file makes all your timer and baud rate variables correct for the new crystal (assuming you use macros for them all). Believe me once you do it this way you will not go back. Alan (a happy user of Olin's macros) -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.