It's only 100 Hz, but every pulse has a width with a 14 bit resolution. So a simple pulse counter won't do. I have to have the start and stop time of that pulse, in as high a resolution as possible. I want to use timer0 without prescaler and it's a 20 Mhz PIC, so that's a 5 Mhz counter. That's why I have to do it in an interrupt, if it's in the main code, i can't do anything else. So the sport is to clear the int check flag and get a poll of the port as close together as possible, check the isr flag again on my way out of the isr and just hope for the best :) That way, only an interrupt in two or three instruction cycles could be lost. Regards, Claudio -----Oorspronkelijk bericht----- Van: pic microcontroller discussion list [mailto:PICLIST@MITVMA.MIT.EDU]Namens Bob Ammerman Verzonden: Thursday, April 11, 2002 12:52 PM Aan: PICLIST@MITVMA.MIT.EDU Onderwerp: Re: [PIC] Interrupt on change > So I think I just have to take a possible collision into account when > processing the numbers. And at 100 Hz I have some measurements > to spare, so that's ok :) Ah... if this is really only 100Hz then I would definitely handle it by polling in a timer interrupt. Bob Ammerman RAm Systems -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu