Sharing this insightful blog post by Mark Hastings on the application note AN69133.
The WaveDAC8 component and application note (AN69133) was released about a year ago. I found that many people see the title Easy Waveform Generation with the WaveDAC8 Component and think that it just generates a simple waveform. The component is far more flexible than that. The application note AN69133 contains four example projects to show the flexibility and ease of use. Granted the first project generates a simple sine wave but the other three projects go further.
The second project, 2_WaveDAC8_TwoWaves shows how you can alternate between two waveforms and easily switch right at the end of each wave. The project schematic is rather simple, and the source code can t get much simpler.
Project source code.
/* Initialize WaveDAC8 */
for(;;); /* Loop forever */
This is the waveform output, notice it is not just a simple sinewave.
The third project "3_WaveDAC8_UART_FSL" shows how to generate a simple FSK output when you combine the WaveDAC8 and UART components. Note the simplicity of the schematic below. By changing the two clocks you can generate any two frequencies you want.
The scope screen shot below shows the output of the UART and the WaveDAC8 output.
Again the code can t get much simpler to send out Hello World .
/* Initialize WaveDAC8 */
UART_1_Start(); /* Initialize UART */
Clock_1_Start(); /* Start both clocks */
/* Send "Hello World" */
UART_1_PutString((uint8 *)"Hello World");
CyDelay(250); /* Wait 500 mSec */
The forth project was probably the most fun. Who doesn t enjoy dialing their phone with their own custom made PSoC controlled DTMF dialer. This project used two WaveDAC8 components, a couple of counters, an opamp to buffer the DAC outputs, and a single clock.
This project demonstrates another cool feature of PSoC. Since the WaveDAC8 component uses standard internal DACs to generate the output, connecting the two DAC outputs together is not a problem. When the DAC is in the voltage DAC mode, it is simply a current DAC with an internal resistor. Now the coolest thing about this project is that it gives you a good chance to use that FFT feature in your digital scope. I had the DTMF dialer project dial the sequence 159D which causes all of the eight tones to be exercised. Using the Tek MSO 2024 FFT mode I can see the frequency spectrum of the output, cool eh?
You can find the full application note, example projects, and WaveDAC8 component library on the AN69133 Application Note web page. The application note contains details about the design of the WaveDAC8 and information on sampling theory.
So just remember, although the WaveDAC8 maybe pretty, it has some brains as well. Since it does all it's work with DMA, it does not require any of the valuable PSoC 3 or PSoC 5 CPU cycles.