DSPRelated.com
Forums

Interfacing AD1938 with Blackfin through SPI.

Started by yegn...@gmail.com January 3, 2011
Hi all,
I am using a board in which the AD1938 codec is interfaced with blackfin through SPI. I tried to configure the CODEC's registers through SPI port, but I am unsure that I made a SPI write on to the intended register of the codec. So I tried reading the codec's register, and I always receive the bit '1' from the MISO pin of the codec(DSP's SPI is master and CODEC is slave). Anyone help me in reading the codec's registers.
On Mon, 3 Jan 2011, y...@gmail.com wrote:

> Hi all,
> I am using a board in which the AD1938 codec is interfaced with
>blackfin through SPI. I tried to configure the CODEC's registers through
>SPI port, but I am unsure that I made a SPI write on to the intended
>register of the codec. So I tried reading the codec's register, and I
>always receive the bit '1' from the MISO pin of the codec(DSP's SPI is
>master and CODEC is slave). Anyone help me in reading the codec's
>registers.

Howdy Yegnesh,

Can you put a 'scope on the clock, MOSI and chip select lines? Make sure
the phase of the clock is correct for the codec. I've not played with the
Blackfin, but I assume you can change clock phase and idle as high or low.
If it goes in right, it will come out right.

Just about every problem I've ever had with SPI is getting the phase
right. Also check the manual on the codec to see if the chip select line
needs to be raised for the data to be captured. On some devices you can
not leave cs low even if it's the only device you talk to.

Patience, persistence, truth,
Dr. mike
Hi all,
>I am using a board in which the AD1938 codec is interfaced with blackfin through SPI. I tried to configure the CODEC's registers through SPI port, but I am unsure that I made a SPI write on to the intended register of the codec. So I tried reading the codec's register, and I always receive the bit '1' from the MISO pin of the codec(DSP's SPI is master and CODEC is slave). Anyone help me in reading the codec's registers.

Hi Mike,
I tried tapping out the signal lines of SPI port and you are absolutly right. Indeed, the clock phase mismatch was the problem and you got it right. Now I have fixed my issues. Thanks to you and DSPRelated.com.
Thanks once again.