Hi,
PBP performs math on variables up to 16bits wide (WORD). With more bits than that (22 for example) you will have to do a little work.I am wrong in thinking that I will just be able to convert however many bits I can get into a decimal? If it's over 8 bits I might have to do a little work with it but... I'm new, but I think it shouldn't be too bad. No? Thanks a lot for your help!
It all depends on your application. If you use the lower 16bits of the available 22 you won't loose any resolution but you are limited to 720 degrees on the encoder before the lower 16bits 'roll over'. If 720 degrees is enough - great! If not you will have to use all 22bits. I think it would be pretty easy to get all 22 bits into the PIC but then, again, it all depends on what it is you want to with them once they are there.
Remember that PBP does integer math only. You have 91.0222 encoder counts per degree but you can't simply do Degrees = Count / 91.0222. The result you'll get will be the integer partof the result only. There are way around this but the best aproach may vary depending on if you just want to display the encoder position in degrees or if you need to to more calculation on the result.
Hope it helps.
/Henrik Olsson.
Bookmarks