• AVR Freaks

Hot!fixed point arithmatic issue

Author
PeterLauer
New Member
  • Total Posts : 5
  • Reward points : 0
  • Joined: 2020/03/05 06:30:18
  • Location: 0
  • Status: offline
2020/06/02 17:28:25 (permalink)
0

fixed point arithmatic issue

XC16 recognizes the  _Q15 datatype after i add the libf.h header file, but it does not recognize the fix point math functions, like _Q15sqrt().
 
Any hints?
 
Peter
#1

5 Replies Related Threads

    du00000001
    Just Some Member
    • Total Posts : 3786
    • Reward points : 0
    • Joined: 2016/05/03 13:52:42
    • Location: Germany
    • Status: online
    Re: fixed point arithmatic issue 2020/06/03 01:24:47 (permalink)
    0
    Try including libq.h.
    (Reference:  https://www.microchip.com/forums/m/tm.aspx?m=566660&p=1  )

    PEBKAC / EBKAC / POBCAK / PICNIC (eventually see en.wikipedia.org)
    #2
    PeterLauer
    New Member
    • Total Posts : 5
    • Reward points : 0
    • Joined: 2020/03/05 06:30:18
    • Location: 0
    • Status: offline
    Re: fixed point arithmatic issue 2020/06/03 07:41:19 (permalink)
    0
    that what i had, i miss typed here in the forum, libq.h. i have the libq.h in there. the curious thing is that the compiler recognises the _Q15 data type, but not the _Q15 math functions.
     
    Peter
    #3
    andersm
    Super Member
    • Total Posts : 2821
    • Reward points : 0
    • Joined: 2012/10/07 14:57:44
    • Location: 0
    • Status: offline
    Re: fixed point arithmatic issue 2020/06/03 08:23:34 (permalink)
    0
    Are you linking libq to your project?
    #4
    PeterLauer
    New Member
    • Total Posts : 5
    • Reward points : 0
    • Joined: 2020/03/05 06:30:18
    • Location: 0
    • Status: offline
    Re: fixed point arithmatic issue 2020/06/03 08:51:34 (permalink)
    0
    thanks that helped, used the -lq option on the linker setup.
     
    Peter
    #5
    PeterLauer
    New Member
    • Total Posts : 5
    • Reward points : 0
    • Joined: 2020/03/05 06:30:18
    • Location: 0
    • Status: offline
    Re: fixed point arithmatic issue 2020/06/03 09:52:26 (permalink)
    +1 (1)
    Thanks, so now the Q15 fixed point works, i can test the performance.
     
    next step is Q16, the data type exists, the _Q16atan2 function exists, but the _Q16sqrt function is missing.
    Any reason why, is there a different name?
     
    Peter
     
    #6
    Jump to:
    © 2020 APG vNext Commercial Version 4.5