> /* Delay of exactly 2 Tcy */ > #define delay_2tcy() asm("nop"); asm("nop") As Chen Xiao Fan indicated, this could be better done using a "goto $+1" operation: it would take only one word instead of two. > > /* Delay of exactly 4 Tcy */ > #define delay_4tcy() delay_2tcy(); delay_2tcy() Depending on available stack space, you could implement this by a "call ": it would still only take one word instead of four (or two if you use the change above). > > /* Delay of exactly 5 Tcy */ > #define delay_5tcy() delay_4tcy(); delay_1tcy() > > /* Delay of exactly 10 Tcy */ > #define delay_10tcy() delay_5tcy(); delay_5tcy() Note that at some point it will become better making a small loop using decfsz and goto $-1. Good luck! Greetings, Maarten Hofman. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist