On Fri, 2007-07-27 at 18:38 +0200, Dario Greggio wrote: > Andre Abelian wrote: > > > How would you do? > > Usually my method is to set a flag in the ISR routine, and the main loop > checks this flag on a regular basis, and performs transmission etc. as > needed. > Of course, the responsiveness is slower, as for that one event, but > several events can be triggered by IRQ, since each IRQ does not block > the CPU for so long (preventing other IRQs to be seen). That is generally the technique I use as well. Only thing I may add is "quick things" like receiving a character from the UART, throwing it into a buffer and flagging the main loop. The number on rule of trouble free ISR usage IMHO is keeping the ISR as short and quick as possible. The less time you spend in your ISR the better. Let the main loop do the heavy lifting. TTYL -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist