Skip to content
This repository was archived by the owner on Apr 16, 2021. It is now read-only.

Commit 6fb51dd

Browse files
committed
PDM: respect microphone min_freq specifications
1 parent 055af04 commit 6fb51dd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

libraries/PDM/src/PDM.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ int PDMClass::begin(int channels, long sampleRate)
5555
// configure the sample rate and channels
5656
switch (sampleRate) {
5757
case 16000:
58-
nrf_pdm_clock_set(NRF_PDM_FREQ_1032K);
58+
NRF_PDM->RATIO = ((PDM_RATIO_RATIO_Ratio80 << PDM_RATIO_RATIO_Pos) & PDM_RATIO_RATIO_Msk);
59+
nrf_pdm_clock_set(NRF_PDM_FREQ_1280K);
5960
break;
6061
case 41667:
6162
nrf_pdm_clock_set(NRF_PDM_FREQ_2667K);

0 commit comments

Comments
 (0)