>I must measure the input signal with 1 =B5s precision. I think you will be lucky to do this with a 16F877. I doubt that the high= est oscillator frequency will give you this resolution. I would suggest using the 18F452, which is pin compatible with the 16F877, but when using a 10M= Hz crystal has a PLL which allows 40MHz internal clock. It is also a 16 bit architecture instead of the 14 bit of the 16F, which may give you more efficient instruction usage, apart from better ram access than the 16F series. As you are looking for 1uS I take it you are looking for the horizon usin= g a video source? ...... >So I've used nested interrupts with a software >stack (I found this method in the piclist source code >library), but there is always a part of the code where >interrupts are disabled. Again the 18F452 has two levels of interrupt, with one having priority ov= er the other. It is also possible to do a fast save of certain registers, wh= ich is not possible on the 16F, and may again save some time in the high priority interrupt. I have not used these chips, but it sounds like this = may be what you need. P.S. your English is heaps better than my French, and seems to have described the problem quite adequately. -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads