RP2040 Software Design
Hardware to Interface
- TI TAA3040 - 4 channel audio ADC
- SPI or I2C control interface
- TDM audio sample output
- some stereo DAC - probably another TI part with TDM or I2S input
- USB interface to present device as input and output channels to a host computer
- some user interface controls
- knobs
- buttons
- a display would be cool
4-Channel ADC samples in via TDM Interface - WIP
First pass of the PIO program was written, intending to test with another pico providing the TDM output signal
- PIO program to receive samples on serial pin as a slave to the TAA3040 ADC providing bit clock and sync pulse
- one 32-bit sample will be pushed to the RX_FIFO at a time, one sample from each channel per TDM frame
ADC control and configuration via SPI or I2C - TODO
There are a lot of features on the TAA3040 that are configurable by software. For a first pass, just set the chip up in a static configuration and let it go. For future improvement, there are a ton of ways it could be set up and integrated with the USB audio specification.
2-Channel stereo output to DAC via I2S or TDM - TODO
This will take samples returned from the USB host and output to the DAC. This could be I2S as that supports 2 channels no problem. Probably a slightly simpler PIO program than TDM.
DAC control interface via SPI or I2C - TODO
select a chip that's also controlled via SPI or I2C.
USB Audio interface - TODO
transmit 4 channels of samples to the host, and receive 2 channels back from the host. Also handle configuration - there are a ton of things that could be exposed to the USB host as configurable options and it would be cool to support a lot.
USB Audio will transmit a packet of samples every 1ms
Moving sample data with DMA
- samples can move one at a time from ADC PIO RX FIFO to USB transmit buffer
- samples can move one at a time from USB receive buffer to DAC output PIO TX FIFO
- bypass mode could move samples from primary input channel to output without going through USB
- a little latency but definitely less than the 2ms at minimum round trip to/from USB host
- could have some self-contained mixing capability that would go from ADC channels -> pico software -> DAC channels
- probably don't need to also implement a total analog bypass, but could provide a physical switch