Hi dave,

Thanks for your help, I will have a look at the links later.

Yes you are right, I am using the internal oscillator at 4 mhz.

The botton is pressed by a piston.
So I need to stop the piston after 3 pulses.

Thanks.