Inter-daisy Digital Audio
A pair of programs demonstrating a multi-daisy setup sharing digital audio over I2S using the SAI peripherals.
The demo is made of two programs:
This program configures SAI2 as the "Leader" (SAI2 B in Sync::MASTER).
A pair of waveforms are generated in the audio callback, and transmitted over the SAI2 buffers to DaisyB. The data received back from DaisyB is written to SAI1, outputting them on the seed's analog outputs.
This program configures SAI2 as the "Follower" (SAI2 B in Sync::SLAVE).
Audio is received on SAI2 from DaisyA, and copied to SAI1 to output on the analog outputs. The same audio is echoed back over SAI2 to DaisyA.
Clone the repo with submodules:
git clone https://github.com/stephenhensley/Dual-Daisy-DSP --recurse-submodulesor, initialize the submodules after cloning:
git clone https://github.com/stephenhensley/Dual-Daisy-DSP
cd Dual-Daisy-DSP
git submodule update --initBuild the libraries with the convenience script:
./ci/build_libs.shor manually build them by running make in each library directory.
In each DaisyA and DaisyB simply run: make
From each project dir, run make program-dfu with only the Daisy you'd like
to flash in the system bootloader.
Alternatively, you can use the web programmer.
The binary files are created in the build/ dir of each project directory.
To try out this demo you'll need:
- 2x Daisy Seed (any revision)
- several jumper wires (>=9)
- a breadboard (not actually required, but ... helpful)
- an o-scope, or audio jack for monitoring the output
- Flash each daisy with the respective programs
- Connect all four GND pins to each other
- Wire each of the following pins to the same pin on each Daisy:
- D25 (SAI2 SB)
- D26 (SAI2 SA)
- D27 (SAI2 FS)
- D28 (SAI2 SCK)
- Plug each Daisy into USB power
When funcitoning properly:
- DaisyA should be blinking twice a second
- DaisyB should be blinking four times a second
- DaisyA and DaisyB audio out 1 should be a 220Hz waveform
- DaisyA and DaisyB audio out 2 should be a 440Hz waveform