Generate signal at a given frequency with the AD9833 generator
For sure, you can generate a signal with the analog output of your microcontroler or with an external digital to analog converter wired to the SPI bus.
It would certainly be good for audible frequency but will have various limitations:
- The maximum frequency of the generated signal is limited by the MCU processing capability and SPI bus max rate.
- The microcontroler is working to generate the signal, which means less ressources to do other jobs.
- The signal stability heavily relies on the software stability.
All of that become quite easy when using the AD9833 signal generator. Indeed, just need to send the commands to the AD9833 via the SPI bus and the signal will be generated on the output.
L'AD9833 is able generate sinus wave or triangle wave or square ware at the given frequency between 0 and 12.5 MHz.
The AD9833 does have an Arduino library (eady to find on Internet) and a MicroPython library (developped by MCHobby).
The AD9833 is one of the main components used in the Python Organ project.
- AD9833 datasheet (pdf)
- Supply voltage: 2.3 to 5.5V
- Frequency: 0 Hz to 12.5 MHz
- Programmable phase & frequency.
- Output: 0.6 Vpp
- Interface SPI (3 wires)