AN2025 generates sine via lookup table. This method is more limited in max
frequency it can generate, especially in PSOC 1. But the method is adapatable
to any continuous time waveform, triangle, ramp, sin(x)/x..........Method takes a
lot of MIPs, precious in a PSOC 1. Or use PSOC 3/5 where whole method is
accomplished in HW, DMA, DAC......
Alternatively you can use a Timer to generate freq of interest, then filter with
a BP filter to extract fundamental, a sinusoid.
The updated AN2025 talks about about how a sine wave can be obtained by filtering techinque.In this method, a square wave with frequency equal to the desired sine wave frequency is generated by using timers. This square wave is then passed through a band pass filter to eliminate the higher order harmonics. Only the fundamental frequency is untouched, which is the desired sine wave.
Since the Implementation is purely in hardware, MCU is entirely free and can be used to implement any other functionality. Also, Higher frequencies can be generated which is not possible in lookup table method.
Thnaks, I was working off an older version of AN2025.
From ap note -
1) Implementation is purely in hardware.CPU can
be used to implement any other functionality.
2) Can be used for obtaining higher frequency sine
waves which can’t be obtained by the DAC
method because of limitation of maximum DAC
update rate and CPU overhead.
1) Because of the discrete values of the
capacitance, a trial and error method may have
to be used to achieve the right expected filter
Also what they do not discuss is filter approach basically a fixed
frequency approach, as there are no APIs to tune filter in code
other than direct register writes, and user would have to create
a table of values based on Wizard trial runs to use. Also subject
to device to device variation, unlike LUT approach, especially
when PSOC is run off a xtal. Also filter approach cannot produce
ramp/triangle/sin(x)/x, eg other wave shapes.