Can someone tell me how to read the frequency of this signal without to stop the void loop() for 1sec as this kills the engine instantly by shuting off the fuel?
I don't think it is the frequency you need. It is the time between pulses. If the pulse triggers an interrupt, an interrupt service routine can be called, and that function would record the time of each pulse. The time between pulses can then give you the frequency or the engine speed.
I use this to calculate vehicle speed in my trans controller project. I use CounterTimer 5 pin 47 for pulseIn on my Mega. I don't know the equivalent on the 328 board though.
#define DIV 120 #define FPM 5280 #define TIRCIR 7.56 #define PPR 123.2 long TIME = 1000000;//time constant to divide freq long vsspulse = pulseIn(vss, HIGH); float vssval = (vsspulse / TIME); float MPHpulse = ((1 / vssval)/ 2); byte MPH = ((MPHpulse / FPM) * (TIRCIR / PPR) * DIV);
You should be able to modify it to fit your needs. Hope it helps