PDM-Mic to USB on xCore-200 explorer kit

If you have a simple question and just want an answer.
Post Reply
Bootucal
Member
Posts: 11
Joined: Thu Jan 03, 2019 12:06 pm

PDM-Mic to USB on xCore-200 explorer kit

Post by Bootucal »

I want to operate 16 pdm-microphones on the explorer-kit. The 16 audio-streams should be send to a windows-pc via usb. I dont want to do any signal processing on the explorer kit. I tried to programm that application but I cant get it running.
I tried two different ways facing different problems. Not shure wich way would be the best:

1. starting from scratch:
Setting up the PDM-functionalities using the microphone array library seems to be successfull. But I´m struggeling with setting up the usb-functionalities using the usb_library. I read the usb-library-documentation but I still don´t understand how to set up an endpoint0.c for an usb-audio-device. Copying the endpoint0.c from usb_aud_mic_array doesn´t bring me further because it is verry ifdefed and needs a lot of defines.

2. starting with usb_aud_mic_array software
I can run the software successfully on the microphone-array board. But porting it to the explorer kit brings up some problems:
- The explorer-kit hasn´t all the buttons and LEDs. I was able to remove this part of the programm.
- The explorer-kit has no PLL. So i would need to change all the clock-sources wherever they are used. I´m struggeling with this.
- The explorer-kit has no ADC and DAC. So i would need to disable any use of them. I tried to change the customdefines.h like that:

Code: Select all

/* Number of IS2 chans to DAC..*/
#ifndef I2S_CHANS_DAC
#define I2S_CHANS_DAC      (2)
#endif

/* Number of I2S chans from ADC */
#ifndef I2S_CHANS_ADC
#define I2S_CHANS_ADC      (0)
#endif
As result the project will not build any more with getting following error:

Code: Select all

C:/Users/.../module_usb_audio/ports/audioports.c:57:17: error: use of undeclared identifier 'p_lrclk'
p_lrclk,
                ^
C:/Users/.../module_usb_audio/ports/audioports.c:58:17: error: use of undeclared identifier 'p_bclk'
                p_bclk,
                ^
I also found this tread, which proves that it is possible to do it. But it doesn´t help me to understand how. https://www.xcore.com/viewtopic.php?f=4 ... 057#p25057

So I would be happy, if someone could give me an idea how to process with this project. Thanks!


Bootucal
Member
Posts: 11
Joined: Thu Jan 03, 2019 12:06 pm

Post by Bootucal »

I got a bit further with this project. I got the usb-functionality running and proved that my Software works, as long as I use an external 11,2896MHz clock as pdm-mclock and clocking PORT_MCLK_COUNT which is used by the usb-functions. I took this clock from the microphone-array board. But I would like to use just one board.
The reason why I used the clock from microphone-array-board is, that I need a clock which is dividable to 44100Hz. On the Microphone-Array board, this clock is generated by the CS2100, which is not available on the explorer board. The lib-mic-array userguide says this on page 7:
The input clock for the microphones can be generated in a multitude of ways. For example, a 3.072MHz
clock can be generated on the board, or the xCORE can divide down 12.288 MHz master clock. Or, if clock
accuracy is not important, the internal 100 MHz reference can be divided down to provide an approximate
clock.
Is it correct, that I could generate a clock which would do the job whithout adding some external Hardware? If yes, how could I do that?
Post Reply