Not really getting what the CORDIC was used for..doesn't the MPS430 store literals in memory?
I'm sure there is some cordic description on line, but I can describe it
reasonably well from memory. The cordic has a table of sines and
cosines. It essentially goes from 90 deg, 45 deg, 22.5 deg etc in
decreasing powers of two. I say essentially because what you do is
pretend the circle has a power of two number of degrees, i.e.256
degrees, 512, etc. This makes the algorithm easier to program.
The cordic takes the angle in question and uses a successive
approximation scheme to drive it to zero. That is, if you were looking
for the sine or cosine of 50 degrees, your first step would be to
subtract 45 degrees, which is a value in your table. You keep this up
until you have driven it to zero as best as you can. the accumulators
will contain the sine and cosine of the initial angle.
Now you could generate a sine wave with stored samples of the signal,
but that isn't very flexible. To generate a sine wave with a cordic, you
accumulate phase. That is you pick a phase step size which represents
the fraction of a sine wave that you are going to use in the
approximation. Say you wanted 1 degree steps. Then you would feed the
cordic 1, 2, 3, etc. Now if you set up your pretend circle to have 256
degrees in it, then the phase accumulator will always return to zero and
the sequence would continue. So your phase input is a digital sawtooth
signal.
But you could have picked the phase interval to be some number which
won't return to zero. Say you picked 3 degree steps. Then the sequence
would go 0,3,6...255, 2,5,8, etc. This allows for more flexibility in
generating the sine wave relative to the clock.
I haven't looked at code yet, but that should be how it is written, with
some foo I left out. As you do the successive approximation scheme, you
are basically rotating a vector from the initial starting point to zero.
The cordic causes the vector to expand, so you need to seed the cordic
with a scaled version of the vector. I 'd have to dig up a book to
explain this is detail, but it is well documented.
So the person I presume picked or let the user input a phase step, then
creates the sine and cosine on the fly. Those values are then generated
with a PWM type DAC. You get the sine and cosine at the same time. This
means you have a quadrature phase available if need be.
There is a PHd. dissertation at Stanford that is the bible of cordic
processing. The authors name (first or maybe last) is Ahmed, but if you
search Stanford library on line, you would find the dissertation. It is
or was in the Terman library, or perhaps Green. It was way better than
what you find in most signal processing books. At least 90% of PHd
dissertations aren't worth the paper they are printed on, but we built
multi-millions of chips using schemes out of that dissertation back in
the day.
Most DSP books will cover generation of sine and cosine with the
cordic, but Ahmed's dissertation covered the transcendental functions.
So you could linearize thermocouples with it, etc. Or as I stated in the
other post, take the arcsine and do a FSK demod.