i2s example strange behavior

__vnv__
Posts: 17
Joined: Sat Feb 16, 2019 9:42 pm

i2s example strange behavior

Postby __vnv__ » Sat Feb 16, 2019 11:13 pm

Hello everyone,

trying to use example i2s_example_main.c (from peripheral->i2s) it give me headache.

I am trying to figure out example code but some things don't make sense at all.
I am using ESP32-WROVER-KIT with PCM5102 (www.diymore.cc board) and compiling by default all works.
Inside the code it says:

Complete example: https://github.com/espressif/esp-idf/bl ... ple_main.c

Code: Select all


    i2s_driver_install(I2S_NUM, &i2s_config, 0, NULL);
    i2s_set_pin(I2S_NUM, &pin_config);

    int test_bits = 16;
   
    while (1) {  
        setup_triangle_sine_waves(test_bits);
        vTaskDelay(5000/portTICK_RATE_MS);
        test_bits += 8;
        if(test_bits > 32)
           test_bits = 16;

    }

}
I have changed it to:

Code: Select all


    i2s_driver_install(I2S_NUM, &i2s_config, 0, NULL);
    i2s_set_pin(I2S_NUM, &pin_config);

    int test_bits = 16;
   setup_triangle_sine_waves(test_bits);
   
    while (1) {          
        vTaskDelay(5000/portTICK_RATE_MS);
    }

}
And looking it on scope it looks broken, but putting test_bits=24 and test_bits=32 it works fine.
How does it work with 16 by default but hard coding it doesn't work with 16.

Also, how it is possible that PCM5102 generates signal and my scope can read it and while(1) doesn't contain any code?
How is this possible, there is no more calls to setup_triangle_sine_waves so also no more calls to i2s_write??

Tnx in advance!

Who is online

Users browsing this forum: No registered users and 121 guests