xCore Multichannel audio board with PDM mics

If you have a simple question and just want an answer.
Post Reply
thammer_177402
New User
Posts: 2
Joined: Mon Aug 20, 2018 2:30 pm

xCore Multichannel audio board with PDM mics

Post by thammer_177402 »

Hello All,

Is it possible to use PDM microphones with the xCore multichannel audio platform?
I am thinking of using the LED ports for the connection of the PDM microphones and taking the clock from I2S as pdm clock. Or should I look for other ports?
I would like to keep the 8 channel DAC and the ADAT Tx.

I have been trying to set up the ports but when I change #define NUM_PDM_MICS from 0 to 8 I get the following error:

C:/Users/thammer/workspace_new2/module_usb_audio/pdm_mics/pcm_pdm_mic.xc: Error: Undefined reference to 'user_pdm_init'
C:/Users/thammer/workspace_new2/module_usb_audio/pdm_mics/pcm_pdm_mic.xc: Error: Undefined reference to 'user_pdm_process'

Best
T


User avatar
mon2
XCore Legend
Posts: 1913
Joined: Thu Jun 10, 2010 11:43 am
Contact:

Post by mon2 »

Not an audio developer but believe you can. Have a look at this:

https://www.xmos.com/support/libraries/lib_mic_array

https://www.xmos.com/download/private/l ... rc1%29.pdf

https://github.com/xmos/lib_mic_array

the target is the XCORE-200 CPU series (same as your platform).
Attachments
lib_mic_array-[userguide]_3.0.1rc1.pdf
(828.32 KiB) Downloaded 225 times
lib_mic_array-[userguide]_3.0.1rc1.pdf
(828.32 KiB) Downloaded 225 times
User avatar
infiniteimprobability
XCore Legend
Posts: 1126
Joined: Thu May 27, 2010 10:08 am
Contact:

Post by infiniteimprobability »

You can, but you need to work out where to input the PDM signals.

First get the "xCORE-200 Multichannel Audio Platform Portmap" table in front of you from the hardware guide. This is the key to port planning.

lib_mic_array uses an 8b port for the pdm mics input. If you are using the USB audio ref design then Ports 8A and 8B are already consumed by USB. You can still get to the LEDs by using ports 4c and 4d (search for xmos port precedence). You will likely put lib_mic_array on tile 0 (because tile 1 has all of the USB stuff already), so looking at the portmap, the only real place you can easily get at a free 8b port is port 8b which connects to the buttons/switch. You could feed your mic signals in there. If you need more than 4 then you may need to go straight into the QFP package pins and remove the overflow signal from the ADC (cut a track).

You can remap which pins in the port get decimated - I think it's lib_mic_array_conf.h or similar.

If you don't need USB then the LED ports are indeed a good place to input your signals. I2S will still need to be on tile 0 because that's where the DACs are.
thammer_177402
New User
Posts: 2
Joined: Mon Aug 20, 2018 2:30 pm

Post by thammer_177402 »

Thank you for your reply, I will give this a go.
I will not be using USB so I will try to connect PDM mic's to LED pins as I will be needing up to 8 PDM microphones.
Will it be possible to re-use the "app_usb_aud_xk_216_mc" app an remove what I don't need (e.g. USB) and add PDM mics or should I start from scratch?

My goal is to make a PDM to ADAT (and analog out) converter.

Best
T
User avatar
infiniteimprobability
XCore Legend
Posts: 1126
Joined: Thu May 27, 2010 10:08 am
Contact:

Post by infiniteimprobability »

My goal is to make a PDM to ADAT (and analog out) converter.
Ah OK - yes that should be fine. The board you have is the perfect board for that then, aside from having to hack into the LEDs..
Will it be possible to re-use the "app_usb_aud_xk_216_mc" app an remove what I don't need (e.g. USB) and add PDM mics or should I start from scratch?
Honestly, I'd start from scratch. There is a lot of baggage in the ref design (MIDI, Mixer, USB stuff, SPDIF, PLL manager...) and it all gets a bit messy. Also, main.xc is not actually in the app directory, it's hidden in sc_usb_audio and heavily ifdeffed.

A good starting point may be AN00219. That sets up 8 ch of PDM mics. You can strip out what you don't need (i2s, buttons, delay and sum), add a thread to receive samples and forward them to the ADAT transmitter. You can look at usb audio to see an example of the adat transmitter API.
Post Reply