Because I am using software to generate the output pwm the code that measures the input pwm will have to be in some sort of interupt or timer so that it won't affect the the pwm being generated. The smallest amount of time that the code jumps out of the pwm routine the better. Maybe I could run the pwm in an interupt or something. I am really weak with interupts and timers so this is where I need the help.