No, he wants a "C" callable _subroutine_, not a macro. Bob Ammerman RAm Systems (contract development of high performance, high function, low-level software) ----- Original Message ----- From: w. v. ooijen / f. hanneman To: Sent: Friday, September 08, 2000 4:21 PM Subject: Re: [PIC]: usec delay routine > > Thanks to all who replied - however, none of the routines mentioned do > what > > I'm looking for. Olin seems to have the clearest picture of what I want. > The > > software usec delay routine should handle a call from somewhere else in > the > > program, loop as necessary then return. The time consumed should account > for > > the call, the overhead, the looping, and the return. Thus, it should look > > like this: > > SoftUsecDelay(57); // C code call > > Like > > ; > ; SUMMARY: > ; macro for a delay of n microseconds > ; > ; DESCRIPTION: > ; This macro provides a delay of exactly n microseconds. It is a > ; simple front-end to delay_cycles. > ; > ; RESOURCES (each use): > ; code depends on n and xtal (see delay_cycles) > ; cycles n * (x > ; stack 0 or 1 > ; RESOURCES (once): > ; code 8 (for delay_5_#(n)w_c) > ; file 0 > ; > delay_microseconds macro n > local cycles = (D'1000000' * n) / (xtal / 4) > delay_cycles cycles > endm > > ? (snip from delay.inc from the wloader firmware) > > Wouter > > -- > http://www.piclist.com hint: To leave the PICList > mailto:piclist-unsubscribe-request@mitvma.mit.edu -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu