Waveshare wm8960 audio board not recognized by Giga I2C

Hi guys ,

It should be a super simple procedure. Connect +3v3, gnd, scl, sda and program the registers.
I did it with the esp32 wroom and the I2C and then the I2S worked perfectly.
However, the GIGA did not recognize the board.
I ran the i2c scanner and it found nothing.
I checked the wires and they are ok. SCL and SDA pins are OK.
I used the oscilloscope and the I2C signals reach the board.

https://www.waveshare.com/wm8960-audio-board.htm

Does anyone know why it is not recognized?

Thank you

Gibran

#include <SPI.h>
#include <Wire.h>
#include <SparkFun_WM8960_Arduino_Library.h>
#include <Arduino_AdvancedAnalog.h>

WM8960 codec;

// WS, CK, SDI, SDO, MCK
AdvancedI2S i2s(PG_10, PG_11, PG_9, PB_5, PC_4);

void setup()
{
  Serial.begin(115200);
  while (!Serial)
  {
  }
  delay(1500);
  Serial.println("Codec setup");
  codec_setup();

  if (!i2s.begin(AN_I2S_MODE_INOUT, 96000, 512, 32))
  {
    Serial.println("Failed to start I2S");
    while (1)
      ;
  }
  else
  {
    Serial.println("I2S ok");
  }
}

void loop()
{
  if (i2s.available())
  {
    SampleBuffer rxbuf = i2s.read();
    SampleBuffer txbuf = i2s.dequeue();
    for (size_t i = 0; i < rxbuf.size(); i++)
    {
      txbuf[i] = rxbuf[i];
    }
    rxbuf.release();
    i2s.write(txbuf);
    txbuf.release();
  }
}

void codec_setup()
{

  Wire.begin();

  if (codec.begin() == false)
  {
    Serial.println("Device not recognized.");
    while (1)
      ; 
  
  Serial.println("Codec connected");

  codec.enableVREF(); 
  codec.enableVMID(); 

  // DAC
  codec.enableDacLeft();
  codec.enableDacRight();
  codec.disableDacMute(); 
  codec.enableLD2LO();    
  codec.enableRD2RO();    

  // ADC
  codec.enableAdcLeft();
  codec.enableAdcRight();
  codec.setAdcLeftDigitalVolumeDB(0.0);
  codec.setAdcRightDigitalVolumeDB(0.0);

  // MIC
  codec.enableLMIC(); 
  codec.enableRMIC(); 
  codec.connectLMN1();    
  codec.connectRMN1();    
  codec.disableLINMUTE(); 
  codec.disableRINMUTE(); 
  codec.disableMicBias();
  codec.setLINVOLDB(0);                            
  codec.setRINVOLDB(0);                            
  codec.enableAINL();                              
  codec.enableAINR();                              
  codec.connectLMIC2B();                           
  codec.connectRMIC2B();                           
  codec.setLB2LOVOL(WM8960_OUTPUT_MIXER_GAIN_0DB); 
  codec.setRB2ROVOL(WM8960_OUTPUT_MIXER_GAIN_0DB); 
  codec.enableLOMIX();              
  codec.enableROMIX();              
  codec.enableOUT3MIX();            
  codec.enableHeadphones();         
  codec.setHeadphoneVolumeDB(6.00); 
  codec.disableLoopBack();          
  codec.disableMicBias();
  codec.enablePeripheralMode(); 
  codec.setWL(WM8960_WL_16BIT); 
}

Hi Gibran. Which I2C pins are you connecting to? The GIGA has 3 x I2C.

Hi Steve ,

pins 20 and 21.

Do you have the wm8960 VIN connected to the GIGA 5v?

the board has VCC, but it doesn't say if it's 3v3 or 5v. I used it connected to the 3v3 of the ESP32 and it worked, so I repeated the same on the giga. I used i 3v3

My mistake, I was looking at the sparkfun board as you are using their library. The VIN spec for your board is 3.3v.

Steve , I forgot too , there is an schematic of the board.

I modified the original board to add a "line in" connector to replace the original MIC.

Found the problem:

I opened the Sparkfun Library and commented the "sensor" lines !!!

It is alive!!!!!!

Thanks

boolean WM8960::begin(TwoWire &wirePort)
{
  	_i2cPort = &wirePort;
  	// if (isConnected() == false) // Check for sensor by verifying ACK response
    // 	return (false); 
    if (reset() == false) // Reset all registers to default values
      return (false); 
  	return (true); //We're all setup!
}

Good to hear