Lucian wrote: > In fact, now I put directly the value 25 in SPBRG, which is > for 9600 baud rate, at 4 MHz (that's what I understood from > a microchip application note). Is this value correct for my setup ? Check your value using the *formulas* in the data sheet for your specific PIC type ! And if you say that you have found the value in an app note, why not tell us *what* app note (the ANxxx number) so we can check it ? > The code for the ISR is inspired from an > example from HT-PIC C Compiler, so I thought it is correct. You might read the actual assembler code produced to verify that/if your C code does the "right" thing. And "inspiration" isn't a process without weak points :-) Another way to debug is to strip your C code down until all works. Built a very simple example without all the fancy buffer handling. This also makes it easier to read the assembler code produced. *Then* add the other features and you'll probably see when it breaks. Have you verified that the led*_on() and led*_off() routines work as they should ? Why make them into separate routines ? Isn't it just a simple bsf/bcf (or whatever it's called in C) thing ? Jan-Erik. PS. Your posts are still composed of long lines that makes it harder then necessarily to reply to... -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads