View Single Post
  #12   Spotlight this post!  
Unread 26-10-2006, 14:51
Qbranch Qbranch is offline
wow college goes fast.
AKA: Alex
FRC #1024 (Kil-A-Bytes)
Team Role: Alumni
 
Join Date: Apr 2006
Rookie Year: 2006
Location: Indianapolis
Posts: 1,174
Qbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond repute
Re: Help needed timing a pulse (2004 Robovation)

Quote:
Originally Posted by yongkimleng
Haha I'm an idiot at ASM.. yet to learn it :/ What do you mean by the hardware add function works the same way as... ???

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
__________________
Electrical Engineer Illini
1024 | Programmer '06, '07, '08 | Driver '08

Last edited by Qbranch : 26-10-2006 at 15:02.