Quote:
|
Originally Posted by Qbranch
the adds roll over to zero.....
let's for instance take an unsigned integer, 0xFFFF. when we add 0x0001, and perform the "ADD" instruction, the ALU takes the value of the first digit and starts bit shifting, starting the carry to the next digit. but... we don't have any more bits!
so what basically happens in hardware is:
0xFFFF & 0x0000 //clear already filled digits since we're moving up a place
0x0001 << 0x0005 //working register now 0x0000 with a 1 hanging off to the left
and in the end, we're left with 0x0000!
i think now you understand why you never have to stop+reset the timer.
-Q
|
oh... think there was a miscommunication here, I thought my idea was to start the timer on a high pulse, and every time on a high pulse it has to reset the timer. Due to timing differences between the timer and the actual pulse, it may not overflow to a nice 0x0000 at the start of a high pulse.
After kevin's post then I realised that you need not stop/start the timer because you can do a reliable 16bit read, so you'd only do a reset-to-zero on a high pulse and a 16bit read on a low pulse
