WM8805 Software & S/PDIF mode - 96kHz Problems - 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 16th April 2013, 04:19 PM   #1
diyAudio Member
 
Join Date: Mar 2012
Default WM8805 Software & S/PDIF mode - 96kHz Problems

Hello everyone,

I'm trying to use the WM8805 receiver chip as a simple S/PDIF source selector, without read back and we don't need to use the Audio Interface (I2S) of the chip --> disabled.
I have two separately PSUs for Digital and PLL. (both 3V3)

I configure it to use in Software mode & S/PDIF Receive Mode (Page 22), with an Arduino using the I2C Bus, and with a simple crystal of 12MHz.
I have 2 coaxial S/PDIF in and 2 optical in.

I read in the WM8805's datasheet that when using it in S/PDIF Receive Mode, all value of PLL_N and PLL_K are automatically set to Receive and Decode data from 32kHz to 96kHz.
It's only the 192kHz mode (Mode 1) that need a Re-configuration of all the value of PLL, FreqMode, etc But i don't use it yet.

I succeed to use it with a 24b/48kHz sampling rate input (in coaxial and optical) but when switching to 24/96KHz, I can hear music, but too much "cracking" and "popping" noises appear.

I don't think there is problems with my code since the chip is configured to adjust clocking section automatically from 32kHz to 96kHz and I have no problems using it in 48kHz, it is only from 88.2 kHz that problems occur.


Is someone has any idea to clean the signal ?

Is that the problem may come from the cheap crystal (and/or these capacitors) ?
Using a High Precision TCXO may solve the problem ?

I use my computer as the source through an Audio-GD Digital Interface V2 plugged directly into my WM8805 board with a Matrix Mini-i as DAC.

Thanking you in advance,

SlapBug
  Reply With Quote
Old 17th April 2013, 01:01 PM   #2
diyAudio Member
 
Join Date: Mar 2012
Hi !

I worked on this by replacing the 12MHz crystal by a Burson Audio low jitter clock module with a separately power supply and --> no improvements...

It seems the WM8805 doesn't want to lock on the input signal as soon as the sample rate exceeds 48kHz.

The wm8805 is on a TSSOP-to-DIP converter, maybe it plays a role, I don't have enough experience in the digital world to know...

Any idea on the origins of this problem ?

Is it possible that a bad routing with too long traces are too short distance between psu lines and data lines is the origin ?

Sorry for double posting, I don't know what to do now...

If you want picture of the installation or the (ultra-basic) Arduino code, ask me, if it can help you to move forward.

SalpBug
  Reply With Quote
Old 17th April 2013, 01:13 PM   #3
diyAudio Member
 
s3tup's Avatar
 
Join Date: Dec 2004
Location: Israel
Sounds like config bug. Go hardware mode, check whether it works with 96k
__________________
The missing link between lead and gold in alchemist's world was BS and commerce.
  Reply With Quote
Old 26th April 2013, 08:39 AM   #4
diyAudio Member
 
Join Date: Mar 2012
Hi,

I worked on my W8805 problem, and no improvements, on the contrary !

I moved from my dedicated "custom" pcb to a breadboard layout, first in Software mode, with the same problem (the W8805 doesn't want to lock on a 96kHz incoming sample rate, while in 32kHz, 44,1kHz & 48kHz there are no problems).
Considering the fact that all functions an PLL calculations are "automatic" when using a 12MHz crystal up to 96kHz (Only Mode 1 [196kHz] needs a reprogramming), i don't know what i can do more !

So as suggested, I moved to the Hardware Mode, and in this config, the result is worse, meaning the chip doesn't want to lock on a 44,1kHz or 48kHz incoming signal ! So i think to a hardware/physical problem... but which one ?!

I post some pictures of the actually breadboard, hoping it can help you ...
I also post the Arduino code, relatively basic, maybe I've forgotten something, I hope too.

W8805_HWMode1 - Download - 4shared
W8805_HWMode2 - Download - 4shared
WM8805_SWMode - Download - 4shared

Code:
// Do not forget to Disconnect internal pull up resistors !! (2 external 10K in // present on board)
// Use Passthrough Option WM8805 to test communication first

// Future Improvements : Detection of Non-Audio , Sample Rate & De-Emphasis

/* If the device is powered up in Software mode, all functions of the device are pwr down by 
 default & must be powered up individually by writing to the relevant bits of the PWRDN register*/

// I2C Frame : START ; DEVA(7:1) , R/W bit , ack , REGA[6:0] , ack , DIN[7:0] , ack ; STOP

// Max SCL Frequency : 100kHz

// Device adress : Read -> 0x75  // Write -> 0x74
// I2C_Scanner found : 0x3A (58 in decimal) which is 0x74 >> 1

// 128fs Mode : MCLKDIV=0

/* In S/PDIF Receive Mode, the PLL_N & K values are automatically modified
 by the S/PDIF receiver to allow the receiver to use the PLL to
 lock on to and track the incoming S/PDIF data stream. */
// When select SPDIF receiver to receive audio data, SPDIFTXCLK Source = CLK2 

// CLKOUT disabled cause of non use

// For Mode 2/3/4 -> PLL_N & PLL_K values are the same & f2 is always 94.3104MHz
// For Mode 1 -> f2=94.3104MHz (for 176.4KHz) OR f2=98.304MHz (for 192KHz)

// "With Flags" Mode only when Audio Interface Enabled

/* Multiple consecutive register writes & Continuous read-back can be performed 
 in 2-wire control mode y setting CONT bit high : CONT = 1 */

// TXSRC = 0 -> S/PDIF Rx ; 1 -> AIF Rx (Audio Input Format [I2S])

// When changing TXSRC & RXINSEL, S/PDIF Transmitter Should Power Down before it and powered up again once changes are made.

#include <Wire.h>
#define WM8805_I2C 0x3A   // Adress WM8805 I2C hexa 7bits [0x3A or 58 or 0b0111010]

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Definition of WM8805 registers + adress  --> RO = Read Only
//#define RST-DEVID1 0x00 // Write: RESET  Read: DEVICEID[7:0]
//#define DEVID2 0x01 // RO : DEVICEID[15:8]
//#define DEVREV 0x02 // RO : DEVREV[3:0]
#define PLL1 0x03 // PLL_K[7:0] : Default = 0b00100001
#define PLL2 0x04 // PLL_K[15:8] : Default = 0b11111101
#define PLL3 0x05 // PLL_K[21:16] : Default = 0b00110110
#define PLL4 0x06 // PLL_N[3:0], PLL Pre-scale Divider, SPDIF TX Validity SubFrame 0&1, SPDIF TX Validity OverWrite Mode : Default = 0b00000111
#define PLL5 0x07 // PLL Post-scale Divider[FREQMODE], Integer/Fractional Mode, MCLK Divider, CLKOUT Divider : Default = 0b00010110
#define PLL6 0x08 // SPDIF RX Selector[2:0]; CLKOUT Source Select, Fill Mode, INVALID flag, MCLK Output Source Select : Default = 0b00011000
#define SPDMODE 0x09 // SPDIF Input Mode Select (0 = CMOS ; 1 = 0.5Vpp) : Default = 0xFF (all 0.5Vpp ie S/PDIF)
#define INTMASK 0x0A // Interrupt Mask Enable : If 1 (MASKED) -> No updt of Error Register & no interrupt : Default = 0x00 (all unmasked)
#define INTSTAT 0x0B // RO : Interrupt Status
#define SPDSTAT 0x0C // RO : S/PDIF Status : REC_FREQ (Recovered frequency) --> Bits[5:4] : 0b00110000
#define RXCHAN1 0x0D // RO : RX Channel Infos 1
// #define RXCHAN2 0x0E // RO : RX Channel Infos 2    USELESS
// #define RXCHAN3 0x0F // RO : RX Channel Infos 3    USELESS
// #define RXCHAN4 0x10 // RO : RX Channel Infos 4    USELESS
#define RXCHAN5 0x11 // RO : RX Channel Infos 5 : MAX Audio Sample Word Lenght [0], Audio Sample Word Lenght[3:1], Original Sampling Frequency[7:4]
#define SPDTX1 0x12 // Param/Infos of Transmited S/PDIF : Default = 0x00 -> Consumer & PCM & Copyright & No-Preemphasis
#define SPDTX2 0x13 // Category Code of Transmited S/PDIF : Default = 0x00 -> General mode
#define SPDTX3 0x14 // Param/Infos of Transmited S/PDIF : Default = 0x00 -> No channel number on Subframe 1&2
#define SPDTX4 0x15 // Param/Infos of Transmited S/PDIF : Default = 0b01110001 -> If SPDIF Receive (not AIF) : 0b00110001
#define SPDTX5 0x16 // Param/Infos of Transmited S/PDIF : Default = 0b00001011 -> Max word length 24Bits
#define GPO01 0x17 // Flags available on GPO 1 & 0 : Default = 0b01110000
#define GPO23 0x18 // Flags available on GPO 3 & 2 : Default = 0b01010111
#define GPO45 0x19 // Flags available on GPO 5 & 4 : Default = 0b00110110
#define GPO67 0x1A // Flags available on GPO 7 & 6 : Default = 0b01000010
#define AIFTX 0x1B // AIF transmitter params : Default = 0b00000110 -> I2S, 20Bits, Normal BCLK & LRCLK -> If 24Bits = 0b00001110
#define AIFRX 0x1C // AIF receiver params : Default = 0b00000110 -> I2S, 20Bits, Normal BCLK & LRCLK, Slave mode -> If 24Bits = 0b00001110
#define SPDRX1 0x1D // SPDIF Receiver Params : Default = 0b10000000 -> Interrupt Status Register, RX4-7 SPDIF Inputs, Max Freq 192KHz
#define PWRDN 0x1E // Power down : Default = 0b00000111 -> PLL=0, SPDRX=0, SPDTX=0, OSC=1, AIF=1, Ouputs not tri stated
//                  If SPDRX&TX=1 & AIF=0 -> 0b00010001

// TXSRC = B6 SPDTX4(0x15) -> Set to 0 define S/PDIF receiver & SPDIFTXCLK Source = CLK2 


/* WM8805 First test 
 * 
 * PLL Enabled
 * S/PDIF Receiver and Transmiter Enabled
 * Oscillator section Power up
 * Digital Audio Interface Disabled
 * Outputs are not tri-stated
 */
 

void setup() {
  Serial.begin(9600);  // start serial communication with parametrable Baud rate
  Wire.begin(); // join i2c bus (address optional for master mode)
}


void loop() {
  
  int T1 = 0b00000011; // If 1: 0.5V Input ; If 0 : CMMOS Input    Ordered : RX7 RX6 RX5 RX4 RX3 RX2 RX1 RX0 
  Wire.beginTransmission(WM8805_I2C); // Transmit to device #58 (0x3A)
  Wire.write(SPDMODE); // SPDMODE register
  Wire.write(T1); // 
  Wire.endTransmission(); // Stop transmition when (1) or () ; Restart when (0)

 delay(10);

 //Default:0b10000000
  int A1 = 0b10000000; // RX4..7 Config ;    192kHz Not Supported, if supported --> default : 0b10000000 !!! 
  Wire.beginTransmission(WM8805_I2C); // Transmit to device #58 (0x3A)
  Wire.write(SPDRX1); // SPDRX1 register
  Wire.write(A1); // 
  Wire.endTransmission(); // Stop transmition when (1) or () ; Restart when (0)
    
  delay(10);

  int P6 = 0b00011000; // MCLKSRC[7] ; CLKOUTDIS[4] ; CLKOUTSRC[3] ; RXINSEL[2:0] --> RX0 ; CLKOUT = OSCCLK ;     RXINSEL : 000 : RX0    When GPOs as Inputs 100 : RX4
  Wire.beginTransmission(WM8805_I2C); // Transmit to device #58 (0x3A)                                                      001 : RX1                        101 : RX5
  Wire.write(PLL6); // PLL6  register                                                                                       010 : RX2                        110 : RX6
  Wire.write(P6); //                                                                                                        011 : RX3                        111 : RX7
  Wire.endTransmission(); // Stop transmition when (1) or () ; Restart when (0)

  delay(10);

  int T2 = 0b00110001; //
  Wire.beginTransmission(WM8805_I2C); // Transmit to device #58 (0x3A)
  Wire.write(SPDTX4); // SPDTX4 register SPDIF Receive (not AIF)
  Wire.write(T2); // 
  Wire.endTransmission(); // Stop transmition when (1) or () ; Restart when (0)
  
  delay(10);
  
  int T3 = 0b00001011; // Max word length(=1) = 24bits & TXWL(=101) = 24bits
  Wire.beginTransmission(WM8805_I2C); // Transmit to device #58 (0x3A)
  Wire.write(SPDTX5); // SPDTX5 register
  Wire.write(T3); // 
  Wire.endTransmission(); // Stop transmition when (1) or () ; Restart when (0)
  
  delay(10);
  
  int PD1 = 0b00010000; // Outputs not tri stated, AIF Disabled, OSC Power Up, SPDRX&TX Enabled, PLL Enabled
  Wire.beginTransmission(WM8805_I2C); // Transmit to device #58 (0x3A)
  Wire.write(PWRDN); // Power Down  register
  Wire.write(PD1); // 
  Wire.endTransmission(); // Stop transmition when (1) or () ; Restart when (0)
  
  delay(100);
}
And direct Arduino sketch : WM8805_Communication_Forum - Download - 4shared


Regards,
SB


NB : I wanted to insert images directly (with [IMG] tag), but pictures were too big. What is the maximum size of images for this forum to re-size them ?
  Reply With Quote
Old 26th April 2013, 10:36 AM   #5
diyAudio Member
 
Join Date: Mar 2012
Sorry for douple post, i didn't find how to edit a message...

BreadBoard with Software Mode setup :
Click the image to open in full size.


BreadBoard with Hardware mode setup :
Click the image to open in full size.

And another always in HardWare mode :
Click the image to open in full size.

Regards,
SB
  Reply With Quote
Old 26th April 2013, 11:52 AM   #6
diyAudio Member
 
Join Date: Aug 2010
mmh, might be a problem with your breadboard setup and the corresponding grounding scheme.
You are dealing with quite high frequency signals in the digital domain. For SPDIF you have arround 3MHz for 48kHz and 6MHz for 96kHz.
Pin9 will output an unlock flag in hardware mode. Here you can see if the PLL was unable to log on the signal.
In hardware mode the chrystal frequency has to be exactly 12MHz in software mode while in software mode it can be 10-14MHz. This might explain the differences in your setup between HW and SW mode.
  Reply With Quote
Old 26th April 2013, 03:18 PM   #7
diyAudio Member
 
Join Date: Mar 2012
Thanks for reply.

On the BreadBoard, I know the ground layout is very ugly. But I made a dedicated pcb for the chip (above in green on the pictures) with a ground plane, and the problem was the same.

For the crystal, either in software and Hardware mode, i used a (certainly Cheap) 12MHz xtal.

I've two big doubts :
- the first on that using an adapter board (SSOP to DIP) for the WM8805. Did someone already use it successfully for prototyping ?

-The second on the ugly coaxial sockets for reception (the most critical i think) and transmission with "long" wires that may act as antennas. Is it possible that the problem might come from them ?

Thanking you in advance.
SB
  Reply With Quote
Old 30th April 2013, 08:55 AM   #8
diyAudio Member
 
Join Date: Mar 2012
Hi,

Problem solved, it works even in 192kHz !

Solution?

An interface SPDIF to TTL with WM's inputs configured in TTL.

The higher the frequency, the lower the signal's level WM input.
So I added a logic buffer (hex inverter [HC, HCV, AHC, ...]) and it works fine now.

Unfortunately, I don't think this conversion stage is essential, but without, on the breadboard and the dedicated PCB, it doesn't work!

SB
  Reply With Quote
Old 2nd May 2013, 10:33 AM   #9
diyAudio Member
 
Join Date: Mar 2012
Hi Everyone !

I'm trying to improve the sketch to display the Sample frequency in the serial monitor.
This Arduino sketch is just used to get information on Frequency from the WM8805 in 4 different registers :

- bit7 of the Interrupt Status Register (INTSTAT) : an Update Signal of the Recovery Frequency (UPD_REC_FREQ). Just an Interrupt

- bit[5..4] of the SPDIF Status Register (SPDSTAT: the Recovery Frequency (REC_FREQ)

- bit [3..0] of the Channel Status Register 4 (RXCHAN4) : the Sampling Frequency (FREQ)

- bit [7..4] of the Channel Status Register 5 (RXCHAN5) : the Original Sampling Frequency (ORGSAMP)


I Must write in the SPDRX1 Register which Interrupt Status Register is to be Read Back (Page 63 of WM's Datasheet).


The problem is: The FREQ & ORGSAMP bits don't want to update and remain locked on the default value (ie 0001 & 0000, ie "Not indicated" from IEC 60958-3 International Standard" paper p.12 & p.13)

and i don't know why...

Here is the simplified Sketch :
Code:
#include <Wire.h>

#define WM8805_I2C 0x3A   // Adress WM8805 I2C hexa 7bits [0x3A or 58 or 0b0111010]


#define PLL4 0x06 // PLL_N[3:0], PLL Pre-scale Divider, SPDIF TX Validity SubFrame 0&1, SPDIF TX Validity OverWrite Mode : Default = 0b00000111
#define PLL6 0x08 // SPDIF RX Selector[2:0]; CLKOUT Source Select, Fill Mode, INVALID flag, MCLK Output Source Select : Default = 0b00011000
#define SPDMODE 0x09 // SPDIF Input Mode Select (0 = CMOS ; 1 = 0.5Vpp) : Default = 0xFF (all 0.5Vpp ie S/PDIF)
#define INTMASK 0x0A // Interrupt Mask Enable : If 1 (MASKED) -> No updt of Error Register & no interrupt : Default = 0x00 (all unmasked)
#define INTSTAT 0x0B // RO : Interrupt Status
#define SPDSTAT 0x0C // RO : S/PDIF Status : REC_FREQ (Recovered frequency) --> Bits[5:4] : 0b00110000
#define RXCHAN1 0x0D // RO : RX Channel Infos 1
#define RXCHAN2 0x0E // RO : RX Channel Infos 2    USELESS
#define RXCHAN3 0x0F // RO : RX Channel Infos 3    USELESS
#define RXCHAN4 0x10 // RO : RX Channel Infos 4   CLKACU[5:4]   Sampling Frequency[3:0]
#define RXCHAN5 0x11 // RO : RX Channel Infos 5 : MAX Audio Sample Word Lenght [0], Audio Sample Word Lenght[3:1], Original Sampling Frequency[7:4]

#define SPDRX1 0x1D // SPDIF Receiver Params : Default = 0b10000000 -> Interrupt Status Register, RX4-7 SPDIF Inputs, Max Freq 192KHz
#define PWRDN 0x1E // Power down : Default = 0b00000111 -> PLL=0, SPDRX=0, SPDTX=0, OSC=1, AIF=1, Ouputs not tri stated
// If SPDRX&TX=1 & AIF=0 -> 0b00010001



//--------- Declaration of Recovered Frequency Values using strings & pointers --> Use of Characters for rec freq !
// char* recfreq[]={"192kHz", "176.4kHz", "96kHz", "88.2kHz", "48kHz", "44.1kHz", "32kHz", "ERROR"};

int INTSTAT_Val = 0;
int SPDSTAT_Val = 0;
int RXCHAN4_Val = 0;
int RXCHAN5_Val = 0;



void setup() {
  Serial.begin(9600);  // start serial communication with parametrable Baud rate
  Wire.begin(); // join i2c bus (address optional for master mode)
  Serial.println("Initialisation...");
  INIT_WM();
  Serial.println("Successfully !"); 
}


//-------------- SPDIF Statut Register --> REC_FREQ : 00 = 192kHz || 01 = 96..88.2kHz || 10 = 48..44.1kHz || 00 = 32kHz


void loop() {
  
  //SPDRX1 Default Settings : 0b10000000 -> 192kHz, No Truncation Mask, RX4-7 Inputs, 'With Flags' Mode OFF, No Continuous ReadBack, bits[2..0] Interrupt Status Register Select
  
  int AA = 0b10000110; // For reading Interrupt Status Register to get bit7 = UPD_REC_FREQ (REC_FREQ Updated Signal)
  writeI2C(SPDRX1, AA); // SPDRX1 register
  
  getINTSTAT(); // Read from WM the complete SPDIF Status Register        return INTSTAT_Val
  int maska = 0b10000000; // To get UPD_REC_FREQ Bit (bit 7) REC_FREQ Update Signal
  Serial.print("INTSTATE -> UPD_REC_FREQ = "); Serial.println(INTSTAT_Val);// && maska);
  
  delay(10);
  
  int BB = 0b10000110; // For reading SPDIF Status Register to get Recovered Sampling Frequency
  writeI2C(SPDRX1, BB); // SPDRX1 register
  
  getSPDSTAT(); // Read from WM the complete SPDIF Status Register        return SPDSTAT_Val
  int maskb = 0b00110000; // To get REC_FREQ Bits (bit [5..4]) Recovered Frequency Flag
  Serial.print("SPDSTAT -> REC_FREQ = "); Serial.println(SPDSTAT_Val);// && maskb);
  
  delay(10);
  
  int CC = 0b10000100; // For reading Channel Status Register 4 (RXCHAN4) to get Sampling Frequency
  writeI2C(SPDRX1, CC); // SPDRX1 register
  
  getRXCHAN4(); // Read from WM the complete RX Channel Informations 4    return RXCHAN4_Val
  int maskc = 0b00001111; // To get FREQ Bits (bit [3..0]) Sampling Frequency
  Serial.print("RXCHAN4 -> FREQ = "); Serial.println(RXCHAN4_Val);// && maskc);
  
  delay(10);
  
  int DD = 0b10000101; // For reading Channel Status Register 5 (RXCHAN5) to get Original Sampling Frequency
  writeI2C(SPDRX1, DD); // SPDRX1 register
  
  getRXCHAN5(); // Read from WM the complete RX Channel Informations 5    return RXCHAN5_Val
  int maskd = 0b11110000; // To get ORGSAMP Bits (bit [7..4]) Original Sampling Frequency
  Serial.print("RXCHAN5 -> ORGSAMP = "); Serial.println(RXCHAN5_Val);// && maskd);   
    
  delay(1000);
}


/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DEFINITION OF FUNCTIONS HERE ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/


//------------------------------------------------------------------------------------------ Setup initialisation for WM8805
  void INIT_WM () {
    int a = 0b00000000; // If 1: 0.5V Input ; If 0 : CMOS Input    Ordered : RX7 RX6 RX5 RX4 RX3 RX2 RX1 RX0 
    writeI2C(SPDMODE, a);
      
    delay(10);
    
    int b = 0b00011001; // MCLKSRC[7] ; CLKOUTDIS[4] ; CLKOUTSRC[3] ; RXINSEL[2:0] --> RX0 ; CLKOUT = OSCCLK ;     RXINSEL : 000 : RX0    When GPOs as Inputs 100 : RX4
    writeI2C(PLL6, b);//                                                                                                     001 : RX1                        101 : RX5
    //                                                                                                                       010 : RX2                        110 : RX6
    //                                                                                                                       011 : RX3                        111 : RX7
    
    delay(10);
    
    int c = 0b00010000; // Outputs not tri stated, AIF Disabled, OSC Power Up, SPDRX&TX Enabled, PLL Enabled 
    writeI2C(PWRDN, c); // Power Down  register
    
    delay(100);
  }
 


//------------------------------------------------------------------------------------------ Read Interrrupts States, S/PDIF Status Bit & Channel Status Data
  
  void getINTSTAT () {
  byte readINTSTAT;
  readINTSTAT = readI2C(INTSTAT); // Read SPDSTAT Register (0x0C) to get Recovered Frequency bits[5..4]
  INTSTAT_Val = readINTSTAT;
}
  
  void getSPDSTAT () {
  byte readSPDSTAT;
  readSPDSTAT = readI2C(SPDSTAT); // Read SPDSTAT Register (0x0C) to get Recovered Frequency bits[5..4]
  SPDSTAT_Val = readSPDSTAT;
}

void getRXCHAN4 () {
  byte readRXCHAN4;
  readRXCHAN4 = readI2C(RXCHAN4); // Read SPDSTAT Register (0x0C) to get Recovered Frequency bits[5..4]
  RXCHAN4_Val = readRXCHAN4;
}

void getRXCHAN5 () {
  byte readRXCHAN5;
  readRXCHAN5 = readI2C(RXCHAN5); // Read SPDSTAT Register (0x0C) to get Recovered Frequency bits[5..4]
  RXCHAN5_Val = readRXCHAN5;
}



//------------------------------------------------------------------------------------------ Functions for Read & Write I2C routine in Arduino sketches ! Verifed !
int readI2C (byte regAddr) { // With regAddr the address of register you want to read. Use of "int" instead of "void" cause function return result
  Wire.beginTransmission(WM8805_I2C);
  Wire.write(regAddr);                // Register address to read
  Wire.endTransmission();             // Terminate request
  Wire.requestFrom(WM8805_I2C, 1);          // Read a byte
  while(!Wire.available()) { 
  };       // Wait for receipt
  return(Wire.read());                // Get result
}

void writeI2C (byte regAddr, byte val) { // With "regAddr" the address of register you want to write and "val" the byte to transmit 
  Wire.beginTransmission(WM8805_I2C);
  Wire.write(regAddr);
  Wire.write(val);
  Wire.endTransmission();
}
And direct download link : Arduino sketch here


Hope Someone has already get Sampling Frequency from WM8805 and will be able to help me !

Thanking you in advance,

SB
  Reply With Quote
Old 11th July 2013, 11:01 PM   #10
xslavic is offline xslavic  Moldova
diyAudio Member
 
Join Date: Feb 2011
nice job,but did it locked on 192khz in hardware mode ?it shouldn't have problems ,i see many DAC ers use the second crystal for it but dont know if it helps or the contrary
  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
WM8805 doesn't work with TDA1543 in hardware mode? xiedidan Digital Line Level 6 29th September 2012 07:50 AM
Sony CXD2500 S/PDIF problems cheater Digital Source 1 14th August 2004 05:42 PM
96Khz problems MWP Digital Source 9 21st March 2004 02:51 PM
Looking for S/PDIF software specs Solid Snake Digital Source 3 20th September 2003 12:43 AM
a/d converter 24bit 96khz s/pdif recording JBL Digital Source 1 10th January 2003 11:58 PM


New To Site? Need Help?

All times are GMT. The time now is 06:39 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