On Thu, Jul 16, 2009 at 10:23 PM, Carl Denk wrote: > I am porting a Hitech C program for a 16F870 to C18 for a 18F1320. > Hitech has the REPT directive to insert a variable number of repetitions > a a group of code. How would I replace this group of code with C18? This > is a critical timing delay. > > =A0 =A0 =A0 =A0REPT =A0 =A0(INST_CYCLES_NEEDED - 3) > =A0 =A0 =A0 =A0NOP > =A0 =A0 =A0 =A0ENDM > > The program allows to specify the clock speed, which then adjusts the > number of clock periods to get the desired delays. I could pick a clock > speed and insert the necessary NOP's, but would try to maintain the > timing. I only have the free versions of both compilers, which for a > hobbiest is all I can justify. =A0I don't hink the Hitech handles the > 18F1320. =A0:) > > Thanking in advance. HITECH has compilers for PIC18. Also, C18 has delay functions in delays.h -- = http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist