Exact match. Not showing close matches.
'[PIC] Help with porting from Hitech C to C18'
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.
REPT (INST_CYCLES_NEEDED - 3)
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. I don't hink the Hitech handles the
Thanking in advance.
Alan B. Pearce
>How would I replace this group of code with C18? This
>is a critical timing delay.
> REPT (INST_CYCLES_NEEDED - 3)
>The program allows to specify the clock speed, which then
>adjusts the number of clock periods to get the desired delays.
The REPT operator looks like it is possibly a macro, which is probably
defined in one of the include files. As a start, I would try trawling any
likely looking include files (compiler.h?, any processor specific .h files?)
and searching them with a text editor for 'rept' to see if a macro is
#defined. You could then probably use the macro as is in your files.
Isaac Marino Bavaresco
The rept directive just tells the assembler to temporarily create an
unnamed macro and repeat it a number of times.
The MPASM has the while directive. It is a little different but should work.
n set (INST_CYCLES_NEEDED - 3)
while n > 0
n set n - 1
Alan B. Pearce escreveu:
Faça ligações para outros computadores com o novo Yahoo! Messenger
More... (looser matching)
- Last day of these posts
- In 2009
, 2010 only
- New search...