>finally used a scope and toggled a pin as the sampling was >occurring to get accurate sampling. I did the same for the >delay to first bit (triggerred off start bit low transition >and measure time to pin toggling at start of sample delay. > >The major hassle is that depending where I declare variables >used in the code, the latency from arriving at interrupt >handler (0x08) to servicing my code varies. It seems the Hi-Tech >C compiler decides what registers to save depending on what >it "thinks" it needs to process the interrupt. ... >Any ideas/comments ? I suspect you now realise why some believe C should not be used, but rather stick to assembler where they "know" precisely what is happening and where. This is not meant as a criticism of you or your use of the compiler. It may be that you should look at using an assembler interrupt routine where you can control precisely what is happening without the compiler sticking its oar in and doing extra bits it "thinks" need to be done. -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.