
Generate sine waves with 2 mbeds synchronised. Configurable amplitude and phase. Built for 50 Hz mains simulations.
You are viewing an older revision! See the latest version
Homepage
Small program based on the MODDMA buffered sine wave example.
This programs reads pin 22 to operate in Master (low) or Slave mode. Then configures pin 21 as output (master) or input (slave), in master mode led2 is on. Use a resistor (100 ohm) between the pin21's of master to slave.
The program then calculates a buffer of sine waves for the DMA with parameters given. And starts the DMA and DAC to generate the sine.
On the callbacks of the dma complete (there are 2) slave waits for a sync and master gives a sync, p21. Master waits a few extra clocks to make sure slave is ready.