Hi All,
We've spun a custom version of the microphone array and for layout reasons moved the PDM microphone inputs to Tile 1. We're not getting the data into the processing, however. On the board it looks like clocks and data are moving as they should (based on oscilloscope measures), but the output from the software decimators is low level noise, unresponsive to changes at the microphone input.
Has anyone successfully used the mic array library software (PDM to PCM part) with PDM data coming on pins different from the original design from XMOS?
Thanks,
Bill
custom microphone array Topic is solved
-
- Experienced Member
- Posts: 79
- Joined: Thu Nov 17, 2016 11:24 pm
-
Verified
- Experienced Member
- Posts: 117
- Joined: Fri Dec 11, 2009 10:22 am
So long as the microphones are connected to an 8 bit port and the decimators are configured correctly they will work. Have you configured the 8 bit port(with the mics) to be clocked off the PDM clock? i.e.
This needs to happen on tile[1]. Hope that helps.
Code: Select all
configure_clock_src_divide(pdmclk, p_mclk, 4);
configure_port_clock_output(p_pdm_clk, pdmclk);
configure_in_port(p_pdm_mics, pdmclk);
start_clock(pdmclk);
-
- Experienced Member
- Posts: 79
- Joined: Thu Nov 17, 2016 11:24 pm
Hi Andrew,
Thanks for responding. We're pretty sure we've done everything correctly, essentially copying the original code and changing the port specification and running the code on the other tile. Below I show Original and Modified comparisons. As you allude, the process should be very simple.
On our board I can see that the PDM clock and data signals are active. I unfortunately cannot assess the PDM data signal outside of the XMOS chip as I don't have the proper equipment. I also cannot look into the decimator as I have no understanding of the assembly language in which it is written.
In our code the first time we "see" the mic data is at the output of a mic_array_get_next_frequency_domain_frame() call. At this point the data looks independent of the signal we actually play from a loudspeaker.
Could you please check the brief, original/modified comparison below, and if seeing nothing suspicious suggest a way to debug this issue from the software side?
In the meantime I will try other software access to the decimator output and see what I can see.
Thanks for any help you can offer.
cheers,
Bill
Original
//Ports for the PDM microphones
on tile[0]: clock pdmclk = XS1_CLKBLK_1;
on tile[0]: in port p_pdm_clk = XS1_PORT_1E;
on tile[0]: in port p_mclk = XS1_PORT_1F;
on tile[0]: in buffered port:32 p_pdm_mics = XS1_PORT_8B;
Modified
//Ports for the PDM microphones
on tile[1]: clock pdmclk = XS1_CLKBLK_1;
on tile[1]: in port p_pdm_clk = XS1_PORT_1A; // 3.072 MHz
on tile[1]: in port p_mclk = XS1_PORT_1B; // 25 MHz
on tile[1]: in buffered port:32 p_pdm_mics = XS1_PORT_8A; // mic data
Original
on tile[0]: {
configure_clock_src_divide(pdmclk, p_mclk, 4);
configure_port_clock_output(p_pdm_clk, pdmclk);
configure_in_port(p_pdm_mics, pdmclk);
start_clock(pdmclk);
par {
mic_array_pdm_rx(p_pdm_mics, c_4x_pdm_mic_0, c_4x_pdm_mic_1);
mic_array_decimate_to_pcm_4ch(c_4x_pdm_mic_0, c_ds_output[0], MIC_ARRAY_NO_INTERNAL_CHANS);
mic_array_decimate_to_pcm_4ch(c_4x_pdm_mic_1, c_ds_output[1], MIC_ARRAY_NO_INTERNAL_CHANS);
etc.
Modified
on tile[1]: {
configure_clock_src_divide(pdmclk, p_mclk, 4); // lib_i2s/src/i2s_frame_master_impl.h: configure_clock_src_divide(bclk, p_mclk, mclk_bclk_ratio >> 1);
configure_port_clock_output(p_pdm_clk, pdmclk); // lib_i2s/src/i2s_frame_master_impl.h: configure_port_clock_output(p_bclk, bclk);
configure_in_port(p_pdm_mics, pdmclk); // configures the input port p_pdm_mics to be clocked by the clock pdmclk.
start_clock(pdmclk);
par {
mic_array_pdm_rx(p_pdm_mics, c_4x_pdm_mic_0, c_4x_pdm_mic_1);
mic_array_decimate_to_pcm_4ch(c_4x_pdm_mic_0, c_ds_output[0], MIC_ARRAY_NO_INTERNAL_CHANS);
mic_array_decimate_to_pcm_4ch(c_4x_pdm_mic_1, c_ds_output[1], MIC_ARRAY_NO_INTERNAL_CHANS);
etc.
Thanks for responding. We're pretty sure we've done everything correctly, essentially copying the original code and changing the port specification and running the code on the other tile. Below I show Original and Modified comparisons. As you allude, the process should be very simple.
On our board I can see that the PDM clock and data signals are active. I unfortunately cannot assess the PDM data signal outside of the XMOS chip as I don't have the proper equipment. I also cannot look into the decimator as I have no understanding of the assembly language in which it is written.
In our code the first time we "see" the mic data is at the output of a mic_array_get_next_frequency_domain_frame() call. At this point the data looks independent of the signal we actually play from a loudspeaker.
Could you please check the brief, original/modified comparison below, and if seeing nothing suspicious suggest a way to debug this issue from the software side?
In the meantime I will try other software access to the decimator output and see what I can see.
Thanks for any help you can offer.
cheers,
Bill
Original
//Ports for the PDM microphones
on tile[0]: clock pdmclk = XS1_CLKBLK_1;
on tile[0]: in port p_pdm_clk = XS1_PORT_1E;
on tile[0]: in port p_mclk = XS1_PORT_1F;
on tile[0]: in buffered port:32 p_pdm_mics = XS1_PORT_8B;
Modified
//Ports for the PDM microphones
on tile[1]: clock pdmclk = XS1_CLKBLK_1;
on tile[1]: in port p_pdm_clk = XS1_PORT_1A; // 3.072 MHz
on tile[1]: in port p_mclk = XS1_PORT_1B; // 25 MHz
on tile[1]: in buffered port:32 p_pdm_mics = XS1_PORT_8A; // mic data
Original
on tile[0]: {
configure_clock_src_divide(pdmclk, p_mclk, 4);
configure_port_clock_output(p_pdm_clk, pdmclk);
configure_in_port(p_pdm_mics, pdmclk);
start_clock(pdmclk);
par {
mic_array_pdm_rx(p_pdm_mics, c_4x_pdm_mic_0, c_4x_pdm_mic_1);
mic_array_decimate_to_pcm_4ch(c_4x_pdm_mic_0, c_ds_output[0], MIC_ARRAY_NO_INTERNAL_CHANS);
mic_array_decimate_to_pcm_4ch(c_4x_pdm_mic_1, c_ds_output[1], MIC_ARRAY_NO_INTERNAL_CHANS);
etc.
Modified
on tile[1]: {
configure_clock_src_divide(pdmclk, p_mclk, 4); // lib_i2s/src/i2s_frame_master_impl.h: configure_clock_src_divide(bclk, p_mclk, mclk_bclk_ratio >> 1);
configure_port_clock_output(p_pdm_clk, pdmclk); // lib_i2s/src/i2s_frame_master_impl.h: configure_port_clock_output(p_bclk, bclk);
configure_in_port(p_pdm_mics, pdmclk); // configures the input port p_pdm_mics to be clocked by the clock pdmclk.
start_clock(pdmclk);
par {
mic_array_pdm_rx(p_pdm_mics, c_4x_pdm_mic_0, c_4x_pdm_mic_1);
mic_array_decimate_to_pcm_4ch(c_4x_pdm_mic_0, c_ds_output[0], MIC_ARRAY_NO_INTERNAL_CHANS);
mic_array_decimate_to_pcm_4ch(c_4x_pdm_mic_1, c_ds_output[1], MIC_ARRAY_NO_INTERNAL_CHANS);
etc.
-
- Experienced Member
- Posts: 79
- Joined: Thu Nov 17, 2016 11:24 pm
Hi All,
We found that our custom board microphone problem was due to a soldering issue with the mics. Upon more closely following the guidelines in the mics' data sheet we are now successfully getting data from them into the XMOS chip.
cheers,
Bill
We found that our custom board microphone problem was due to a soldering issue with the mics. Upon more closely following the guidelines in the mics' data sheet we are now successfully getting data from them into the XMOS chip.
cheers,
Bill