hi there thanks for the reply.

Input 1 is an analouge input and input 2 is a pwm signal from a futarba reciver.

the clock frequeny is 4mhz with this make a big differance to the code and what would it look like?