diyAudio

diyAudio (http://www.diyaudio.com/forums/)
-   Digital Line Level (http://www.diyaudio.com/forums/digital-line-level/)
-   -   CS8406 SPI problem (http://www.diyaudio.com/forums/digital-line-level/195117-cs8406-spi-problem.html)

mstro 22nd August 2011 01:59 PM

CS8406 SPI problem
 
Hey Folks,

I'm having trouble in Interfacing a CS8406 from my XMOS Controller using the Software Interface in SPI Mode.

If i read the datasheed correct, there has to be a high->low transition after the device is let ouf of reset. Well I'm doing that...

my init code looks like this:
Code:

    set_port32A(11);    // OsziTrigger CS_DAC2
    clear_port32A(6);    // !Reset CS8416
    clear_port32A(1);    // !Reset CS8406
    set_port32A(12);    // ChipS CS8406
    delay_ms(1);
    set_port32A(1);        // Reset CS8406
    delay_ms(1);
    clear_port32A(12);    // !ChipS CS8406
    set_port32A(10);    // SCLK
    delay_ms(1);
    set_port32A(12);    // ChipS CS8406
    set_port32A(9);        // MOSI

After that i'm sending the following string to get the Rev ID and Version of the chip to test the spi interface:

Code:

            spivar=0x20;
            clear_port32A(12);  //CS low
            spi_byte_transmit(spivar);  //Transmit MSB First
            spivar = 0x7F;
            spi_byte_transmit(spivar);
            set_port32A(12);  //CS high

            delay_us(50);

            spivar=0x21;
            clear_port32A(12);
            spi_byte_transmit(spivar);
            spi_byte_transmit(0xFF); //dummy transmit to check a reacton on oszi
            set_port32A(12);

Well the problem now is that there is no reaction from the CS8406.
I checked the spi signals with my Agilent Scope and LA and it just looks like its described in the datasheet of the chip.

Is there any known issue about these Chips?
Or is my Code simply wrong?

Thanks for your help,
Greetings,
Manuel

chaparK 23rd August 2011 09:20 AM

Did you tie pin H/S\ to GND to select software mode?

mstro 23rd August 2011 09:59 AM

Hello chaparK,

the H/S Pin is tied to GND.
Here is the complete schematic of the CS8406:

http://img707.imageshack.us/img707/919/cs8406.png

Uploaded with ImageShack.us

chaparK 23rd August 2011 10:11 AM

I can't see anything wrong in your schematic.
Just a thought: I saw in your code that you're using a CS8416 as well in the same project. Do you have a working SPI with that chip?

mstro 23rd August 2011 12:37 PM

On the CS8416 there's another problem it seems like it's stuck in hardware mode. The Pullup on the SDOUT line is present but seems to have no effect.

When i release the chip from reset on my SPI lines there signals can't get down to 0V about 1V is present if there should be a low, so i guess it's in hardware mode. And there is no answer either.

I could make some scope fotos of this but atm i'm running my usb streaming software on the xmos controller. Tomorrow there will be some time again for testing with the cs8406/16 chips.

They make a lot of trouble

chaparK 23rd August 2011 01:05 PM

If you have floating levels on some pins, it's maybe a sign that your chips were not reset properly.

To make sure you have a nice reset:
- first pull high the reset pin
- then pull it down and wait a while. 1 ms as in your code is fine.
- pull the reset pin up again to start the device

I can not see from your code what's the initial state of the reset pin (the code starts with 'clear_port' but the pin was maybe already low).
I finished not later than last week to test a prototype with a CS8416 - unfortunately in hardware mode - and it works really fine. However i had initially some resetting issue and noticed also some strange level on pin 14 which is NV/NERR in hardware mode.

Hope this helps

mstro 24th August 2011 09:09 AM

Playing with the reset pin didn't solve the problem :(

here are 2 scope pictures of my interfacing
yellow trace: Reset
green trace: CS
D0: CLK
D1: MOSI
D2: MISO
D4 Oszi Trigger signal

http://img856.imageshack.us/img856/6520/scope5.png

http://img41.imageshack.us/img41/8134/scope6.png

It's funny the usb streaming part works fine, thought i would have problems there and now it's those cs chips that are making trouble...

mstro 24th August 2011 04:19 PM

Well now the CS8406 is working fine :-)

replacing R35 with a 0R Resistor solved the problem, don't understand why but i'm happy it works now...

chaparK 25th August 2011 03:50 AM

That's good news mstro!

Indeed the datasheet specifies that that pin should be tied to VL or GND if the chip is in SPI mode.
What was your idea behind the 47k resistor?

Anyway, you just need to solve your last issue with the cousin 8416, and then i hope you'll give us a quick chat about the xmos stuff

mstro 25th August 2011 08:31 AM

unfortunately i'm going on holiday for 3 days so there is no time for testing with the cs8416 till monday/tuesday but i can give you a short introduction about the xmos part of this project.

The whole project is an xmos based usb audio streaming application for the moment with s/pdif transmitter/receiver.
The streaming part is based on the xmos usb audio 2.0 reference design for 2 input and 2 output channels with up to 192kHz/24Bit.
I'm running it in difference to the ref design with a 400Mhz XS1 Device.
There are some customer wishes on the board, don't think i'm allowed to talk about them.
The xmos platform gives great possibilities. It takes some time to learn this special xc language for programming them in an efficient way. But now i'm loving these processors :)


All times are GMT. The time now is 02:54 PM.


vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2014 DragonByte Technologies Ltd.
Copyright 1999-2014 diyAudio


Content Relevant URLs by vBSEO 3.3.2