-
Notifications
You must be signed in to change notification settings - Fork 6
the0b/MSP430-CORDIC-sine-cosine
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This project contains a function to caluculate sine and cosine using CORDIC rotation on a 16 bit MSP430. The function takes any angle in degrees and outputs the answers in Q.15 fixed point format. (floating point) = (fixed point)/ 2^15 In creating this file, I referenced the 2004 presentation of Fixed Point Two's Complement CORDIC Arithmetic on MSP430 presentation by Titi Trandafir of Microtrend Systems which contained an assembly language program utilizing CORDIC. Presentation available here: www.microtrendsys.com/ATC2004.pdf I also referenced the CORDIC wikipedia page. The function internally utilizes the following decimal angle representation: (decimal angle) = 2^16 * (integer angle in degrees) / 180 I tested the function using 14 iterations and achieved accuracy to 3-4 decimal places. On an 8MHz chip, the algorithm took 256us to calculate sine/cosine for angles in the range greater than -180 to 180 degrees. If you constrain the input angles to -45 to 45 degrees and remove all the logic for greater angles, the CORDIC iterations are finished in 178us. The file "MSP430 CORDIC Accuracy.xlsx" is a dump of the results of the algorithm for angles in the range of -90 to 90. ------------------------------------------------------------------------------- Copyright (c) 2011 Theo Brower Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published