Now Flowcode 7 can use XC16 compiler.
I would like to generate a sine using a fixed point math library as Microchip has in „libq.h” with _Q15sinPI on page 232 next file:
http://ww1.microchip.com/downloads/en/D ... 01456J.pdf
http://ww1.microchip.com/downloads/en// ... 01456j.pdf
The idea is to have the argument of the function and the returned value in the range -32768 to 32767, no (real) floating numbers.
The existing sin() function seems that works with float as argument of the function and the returned value.
http://www.matrixtsl.com/wikiv7/index.p ... _Functions
I realized that I can generate sine also using DSP using a lookup table with integer numbers::
https://www.matrixtsl.com/wikiv7/index. ... ator_(DSP)
but I want to use trigonometric function as sin().
The way how I do it now is implicit, typecasting, by assigning the float variable value to a signed int16 variable.
My questions:
- Is any other more efficient way to do it?
- Is it any other fixed point function/math library as Microchip has „libq.h” with _Q15sinPI ?
- Can we attach somehow the „libq.h” with _Q15sinPI from Microchip?
Fixed point math library
For questions and comments on programming in general. And for any items that don't fit into the forums below.
Return to “General Programming”
Jump to
- Announcements
- ↳ Announcements
- The Knowledge Exchange
- ↳ Programming Tips & Tricks
- ↳ Freelance Embedded Engineers
- ↳ Article Discussion
- Microcontroller Programming
- ↳ General Programming
- ↳ Flowcode V9
- ↳ Flowcode V8
- ↳ Feature Requests
- ↳ Bug Reports
- ↳ User Components
- ↳ Flowcode V7
- ↳ User Components
- ↳ Feature requests
- ↳ Bug reports
- ↳ Fixed bugs
- ↳ 8-Bit PIC
- ↳ 16-Bit PIC
- ↳ 32-Bit PIC
- ↳ AVR & Arduino
- ↳ 32-Bit ARM
- ↳ Poll Discussion
- ↳ Flowcode V6
- ↳ Flowcode v6 Beta
- ↳ Bug reports
- ↳ Getting Started
- ↳ User Components
- ↳ Feature requests
- ↳ Bug reports
- ↳ Flowcode V5
- ↳ Flowcode V5 Issues
- ↳ Flowcode V5 Suggestions
- ↳ Flowcode V5 Free Edition
- ↳ Flowcode V4
- ↳ Flowcode 4 Bugs
- ↳ Flowcode 4 Suggestions
- ↳ Flowcode V2 & V3
- ↳ General / Misc
- ↳ Components (Comms)
- ↳ Components (Other)
- ↳ Bugs / Application Errors
- ↳ Suggestions
- ↳ BTEC Unit 6
- ↳ C and ASM Programming
- ↳ E-blocks
- ↳ Formula AllCode
- ↳ Formula Flowcode
- ↳ MIAC
- Language Support Forums
- ↳ Deutsch Support-Forum
- ↳ Forums d'aide en français
- ↳ Foro de soporte español
- Other Matrix products
- ↳ Electronics products
- ↳ Matrix Online Courses
- ↳ Other products
- ↳ CoCo
- Hidden