Interfacing Atmel Processor with i2s codec

atmelaudioclocki2s

I would like to interface an ATSAMS70 with a CS42L51 but this is my first time doing so.
The connection would be this:

MCLK – PCK2
SCLK – TK
LRCK – TF
SDIN – TD
SDOUT – RD

The thing is about the frequency I will work with. I will be using USB on the ATSAM, so I chose a 12 MHz crystal.
I would like to have a sample rate of 44.1 KHz but according to the datasheet I would need a MCLK of 11.2896 MHZ using the 256 scaler.

Would that be a problem? I mean, I would not be matching the 44.1 KHz but I think that's not that bad.

Best Answer

Whether that's a problem depends on how you use the audio.

If the sampling rate of the original audio is 44.1kHz, but you use 12M/256=46.88kHz, the audio will be higher pitched by around 6%. You can check how this would sound via Audacity or similiar software.

However I don't really get why you think that the I2S would be tied to the processors frequency with a 2^N divider - you could just use a timer with a divider closer to the needed value and since the main clock for a S70 is up to 300MHz, you could just divide that by 6803 by using a timer and get a 44.098kHz sampling rate, which has an error of only ~0.005%.

Related Topic