PDM library setGain doesn't work

HI,

I am trying to change the PDM gain on Arduino Nano 33 BLE Sense Rev2.

Using this function in PDM Library:

PDM.setGain(gain)

According to the PDM Library Doc, the parameter gain can be set to 0 ~ 255

Parameters
gain: gain value to use, 0 - 255, defaults to 20 if not specified.

But the nRF52840 datasheet tells that the PDM gain can only be set to 0x00 ~ 0x50

in Chapter 6.15.7.12 GAINL(and 6.15.7.13 GAINR)
MinGain 0x00
DefaultGain 0x28
MaxGain 0x50

Then I observe the output waveform on two different gain setting below

PDM.setGain(127)

and

PDM.setGain(255)

I found change the gain from 127 to 255 affect nothing to the waveform, even the background noise are in the same leve.

I'm wondering why the PDM Library Doc tells that gain can be 0-255.

Thank you all.

me too.
I think that the discussion will be more fruitful if you insert the code to the forum

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.