
Originally Posted by
skimask
Add
DEFINE NO_CLRWDT 1 'no extra clear watchdog timer instructions
to the top of your program.
Will probably save a few more cycles there.
Interesting... I didn't think I called any routines that used the WDT. I'll check the .lst and see if there are any in there.
Also, in your 'big' loop, this might help somewhat. Remove the 2 for/next loops, replace with this:
loop1:
x1 = 2 : x = 0
loop2:
gosub get_byte : gosub write_i2c : x = x - 1 : if x = 0 then loop2
x1 = x1 - 1 : if x1 = 0 then loop1
Rewriting the 2 gosubs as inline code would save you about 2K cycles at most, might get you down below 20ms, but would use up code space. No real savings there.
On the outside, this looks to take about the same or more Tcy's to run as my 2 serial loops. I'll compile the two different ways and look at the .lst to count the Tcy's and see which is faster.
Also, go back and try to BANK0 as much as you can, the commonly used variables first, until something doesn't end up in BANK0 (check the .lst file).
I've made sure that all variables used in this loop process are in bank0. Can variables not used in the loop slow the loop down?
No, I'm not Superman, but I did stay at a Holiday Inn Express last night!
Bookmarks