Connecting an audio source to the DSP is a fairly straightforward interface task. Figure 4 shows an example where a microphone's analog output is converted to digital through an A/D converter. Working as the master device, the DSP selects the A/D as an SPI slave peripheral. Data then gets transmitted using three of the four Blackfin SPORT pins in the receive direction. The reverse case shown in Figure 5—connecting the processor to a D/A converter—is equally easy. Again acting as the SPI interface master, the processor configures and controls the converter, with the data flowing in the other direction over the I²S SPORT interface to the D/A. The analog output subsequently feeds a speaker.
(Click to enlarge)
4. Connecting an audio A/D converter to an embedded processor
(Click to enlarge)
5. Connecting an audio D/A converter to an embedded processor
Audio interface tips and tricks
A few quick reminders will make an already easy application even easier. On the processor's TWI, it is important to remember to put pull-up resistors on both SCL and SDA lines, per the I²C specification. This is important because these pins are never actually driven high. (For that matter, you should use proper termination for all clock and your frame sync signals). And on the SPI, check that all MISO pins are connected to MISO pins, and MOSI pins to MOSI pins. Because the two signal names are very similar, it's easy to mistakenly swap the signal names and functionality.
A good way to simplify development is to take advantage of a vendor's device driver suites. For instance, the ADI VisualDSP++ tool suite includes peripheral device drivers for SPI, SPORT, TWI and others, that facilitate the configuration and control of these interfaces (via a standard API).
Also, a vendor's hardware platform offerings can be indispensable for evaluating and developing an embedded processing solution. For example, the Blackfin EZ-KITs and associated EZ-Extender cards come with integrated converters and numerous code examples. These offerings provide a useful framework for quickly learning how to interface audio to Blackfin devices. As another example, ADI's VisualAudio algorithm development tool helps streamline the design of audio systems using the Blackfin processor.