CS8406 SPI problem - diyAudio
Go Back   Home > Forums > Source & Line > Digital Line Level

Digital Line Level DACs, Digital Crossovers, Equalizers, etc.

Please consider donating to help us continue to serve you.

Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving
Reply
 
Thread Tools Search this Thread
Old 22nd August 2011, 02:59 PM   #1
mstro is offline mstro  Germany
diyAudio Member
 
Join Date: Mar 2011
Default 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
  Reply With Quote
Old 23rd August 2011, 10:20 AM   #2
chaparK is offline chaparK  Luxembourg
diyAudio Member
 
Join Date: Apr 2010
Location: Luxembourg
Did you tie pin H/S\ to GND to select software mode?
  Reply With Quote
Old 23rd August 2011, 10:59 AM   #3
mstro is offline mstro  Germany
diyAudio Member
 
Join Date: Mar 2011
Hello chaparK,

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

Click the image to open in full size.

Uploaded with ImageShack.us
  Reply With Quote
Old 23rd August 2011, 11:11 AM   #4
chaparK is offline chaparK  Luxembourg
diyAudio Member
 
Join Date: Apr 2010
Location: Luxembourg
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?
  Reply With Quote
Old 23rd August 2011, 01:37 PM   #5
mstro is offline mstro  Germany
diyAudio Member
 
Join Date: Mar 2011
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
  Reply With Quote
Old 23rd August 2011, 02:05 PM   #6
chaparK is offline chaparK  Luxembourg
diyAudio Member
 
Join Date: Apr 2010
Location: Luxembourg
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
  Reply With Quote
Old 24th August 2011, 10:09 AM   #7
mstro is offline mstro  Germany
diyAudio Member
 
Join Date: Mar 2011
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

Click the image to open in full size.

Click the image to open in full size.

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...
  Reply With Quote
Old 24th August 2011, 05:19 PM   #8
mstro is offline mstro  Germany
diyAudio Member
 
Join Date: Mar 2011
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...
  Reply With Quote
Old 25th August 2011, 04:50 AM   #9
chaparK is offline chaparK  Luxembourg
diyAudio Member
 
Join Date: Apr 2010
Location: Luxembourg
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
  Reply With Quote
Old 25th August 2011, 09:31 AM   #10
mstro is offline mstro  Germany
diyAudio Member
 
Join Date: Mar 2011
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
  Reply With Quote

Reply


Hide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Schemo for a SPI 230G AT psu N-Channel Power Supplies 4 7th March 2008 02:07 PM
CS8416 and CS8406 flippo Group Buys 5 5th January 2007 07:15 PM
CS8416+CS8406 U bit data problem pkaszas Digital Source 0 17th April 2006 03:33 PM
Cs8406 mcs Digital Source 0 11th November 2004 04:05 AM
cxa1244 SPI padamiecki Parts 0 29th March 2004 05:58 AM


New To Site? Need Help?

All times are GMT. The time now is 02:46 AM.


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