i2s and digital microphones

Discussion and questions about programming with Ultibo.
Gavinmc42
Posts: 1665
Joined: Sun Jun 05, 2016 12:38 pm
Location: Brisbane, Australia

i2s and digital microphones

Postby Gavinmc42 » Tue Sep 06, 2016 6:30 am

Any progress on i2s?

Got some old digital microphones WM7220 I want to try.
Others that should work MP34DB02, MP45DT02

Really cool is the Knowles ultrasonic mems mic SPH0641LU4H-1
Applications like mouse tracking robot cat, bat detector, range finding, movement detection.
User avatar
Ultibo
Site Admin
Posts: 2303
Joined: Sat Dec 19, 2015 3:49 am
Location: Australia

Re: i2s and digital microphones

Postby Ultibo » Tue Sep 06, 2016 10:32 am

Gavinmc42 wrote:Any progress on i2s?

Progress yes, completion not yet :?
Ultibo.org | Make something amazing
https://ultibo.org
Gavinmc42
Posts: 1665
Joined: Sun Jun 05, 2016 12:38 pm
Location: Brisbane, Australia

Re: i2s and digital microphones

Postby Gavinmc42 » Tue Sep 06, 2016 11:40 am

This probably will need DMA because of the data rate, carry on ;)

Just for sound detection, might be able to bitbang a PDM magnitude level comparator.
Hmm phase detection based on delays would need timers, but with 4 mics could make a sound noise radar type display.
i2s can only do 2 channels on the Pi L/R, hmm need to read up on PDM.

For testing need something like a logic analyzer.
Hmm nice little box with Zero and I/O connectors, hdmi output?
Gavinmc42
Posts: 1665
Joined: Sun Jun 05, 2016 12:38 pm
Location: Brisbane, Australia

Re: i2s and digital microphones

Postby Gavinmc42 » Sat Mar 02, 2019 10:40 am

I noticed Rene has some i2s support now in Circle, any clues there?
pik33
Posts: 891
Joined: Fri Sep 30, 2016 6:30 pm
Location: Poland
Contact:

Re: i2s and digital microphones

Postby pik33 » Sun Mar 03, 2019 8:25 am

I am now working with i2s to connect RPis using i2s as an serial bus. It has DMA and 64 FIFO entries and then you can set the clock at any frequency you want.
pjde
Posts: 444
Joined: Tue Feb 09, 2016 6:21 am
Location: Sydney, Australia

Re: i2s and digital microphones

Postby pjde » Sun Apr 07, 2019 1:35 am

I am looking to get the PiFi DAC+ v2.0 working with Ultibo.

In order not to re-invent the wheel, is it possible to get any prelim code on I2s however unfinished it is?

Regards

Paul
pik33
Posts: 891
Joined: Fri Sep 30, 2016 6:30 pm
Location: Poland
Contact:

Re: i2s and digital microphones

Postby pik33 » Sun Apr 07, 2019 6:35 am

In order not to re-invent the wheel, is it possible to get any prelim code on I2s however unfinished it is?

https://github.com/pik33/ultibo_retro_g ... eaudio.pas
I2s initialization code is placed about line #400
This is written for i2s working as communication between 2 RPis instead of UART :) It seems to work. To use it for audio, I have to update all audio related functions in the module. Some register has to be modified to connect a digital microphone as input, there is a special mode for this.
Last edited by pik33 on Sun Apr 07, 2019 6:46 am, edited 1 time in total.
pjde
Posts: 444
Joined: Tue Feb 09, 2016 6:21 am
Location: Sydney, Australia

Re: i2s and digital microphones

Postby pjde » Sun Apr 07, 2019 6:45 am

Thanks Piotr

I will give it a try.

Regards

Paul
pjde
Posts: 444
Joined: Tue Feb 09, 2016 6:21 am
Location: Sydney, Australia

Re: i2s and digital microphones

Postby pjde » Mon Apr 08, 2019 7:16 am

Hi Piotr

Currently looking through the code.

I have one question at the moment regarding the base address for DMA channels.

According to the BCM 2835 and 2837 ARM Peripheral documents the base for the DMA channels is $7E00700
but if I read it correctly, your code uses (_dma_cs) $3F007000. // DMA control and status

I must be missing something somewhere.

Regards

Paul
pik33
Posts: 891
Joined: Fri Sep 30, 2016 6:30 pm
Location: Poland
Contact:

Re: i2s and digital microphones

Postby pik33 » Mon Apr 08, 2019 9:09 am

7E is a physical address while 3F is MMU address. Use 3F for accessing a peripheral with CPU. Use 7F for accessing peripheral with another peripheral (eg. DMA transferring to PWM - you can see this in the code too)

Return to “General”

Who is online

Users browsing this forum: No registered users and 38 guests