I tested now my code without LCD code. I used RS232 and i got correct counts when i use any timer irq. Only when i try to output the counts to lcd display, i got wrong counts.
I use Timer1 and count the overflows. All works, but when I use delay_ms in my main loop, then it will stop to count the timer overflows until delay finished.