l
How about describing what your code is trying to do and how you propose to use TCNT1 to save me the trouble of trying to figure out our program?
Also, how about writing the shortest possible sketch that tests/demonstrates what you are trying to do with TCNT1 so that nobody is confused by other stuff?
...R
total_tvalue=(t_overflow_count*65535)+tvalue; // compute total time elapsed in bits between 2 impulses
Firstly that 65535 should be 65536, overflow is when the counter goes back to 0 surely?
secondly it needs to be a long constant anywyay, 65536L, and thirdly etter to just use a shift,
total_tvalue = (((unsigned long) t_overflow_count) << 16) + tvalue; // compute total time elapsed in bits between 2 impulses
Using just ints multiplying by 65535 is actually just multiplying by -1, since they are both the bit pattern 0xFFFF
If you want 32 bit values you must ensure they are 32 bit before the multiply/shift somehow.