PCM1863: How to read if there is audio at the input or not?

Part Number: PCM1863

Tool/software:

Hi Experts,

My customer would like to read the register to check if there is audio signal at the input ( VINL2/VINR2" or "VINL1/VINR1")

or not, can you share how to do it ? thanks!

  • Hi PYTsai,

    Detection of an audio signal is supported in this device and the algorithm is called Energysense. The instructions for configuring this function start in section 9.3.11 of the datasheet and include steps and i2c scripts for easy implementation

    9.3.15 is where the steps for implementation are listed.

    Regards,

  • Hi Daveon 

    Customer steps are as follows, It still reads to 0x00. Can you help suggest what might went wrong? thanks!

     

     Read 0x61 >> found that they are all 0x00

    1. Then write 0x00 to 0x60 >>> close int
    2. At this time, the aux signal is input by VINL2/VINR2
    3. Read 0X32 again. It was expected that which channel has input should be informed of "SIGDET_DC_LEVEL_CH 2_L" "SIGDET_DC_LEVEL_CH 2_R" and then read 0x48 and 0x4B >> but it is still 0x00
    4. If I am really told to read 0x48 and 0x4B at this time, what should I do after reading?
    5. Then write 0x07 to 0x60 >>> turn on int
  • Can you provide a register dump?

  • Hi Douglas,

    The audio input is from pin 1 and 2 

    And below is customer's device initialization table 

    static uint8_t pcm_registers_AUX[] =.
    {
    0x00, 0x00 ,
    0x01, 0x00 ,
    0x02, 0x00 ,
    0x03, 0x00 ,
    0x04, 0x00 ,
    0x05, 0x86 ,
    0x06, 0x42 ,//ADC1 set VINL1 + VINL2
    0x07, 0x42 ,//ADC1 set VINR3 + VINR4
    0x08, 0x42 ,//ADC2 set VINL2
    0x09, 0x42 ,//ADC2 set VINR2
    0x0a, 0x00 ,
    0x0b, 0x44 ,
    0x0c, 0x00 ,
    0x0d, 0x00 ,
    0x0e, 0x00 ,
    0x0f, 0x00 ,
    0x10, 0x01 ,
    0x11, 0x20 ,
    0x12, 0x00 ,
    0x13, 0x00 ,
    0x14, 0x00 ,
    0x15, 0x00 ,
    0x16, 0x00 ,
    0x17, 0x00 ,
    0x18, 0x00 ,
    0x19, 0x00 ,
    0x1a, 0x00 ,
    0x1b, 0x00 ,
    0x1c, 0x00 ,
    0x1d, 0x00 ,
    0x1e, 0x00 ,
    0x1f, 0x00 ,
    0x20, 0x01 ,
    0x21, 0x00 ,
    0x22, 0x00 ,
    0x23, 0x01 ,
    0x24, 0x50 ,
    0x25, 0x07 ,
    0x26, 0x03 ,
    0x27, 0x3f ,
    0x28, 0x11 ,
    0x29, 0x01 ,
    0x2a, 0x01 ,
    0x2b, 0x08 ,
    0x2c, 0x00 ,
    0x2d, 0x00 ,
    0x2e, 0x00 ,
    0x2f, 0x00 ,
    0x30, 0x00 ,
    0x31, 0x00 ,
    0x32, 0x00 ,
    0x33, 0x01 ,
    0x34, 0x00 ,
    0x35, 0x00 ,
    0x36, 0x01 ,
    0x37, 0x00 ,
    0x38, 0x00 ,
    0x39, 0x00 ,
    0x3a, 0x00 ,
    0x3b, 0x00 ,
    0x3c, 0x00 ,
    0x3d, 0x00 ,
    0x3e, 0x00 ,
    0x3f, 0x00 ,
    0x40, 0x80 ,
    0x41, 0x7f ,
    0x42, 0x00 ,
    0x43, 0x80 ,
    0x44, 0x7f ,
    0x45, 0x00 ,
    0x46, 0x80 ,
    0x47, 0x7f ,
    0x48, 0x00 ,
    0x49, 0x80 ,
    0x4a, 0x7f ,
    0x4b, 0x00 ,
    0x4c, 0x80 ,
    0x4d, 0x7f ,
    0x4e, 0x00 ,
    0x4f, 0x80 ,
    0x50, 0x7f ,
    0x51, 0x00 ,
    0x52, 0x80 ,
    0x53, 0x7f ,
    0x54, 0x00 ,
    0x55, 0x80 ,
    0x56, 0x7f ,
    0x57, 0x00 ,
    0x58, 0x00 ,
    0x59, 0x00 ,
    0x5a, 0x00 ,
    0x5b, 0x00 ,
    0x5c, 0x00 ,
    0x5d, 0x00 ,
    0x5e, 0x00 ,
    0x5f, 0x00 ,
    0x60, 0x11 ,
    0x61, 0x00 ,
    0x62, 0x10 ,
    0x63, 0x00 ,
    0x64, 0x00 ,
    0x65, 0x00 ,
    0x66, 0x00 ,
    0x67, 0x00 ,
    0x68, 0x00 ,
    0x69, 0x00 ,
    0x6a, 0x00 ,
    0x6b, 0x00 ,
    0x6c, 0x00 ,
    0x6d, 0x00 ,
    0x6e, 0x00 ,
    0x6f, 0x00 ,
    0x70, 0x70 ,
    0x71, 0x10 ,
    0x72, 0x0f ,
    0x73, 0x03 ,
    0x74, 0x32 ,
    0x75, 0x00 ,
    0x76, 0x01 ,
    0x77, 0x4c ,
    0x78, 0x07 ,
    0x79, 0x00 ,
    0x7a, 0x00 ,
    0x7b, 0x00 ,
    0x7c, 0x00 ,
    0x7d, 0x00 ,
    0x7e, 0x00 ,
    0x7f, 0x00 ,
    0x00, 0x01 ,
    0x01, 0x00 ,
    0x02, 0x2d ,
    0x03, 0x00 ,
    0x04, 0x00 ,
    0x05, 0x00 ,
    0x06, 0x00 ,
    0x07, 0x00 ,
    0x08, 0x00 ,
    0x09, 0x3a ,
    0x0a, 0x45 ,
    0x0b, 0x00 ,
    0x0c, 0x00 ,
    0x0d, 0x00 ,
    0x0e, 0x00 ,
    0x0f, 0x00 ,
    };

    After device initialization, customer do threshold setting as below 

    void PCM1863_Threshold(void)

    {

    BYTE ttt;

     

    //Signal Loss Threshold Level -40DB

    ttt=0x01;

    PCM1863_I2C_Write(0x00,1,&ttt);

    ttt=0x2c;

    PCM1863_I2C_Write(0x02,1,&ttt);

     

    ttt=0x01;

    PCM1863_I2C_Write(0x04,1,&ttt);

    ttt=0x47;

    PCM1863_I2C_Write(0x05,1,&ttt);

    ttt=0xAE;

    PCM1863_I2C_Write(0x06,1,&ttt);

     

    ttt=0x01;

    PCM1863_I2C_Write(0x01,1,&ttt);

    Delay_10ms(5);

     

    //Signal Detect Threshold Level -38DB

    ttt=0x01;

    PCM1863_I2C_Write(0x00,1,&ttt);

    ttt=0x2D;

    PCM1863_I2C_Write(0x02,1,&ttt);

     

    ttt=0x01;

    PCM1863_I2C_Write(0x04,1,&ttt);

    ttt=0x9C;

    PCM1863_I2C_Write(0x05,1,&ttt);

    ttt=0x86;

    PCM1863_I2C_Write(0x06,1,&ttt);

     

    ttt=0x01;

    PCM1863_I2C_Write(0x01,1,&ttt);

    Delay_10ms(5);

    }

    then they begin to polling the register 0x32 as below 

    .

    .

    while(1)

    {

    system_every_5s_check()

    {

    PCM1863_I2C_Read(0x32,1,Aux_detect); 

    }

     

    }

     

  • Hi, 

    First, in your tests, make sure you are playing a ~1kHz signal at a greater volume than -57 dBFS (or the set threshold level) for the energysense to detect it.

    Next, I see in section 9.3.15.2.2 of the datasheet that the INT_STAT register (page 0 0x61) is sticky when audio crosses the threshold, while SIGDET_STAT (page 0 0x32) is not sticky, so it will only trigger high for 1 ms every second by the default values. You should poll INT_STAT instead. Also, the energysense detect will only trigger if the device is in sleep mode first. Make sure you set it to sleep mode before playing your test signal. To do this, you can either stop your clock signals or use the PWRDN_CTRL (page 0 0x70) to set the device to sleep mode.

    Let me know if you need more help.

    Best,
    Mir Jeffres