I want to integrate the PDM microphone with thingy53, I found no particular sample code for it
Would be needing help from scratch
I want to integrate the PDM microphone with thingy53, I found no particular sample code for it
Would be needing help from scratch
Hi Rakshita
Have you tested the DMIC sample in the SDK?
It is not officially supported on the Thingy53, but it does support the nRF5340DK. If you copy and rename the nrf5340dk_nrf5340_cpuapp.overlay file to thingy53_nrf5340_cpuapp.overlay, and change the pins as necessary, I would expect the example to work on the thingy as well.
Not sure what you mean about repeating output? If I understand you correctly the clock output from the nRF53 is fine, but the data from the microphone seems wrong? Would you be able to attach a trace/scope capture?
Best regards
Torbjørn
dmic is not working with thingy53 even after changing the overlay files
Hi
Rakshita said:In main.c file dmic_dev is actually not present in common.dtsi file so did u added it externally
Yes, I added this in the overlay files in the board folder of the example I sent you:
dmic_dev: &pdm0 { status = "okay"; pinctrl-0 = <&pdm0_default_alt>; pinctrl-names = "default"; clock-source = "ACLK"; };
Rakshita said:There is also an error in main function
Can u please help me out to solve it
Could you zip your example and attach it to the case? Then I will try to build it and see if I can spot the issue.
Best regards
Torbjørn
Actually I was trying to build the code which u send me, than I added the actual dmic sample code which is available in zephyr it got builded but not able to understand the code at all, I dont know even that pdm clock is working or not
Also I didn't get that why u configured the clk and data pin on 8 and 9 because as per the datasheet the clk is at gpio1, 9th pin and data is at gpio0, 27th pin
Also if I send u the code which was based on nrfx pdm driver can u help me with that as I have been working on that code for a long time and still not able to get that what is the issue
Hi Rakshita
Rakshita said:Also I didn't get that why u configured the clk and data pin on 8 and 9 because as per the datasheet the clk is at gpio1, 9th pin and data is at gpio0, 27th pin
My mistake. I incorrectly assumed you were connecting to an external PDM mic, not the one included in the Thingy53.
I found a project on github where they use the internal mic for a machine learning application, possibly you could get some inspiration there?
https://github.com/metanav/thingy53_snoring_detection/blob/main/src/sensors/ei_microphone.cpp
In the mean time I will try to set up a small example using the internal mic on the Thingy53 and share it with you, but I don't think I will have time to complete this today unfortunately. I will try to get back to you tomorrow.
Best regards
Torbjørn
No issues
If u say I can send u the code on which I was trying to enable microphone
No issues
If u say I can send u the code on which I was trying to enable microphone
Hi Rakshita
Sure, please share your code. I will take a look at that before attempting to create a new example.
Best regards
Torbjørn
Can u tell me how to attach a zip file
I went through the snoring example and added the necessary files into my code so right now getting the attached below result
[00:00:03.110,351] <inf> NRFX_PDM: Function: nrfx_pdm_start, error code: NRFX_SUCCESS. TRUE 17, b, 7, b, 14, ffe9, 2c, 6, ffc0, 8, 49, 1d, 36, 5d, 6, ffc8, [00:00:04.111,877] <inf> NRFX_PDM: Function: nrfx_pdm_start, error code: NRFX_SUCCESS. TRUE 24, 18, 5, 1, 4, 18, 21, 1a, 3, 5, 3, 5, e, 13, a, 10, [00:00:05.113,494] <inf> NRFX_PDM: Function: nrfx_pdm_start, error code: NRFX_SUCCESS. TRUE 53, 2a, 2e, 1d, b, ffed, ffdd, ffd8, 9, fffe, fffe, 8, fffe, 9, 5, ffff, [00:00:06.115,020] <inf> NRFX_PDM: Function: nrfx_pdm_start, error code: NRFX_SUCCESS. TRUE b, 9, f, 36, 4f, 44, 3b, 15, 1c, 1d, 14, e, 6, 7, fffa, 2, [00:00:07.116,607] <inf> NRFX_PDM: Function: nrfx_pdm_start, error code: NRFX_SUCCESS. TRUE ffda, ffd1, ffdd, ffb4, ff98, ffad, ffde, ffc3, 6, 25, 34, 21, 12, fff2, ffdb, ffcf, [00:00:08.118,164] <inf> NRFX_PDM: Function: nrfx_pdm_start, error code: NRFX_SUCCESS. TRUE ffc0, ffd5, 3, 13, 2c, 1d, 15, 10, ffb6, ffa0, ffbb, ffcb, ffbc, ffc0, ffd2, ffbb, [00:00:09.119,750] <inf> NRFX_PDM: Function: nrfx_pdm_start, error code: NRFX_SUCCESS. TRUE
Hi
Rakshita said:Can u tell me how to attach a zip file
You can just drag drop a file into the reply window. Alternatively you can click on Insert -> Image/Video/File
Rakshita said:I went through the snoring example and added the necessary files into my code so right now getting the attached below result
This looks like real audio data to me, just very low amplitude. You would expect values that oscillate between positive and negative values, like in your log.
I also did a quick test changing my modified dmic sample to use the proper PDM pins, and I seem to get valid audio data as well (but I haven't verified this properly by playing the audio back).
Best regards
Torbjørn