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

Improve PDM microphone reliability #33

Merged
merged 3 commits into from
Dec 17, 2019
Merged

Improve PDM microphone reliability #33

merged 3 commits into from
Dec 17, 2019

Conversation

facchinm
Copy link
Member

No description provided.

This clock usually gets activated only by RADIO (BLE).
Helps keeping the microphone jitter low.
Copy link
Contributor

@sandeepmistry sandeepmistry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@facchinm the changes seem fine, tested the following:

  • PDMSerialPlotter example
  • TensorFlow Lite Micro - microspeech example. "yes" detection seems good. "no" didn't work but this is the same outcome for me as before.

@@ -48,10 +48,15 @@ int PDMClass::begin(int channels, long sampleRate)
{
_channels = channels;

NRF_CLOCK->EVENTS_HFCLKSTARTED = 0;
NRF_CLOCK->TASKS_HFCLKSTART = 1;
while (NRF_CLOCK->EVENTS_HFCLKSTARTED == 0) { }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be disabled in .end()?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about this and it might not be clever (since BLE could be in use and would stop working on PDM.end() ).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, so then should we check if it's already enabled before "restarting" it. I would also add a small comment to capture why end() doesn't disable to be kind to our future selves :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree on the comment for our future selves 😉

@facchinm facchinm merged commit a5bce2f into master Dec 17, 2019
@facchinm facchinm deleted the pdm_mic_in_specs branch June 11, 2020 10:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants