> Thanx all for the help (nice crash course Tony :) I'm looking at
> ordering the book, it looks very good.
>
> What I understand from Spehro the 2's complement signing method is
> easier to do math with compared to the highest bit sign. Display isn't
> very important, that module has a separate pic, so it has time enough to
> get the numbers displayed. The other end is a PC, so that has power
> enough to convert it back to a 'normal' format. The math is much more
> important, we have one module which has to do a fair amount of gonio
> routines (calculate a heading from the three axis orientation), but
> still only at about 10 Hz max, so that'll leave enough cpu cycles left
> to get that done.
>
> However, as I'm using a C compiler, what would be the more advisable
> route: convert data at the incoming point to a format the compiler can
> handle or write some specific fixed point routines to handle the math I
> want to do? From what I've read, the 12q4 format is good, with a range
> of -2000 to 2000 and an accuracy of 0.067 (right? I messed up with the
> range before, so a check can't hurt :).
>
> (Look out, ramblings ahead...) This range is mainly used for angles (no
> surprise with a 360 value range), math is mostly navigation. So one
> other option is a binary value for a full rotation (256 for example). If
> you put this into the 12q4 format, the 4 bit accuracy will be converted
> back to roughly 0.1 degree (0.0937 to be exact). However, this will make
> some calculations a bit easier, as any overflow of the 8q4 fixed point
> can be discarded, as that would point to the same direction again. Total
> range would be -2880 to 2880. Hmm... That's a bit much for angles.
>
> Last ramble: 8q8 with scaled 256 as a full 360 degree rotation. This
> would be easy math, 8q8 operator 8q8 with 16q8 result math routines are
> plenty available. Most results can discard the highest 8 bits, so that
> would result in nice clean code. Am I overlooking something here?
> Problems I might encounter?
>
> Regards,
> Claudio
>
> --
>
http://www.piclist.com hint: The list server can filter out subtopics
> (like ads or off topics) for you. See
http://www.piclist.com/#topics
>