Serin usage?


Closed Thread
Results 1 to 15 of 15

Thread: Serin usage?

Hybrid View

  1. #1
    Join Date
    Nov 2006
    Posts
    32


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by HenrikOlsson View Post
    Try to get it to read the lower 16bits first, then we can figure out a way to read all 22. I think that the tricky part will be what to to with the 22bits when you have them in the PIC.

    /Henrik Olsson.
    Henrik,

    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!

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,607


    Did you find this post helpful? Yes | No

    Default

    Hi,
    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!
    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.

    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.

Similar Threads

  1. Accurate serin usage?
    By sccoupe in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 10th July 2009, 08:36
  2. PIC16f877 code crosses boundary @800h
    By inventosrl in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 6th April 2009, 22:03
  3. serin question?
    By sachymo in forum General
    Replies: 5
    Last Post: - 27th July 2008, 10:04
  4. Problem with PBP interrupt and Serin, please help
    By rgregor in forum mel PIC BASIC
    Replies: 0
    Last Post: - 22nd August 2006, 19:02
  5. SerIn and SerOut
    By Dwayne in forum FAQ - Frequently Asked Questions
    Replies: 0
    Last Post: - 21st July 2004, 15:54

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts