|
|
||
|
The Engineering Toolbar
The Ultimate Resource for Engineering and Technical Research. (Learn More) |
|
From Microchip Technology, Inc.
AN1061 Efficient Fixed-Point Trigonometry Using CORDIC Functions For PIC16F TABLE 1: SIN(x) FUNCTION CALL Author: Jose Benavides SPECIFICATIONS WITH Microchip Technology Inc. PIC16F877A AT 20 MHZ CORDIC in asm Math.h in C INTRODUCTION Time 370 µs1.9 ms This application note presents an implementation of the Flash 190 words 1,117 words following fixed-point math routines for the PIC16F RAM 11 bytes 40 bytes microcontroller families: * SIN(X), COS(X) CORDIC THEORY ATAN(X) The CORDIC transform is based on the idea that all the CORDIC is an acronym for COordinate Rotation DIgital trigonometric functions can be calculated using vector Computer and was first developed by Jack Volder in rotations. Equation 1 shows how to do vector rotations. 1959. The CORDIC transforms are a collection of Its derivation is presented in Appendix B. iterative, shift-add algorithms used to compute a wide range of trigonometric and hyperbolic functions on a EQUATION 1: ROTATION OF VECTOR digital computer. (X, Y) BY ? With proper modification, these routines can also be -1 -1 xx= cos? - ysin?, cos , polar/rectangularused to implement the sin yy= cos? + xsin? coordinate conversion, hyperbolic, and even multiply/ divide functions. More detail on these modifications can Figure 1 shows an example of Equation 1 by rotating a be found in a paper titled, "A Survey of CORDIC vector (70, 19), by 30°. Algorithms for FPGA-Based Computers" by Ray Andraka. FIGURE 1: ROTATION OF VECTOR The structure of the CORDIC transform lends itself to (70,19) BY 30° hardware implementations. Typical applications of the CORDIC transform include FPGA-based applications. In fact, entire Arithmetic Logic Units have been imple- mented based on the CORDIC transform. However, the software-based CORDIC algorithm presented in this 51.4 application note will provide a sufficient performance improvement for most applications. 19 These fixed-point CORDIC math routines are consider- 45°ably faster than other more traditional methods based 15° on the Taylor expansion. This makes these routines 7051.1 ideal for real-time applications requiring very fast calcu- lations. The SINCOS function, which simultaneously x = (70)cos(30°) - (19)sin(30°) = 51.12 calculates the sine and cosine values of a given angle = (19)cos(30°) + (70)sin(30°) = 51.45y using the CORDIC transform, will typically take 370 µs to compute on a PIC16F microcontroller running at 20 MHz. This is in contrast to 1.9 ms using a sin(x) function The CORDIC transform gives an iterative method for Products & Services
Microcontrollers (MCU) are complete computer systems on a chip. They combine an arithmetic logic unit (ALU), memory, timer/counters, serial port, input/output (I/O) ports and a clock oscillator.
Search by Specification |
Learn more about Microcontrollers (MCU)
Specialty microprocessors and microcontrollers are specialty or proprietary products and accessories related to microprocessors and microcontrollers.
Learn more about Specialty Microprocessors and Microcontrollers
Product Announcements
Topics of Interest
AN1061 Efficient Fixed-Point Trigonometry Using CORDIC Functions For PIC16F TABLE 1: SIN(x) FUNCTION CALL Author: Jose Benavides SPECIFICATIONS WITH Microchip Technology Inc. PIC16F877A AT 20 MHZ...
(Read More)
B.1 Coordinates
The position of a point particle in three-dimensional Euclidean space is given by the vector r( x, y, z) in Cartesian coordinates, where x, y, and z are measured in the x ~, y ~,...
(Read More)
Useful Integrals
Trigonometric Relations
sin( x y) = sin x cos y cos x sin y
cos( x y) = cos x cos y sin x sin y
2sin x sin y = cos( x - y) - cos( x + y)
2sin x cos y = cos( x + y) +...
(Read More)
In this section, we present several useful trigonometric identities used in communication system design.
e j ? = cos ( ?) j sin ( ?)
cos( A) = sin( A + 90 )
sin( A) = cos( A ? 90 )...
(Read More)
Appendix List
Appendix A: Mathematical Symbols
Appendix B: A Review of Some Elementary Trigonometry
Appendix C: Integrals
Appendix D: The Fourier Transform: The Different Conventions...
(Read More)
|
|