forked from the0b/MSP430-CORDIC-sine-cosine
-
Notifications
You must be signed in to change notification settings - Fork 0
daranguiz/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. 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.
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published