|
|||||||
| Home | Forums | Rules | Articles | Store | Gallery | Blogs | Register | Donations | FAQ | Calendar | Search | Today's Posts | Mark Forums Read | Search |
| 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 |
|
![]() |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
diyAudio Member
Join Date: Aug 2003
Location: Calgary
|
Is anyone here using the CS8416 in "Software Mode"?
If so, I have some questions. I have built a DAC board with the CS8416 and the MAX9850. I have the I2C bus working nicely (connected to a PIC 18F2550) and I can read/write commands to either chip. But, so far - the only sound output is a few clicks. Please share your init sequence. Here is mine (function I2C_W2 writes 2 bytes on the I2C bus): Code:
r = I2C_W2(RXI2S_A, RXI2S_SADFMT, 0b10000000); // set audio output port to Master mode r = I2C_W2(RXI2S_A, I2SDAC_LRCLKH, 0b10001011); // set Integer mode, DLY, 24 bit r = I2C_W2(RXI2S_A, I2SDAC_DAUDIO, 0b00001000); // set I2S data r = I2C_W2(RXI2S_A, RXI2S_CNTRL2, 0b00000011); // set GPO-0, red, to C bit r = I2C_W2(RXI2S_A, RXI2S_CNTRL3, 0b01100000); // set GPO-1, green, to NVERR r = I2C_W2(RXI2S_A, RXI2S_CNTRL4, 0b10000000); // set RUN b) I have my CS8416 in Master Mode and the DAC in Slave Mode, does that make sense? Thanks, Jake |
|
|
|
#2 |
|
diyAudio Member
Join Date: Oct 2001
Location: .
|
a)AUDIO 1001 Non-audio indicator for decoded input stream.
In order to make the determination as to whether the data is audio (linear PCM) or non-audio (AC3/DTS) the data has to be valid. |
|
|
|
#3 |
|
diyAudio Member
Join Date: Apr 2010
|
You might want to do a cross check with (part of) my SPI init code.
This is confirmed to work (also by reading status registers, eg the receiver error (0C) register and the version register (7F). Code:
int control4_reg = 0x8b; // 0x8b = coax 1 default, 0xb2 = coax 2, 0xba = coax 3, 0xa3 = opt1, 0xaa = opt2,
void cs8416_init(void) {
cs8416_rst = 0; // put device in reset
DelayMs(1); // delay 1 ms
cs8416_rst = 1; // wake device
DelayMs(1); // delay 1 ms
cs8416_cs = 1; // enter SPI mode by setting cs high
cs8416_write(control4, control4_reg); // send run state, RXP0 on, RXP2 (not connected on PCB) to TX
cs8416_write(rem, 0xff); // unmask all receiver error bits
cs8416_write(int_mask, 0xff); // unmask all IRQ
cs8416_write(sadf, 0b10100101); // set master mode (1)
// OSCLK is 64*Fs (0)
// 16-bit resolution (10)
// left-justified (0)
// MSB on second clock period (1)
// sampled on rising edges of OSCLK (0)
// right channel when OLRCK is high (1)
cs8416_setpdur(1);
} //end cs8416_init
Now, the trouble I am having is I am not getting anything useful out of the 0x19 - 0x22 (channel status registers, would love to read the sample rate, bit depth from the S/PDIF stream)... Can anyone help, please? |
|
|
|
#4 |
|
diyAudio Member
Join Date: Apr 2010
|
wrt b) yes, that configuration makes sense
|
|
|
|
#5 | |
|
diyAudio Member
Join Date: Apr 2010
|
Quote:
Cheers!! |
|
|
|
|
#6 | ||
|
diyAudio Member
Join Date: Aug 2003
Location: Calgary
|
Quote:
Why MSB on second clock period? Why right channel on ...? Also, what does CS8416_setpdur(1) do? Quote:
Jake |
||
|
|
|
#7 | |
|
diyAudio Member
Join Date: Apr 2010
|
Quote:
CS8416_setpdur(1) sets the PDUR bit. For the functionality of the PDUR bit, please search the datasheet of the CS8416. I can't explain it any better than that. |
|
|
|
|
#8 |
|
diyAudio Member
Join Date: Apr 2010
|
One more thing that came to mind: I had a situation where my CPU stalled (because of table writes to program memory), effectively violating SPI timing. Result was skipping inputs when cycling through RXP0 - RXP5.
Do post how you are progressing with troubleshooting. |
|
|
|
#9 |
|
diyAudio Member
Join Date: Aug 2003
Location: Calgary
|
I have made some progress and got something out of my DAC. The sound is distorted, but recognizable.
Meanwhile I still can't get the GPO LEDs to change. For example the AUDIO bit should be high when a proper SPDIF/PCM stream is detected, but it stays low all the time (although it does flicker a bit when I disconnect the SPDIF input). |
|
|
|
#10 | |
|
diyAudio Member
Join Date: Apr 2010
|
Quote:
So when valid PCM is detected pin is low, not high. Still doesn't explain the flickering when you disconnect input, though, LED should be solid on. Time to check the electrical connections, then? Or maybe resetting the part in some while loop?... Good luck! |
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| CS8416 in sw slave mode with external clock | milandks | Digital Line Level | 0 | 29th March 2009 09:45 PM |
| Help me set up CS8416 in HW mode | ezkcdude | Digital Source | 6 | 2nd May 2006 10:08 PM |
| Using a spdt switch to select between triode mode and pentode mode on a guitar amp. | G | Tubes / Valves | 19 | 15th March 2006 09:15 AM |
| Calculating watt requirements for multi-mode/tri-mode operation? | Datoyminaytah | Solid State | 1 | 14th August 2004 07:43 AM |
| DF1706 and software mode control? | WTS | Digital Source | 8 | 25th March 2004 10:02 PM |
| New To Site? | Need Help? |
| Page generated in 0.10717 seconds (88.71% PHP - 11.29% MySQL) with 10 queries |