On Wed, Oct 28, 2009 at 12:44:48PM +0100, Joerg Desch wrote: > I've talked to an colleague this morning. He had the same problems with > WinAVR a few months ago. His solution was adding a asm volatile("nop") > between cbi() and sbi(). He had to generate a bus timing by software.
When generating output pulses of only a few cpu cycles, I've always preferred to do it in an asm file, linked in with the rest of the code. That does cost a function call and return, but the timing cannot be changed by gcc or command-line option vagaries. (In an embedded system, protection against experiences like yours is why I don't like to leave such critical things in the hands of compiler coders. YMMV, however.) Erik P.S. If this somehow doesn't make it to the list, could you please forward it? _______________________________________________ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org http://lists.nongnu.org/mailman/listinfo/avr-gcc-list