Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: [lpc2100] Audio DAC

2004-02-11 by Robert Buadu

Here are some thoughts:

I've looked at conecting an I2S audio DAC to the LPC21xx. This is what 
I've concluded.

I2S is a serial interface similar to SPI. The LPC2106 does not have 
hardware support for I2S. We have to implement it in software.

Say we want to output 44.1kHz stereo data. That needs a minimum clock of 
44100 * 16bit * 2 channels = 1411200Hz (1,4MHz).Some chips require a 
minimum clock of clock of 256*fs. That is way too fast. We need to run 
the chip in slave mode and provide a clock for the data.

Lets say our cpu clock is 56448000Hz (56Mhz: 14.112MHz*4). We need to 
output a new sample 40 clock cycles. And we need to toggle the clock 
every 20 clock cycles. The FIQ interrupt haa latency of 7 to 30 cycles. 
So using interrupts will not work too well. Okay if you know that the 
FIQ latency will always be 7 cycles, then it is possible but this 
probably limits what you can do with the processor in normal mode.

One can do away with interrupts and code counting the cycle time of the 
instructions. With this you will more or less have a dedicated parallell 
to I2S converter. One probably can't do very much more with the processor.

A few audio DAC's have a block mode, which does not need a precise 
clock. This allows you to bit-bang the interface. In this case it is 
quite feasible. You only need an interrupt every sample, that is every 
1280 cycles. You then send out a stream of data with the minimum allowed 
clock cycle for block mode. Now, I've not actually tried this so it 
might not work. There was very little info about this mode in the 
datasheet I was reading.

/RB





Peter Kuhar wrote:
> Hello,
> 
> Has anyone connected audio DAC to LPC210x?
> 
> 
> /Pero
> 
> 
> 
> 
>  
> Yahoo! Groups Links
> 
> 
> 
>  
> 
>

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.