|
|||
|
|
|||
|
From ww1.microchip.com
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
Math calculation software is used to perform mathematical calculations. These programs provide general core calculations as well as graphical analysis that can be used in science, engineering and technology.
Vector network analyzers are instruments that measure the complex transmission and reflection characteristics of two-port devices in the frequency domain.
Graphics software is used to produce video graphics and to edit and convert graphic files of different formats. These types of software include raster graphics, vector graphics, raster to vector conversion (R2V), and others.
X-ray tubes and sources are lamps that produce X-rays.
Smart card chips contain a microprocessor and/or memory. They are embedded in smart cards; portable devices that resemble credit cards but are used in applications such as banking and health care.
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)
To see how the angle changes for the Haar transform, we will start again with the point , which we know becomes in the Haar-domain. What are the angles that these points make with respect to their...
(Read More)
Introduction A detailed description of the Fourier transform ( FT ) has waited until now, when you have a better appreciation of why it is needed. A Fourier transform is an operation which converts...
(Read More)
This application note presents implementations of the following math routines for the Microchip PICmicro microcontroller family: square root function, exponential function, base 10 exponential...
(Read More)
This application note presents implementations of the following math routines for the Microchip PICmicro microcontroller family: square root function, exponential function, base 10 exponential...
(Read More)
Technical Articles
Efficient Fixed-Point Trigonometry Using CORDIC Functions for PIC16F
- Microprocessors and Microcontrollers
|
|