Shop OBEX P1 Docs P2 Docs Learn Events
Which ASM instruction should I use? — Parallax Forums

Which ASM instruction should I use?

TappermanTapperman Posts: 319
edited 2010-12-25 15:11 in Propeller 1
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!

Comments

  • KyeKye Posts: 2,200
    edited 2010-12-25 15:11
    If you are trying to get the average shaft speed try modifying this object...

    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.
Sign In or Register to comment.