unreliable timing problem in RCM3220

Hi
I am using a RCM 3220 (44MHZ 256 + 512 Kb SRAM,Flash) in an application that is VERY time critical (down to 5-8uS). The datasampling is written in assembler, and obviously I thought that I got bugs in my assembler code. That was until a broke the program down and found the following:

  1. Every 3 seconds or so, the unit does “something” for appr. 280uS. This repeats pretty steadily. This interrupt usually comes right after another “something” that lasts for appr. 90uS.

  2. If i put a piece of code in the main function that only toggles an I/O pin, that code takes appr. 5uS to execute in a while(1) loop. If I on the other hand put that same small toggle code in another function (in the same file), it takes appr. 20uS to execute. So this means that it takes 15uS to perform a function call? I have tried to use the root command, but it doesn’t make any difference.

Can anyone inlighten me?

Best regards
Per