Which ASM instruction should I use?
Tapperman
Posts: 319
Hi All and Merry Christmas,
I'm using a US Digital E4P encoder http://www.usdigital.com/products/encoders/incremental/rotary/kit/e4p/ to read a shaft that spins continuously. And I'm trying to adapt 'JonnyMac's encoder object from the obex. In the assembly section of this driver, the counts read from the coder are adjusted by SUBS and ADDS (depending on direction).
But, I'd like the values read to roll-over in the full 32 bit register. So as to compute the difference in counts just like the system clock counter (CNT) is used.
Are the two assembly instructions that do the updating correct for this ... or should I use SUB and ADD?
... Tim
PS - Great object 'JonnyMac' ---> worked correct the first time I hooked it up! Easy to read and understand. GO DUCKS!
I'm using a US Digital E4P encoder http://www.usdigital.com/products/encoders/incremental/rotary/kit/e4p/ to read a shaft that spins continuously. And I'm trying to adapt 'JonnyMac's encoder object from the obex. In the assembly section of this driver, the counts read from the coder are adjusted by SUBS and ADDS (depending on direction).
But, I'd like the values read to roll-over in the full 32 bit register. So as to compute the difference in counts just like the system clock counter (CNT) is used.
Are the two assembly instructions that do the updating correct for this ... or should I use SUB and ADD?
... Tim
PS - Great object 'JonnyMac' ---> worked correct the first time I hooked it up! Easy to read and understand. GO DUCKS!
Comments
http://obex.parallax.com/objects/673/
It computes the average instatneous tick speed out of the encoder. In the assembly. Should be easy to make it do what you want. Note that the average shaft speed is really jump... and inaccurate.