Get current Sample Rate

Hi,

Is there anyway to read the current sample rate of Tone 1 and/or Tone 2?

I mean, using Arduino for example (serial comm, I2C, etc)

It’s creating a custom display function.

Thank you.

Hi Mr_Kholl,
Tone2 could sent the sample rate to J11, J10 and J1 through UART, this info you will be interesting.

  • Tone2 UART data flow:


    As show above, the sample data from XMOS to CPLD(as a data route), and sent to STM8 at the end, please notic the green font. The STM8 will display the sample and notify this sample info to the XMOS, J11, J10, J1 after receive the sample from XMOS, please notic the red font.
    so, you could choose J11, J10 or J1 for a sample data input. more detail please check the Tone2 sch & slik


  • Tone2 UART instructions description
    The sample data will be display one code for pcm44.1 and pcm48, the same as the pcm88.2 and pcm 96. this info you can check tone2-uart-instructions-description

  • How to get more detailed sampling rate information
    As the Tone2 project already opensource, you could modify the XMOS firmware to get more samoling rate info. more info could check here
    you could modify audiohw.xc to show more sample info.

void AudioHwConfig(unsigned samFreq, unsigned mClk, chanend ?c_codec, unsigned dsdMode,unsigned sampRes_DAC, unsigned sampRes_ADC)
{
        if ( (samFreq == 44100) || (samFreq == 48000) )
        {
            if (sys_first_time_to_run == 1)
            {
	            transmitter(0x4B);
	            transmitter(0x40);
	            transmitter(0x01);
	            transmitter(0x73);
            }
        }
        else if( (samFreq == 88200) || (samFreq == 96000) )
        {
            transmitter(0x4B);
            transmitter(0x40);
            transmitter(0x02);
            transmitter(0x73);
        }
        else if( (samFreq == 176400) || (samFreq == 192000) )
        {
            transmitter(0x4B);
            transmitter(0x40);
            transmitter(0x03);
            transmitter(0x73);
        }
        else if ( (samFreq == 352800) || (samFreq == 384000) )
        {
            transmitter(0x4B);
            transmitter(0x40);
            transmitter(0x04);
            transmitter(0x73);
#if 1
        }
        else if ( (samFreq == 705600) || (samFreq == 768000) )
        {
            transmitter(0x4B);
            transmitter(0x40);
            transmitter(0x05);
            transmitter(0x73);
#endif
        }
}

please enjoy :stuck_out_tongue_winking_eye:

1 Like

Awesome Kenny!

Gonna try!

Thank you very much!