Help Help Pulse Counting

please modify your post, select the code and press the # button. Then it will look so much better! (more readable for your audience :wink:

Furthermore please use CTRL-T before posting code - that is auto format in the IDE which takes care of proper indenting, also improvingthe readability.

I see you do some KWH monitoring, maybe this is interesting to read...

and use the keyword volatile for vars that are used in the IRQ routines.