Skip to content

Conversation

microbit-carlos
Copy link
Contributor

Also adds the MICROBIT_USB_SERIAL_WAKE flag to the CODAL config to enable wake up from UART.

Changes to codal-microbit-v2:

  • deepSleep() with no wake targets will now actually deep sleep.
  • Serial ports can now be used to wake the board from deep sleep.
  • New configuration flag MICROBIT_USB_SERIAL_WAKE can now be set to configure the board to wake on serial input.

Changes to codal-core:

  • Fixed spurious mic activation due to overlapping device IDs between CodalComponent and MicroBitCompat.

@dpgeorge This is what I've been using for the latest MicroPython testing. Feel free to close the PR if you prefer to update the CODAL tag differently or with other code changes.

Also adds the MICROBIT_USB_SERIAL_WAKE flag to the CODAL config
to enable wake up from UART.

Changes to codal-microbit-v2:
- deepSleep() with no wake targets will now actually deep sleep.
- Serial ports can now be used to wake the board from deep sleep.
- New configuration flag MICROBIT_USB_SERIAL_WAKE can now be set
  to configure the board to wake on serial input.

Changes to codal-core:
- Fixed spurious mic activation due to overlapping device IDs between CodalComponent and MicroBitCompat.
To match the same floor as the previous implementatio. As the new
implementation is more sensitive to lower volume levels and in
"generic quiet room" it gave much higher values, increasing
the LEVEL_DETECTOR_SPL_8BIT_000_POINT config value will match
the previous version.

As discussed in
lancaster-university/codal-microbit-v2#236

Can be removed with the next CODAL tag 0.2.44, which will change
the default value of LEVEL_DETECTOR_SPL_8BIT_000_POINT.
@microbit-carlos
Copy link
Contributor Author

Added a new commit set LEVEL_DETECTOR_SPL_8BIT_000_POINT to 52.0 dB.

This is to match the same floor as the previous implementation, as the new version is more sensitive to lower volume levels.
This has been discussed in:

This change can be removed with the next CODAL tag 0.2.44, which will change the default value of LEVEL_DETECTOR_SPL_8BIT_000_POINT to 52. But in the meantime adding this here as a representation of the MicroPython build I've been using for testing.

@dpgeorge dpgeorge merged commit 1641d15 into master Sep 26, 2022
@dpgeorge
Copy link
Collaborator

This is good, thank you! I tested deep_sleep() and it does wake on incoming UART character.

@dpgeorge dpgeorge deleted the codal-0243 branch September 26, 2022 06:04
microbit-carlos added a commit to lancaster-university/codal-microbit-v2 that referenced this pull request May 9, 2025
codal-core has set the default min and max values to 35 and 100 in:
lancaster-university/codal-core@d376f1a

MakeCode uses 52 to 120, and MicroPython 52 to 100:
- https://github.com/microsoft/pxt-microbit/blob/v7.1.31/libs/microphone/microphone.cpp#L8-L9
- microbit-foundation/micropython-microbit-v2#132 (comment)

With the current SoundLevelSPL we don't get values much larger than
100 dB, so it makes sense to make the micro:bit target default to
100 instead of 120.

This was originally intended to go in codal-microbit-v2 v0.2.44,
but it we never got around to it.
microbit-carlos added a commit to lancaster-university/codal-microbit-v2 that referenced this pull request May 9, 2025
codal-core has set the default min and max values to 35 and 100 in:
lancaster-university/codal-core@d376f1a

MakeCode uses 52 to 120, and MicroPython 52 to 100:
- https://github.com/microsoft/pxt-microbit/blob/v7.1.31/libs/microphone/microphone.cpp#L8-L9
- microbit-foundation/micropython-microbit-v2#132 (comment)

With the current SoundLevelSPL we don't get values much larger than
100 dB, so it makes sense to make the micro:bit target default to
100 instead of 120.

This was originally intended to go in codal-microbit-v2 v0.2.44,
but it we never got around to it.
microbit-carlos added a commit to lancaster-university/codal-microbit-v2 that referenced this pull request May 9, 2025
codal-core has set the default min and max values to 35 and 100 in:
lancaster-university/codal-core@d376f1a

MakeCode uses 52 to 120, and MicroPython 52 to 100:
- https://github.com/microsoft/pxt-microbit/blob/v7.1.31/libs/microphone/microphone.cpp#L8-L9
- microbit-foundation/micropython-microbit-v2#132 (comment)

With the current SoundLevelSPL we don't get values much larger than
100 dB, so it makes sense to make the micro:bit target default to
100 instead of 120.

This was originally intended to go in codal-microbit-v2 v0.2.44,
but it we never got around to it.
microbit-carlos added a commit to lancaster-university/codal-microbit-v2 that referenced this pull request May 9, 2025
…#481)

codal-core has set the default min and max values to 35 and 100 in:
lancaster-university/codal-core@d376f1a

MakeCode uses 52 to 120, and MicroPython 52 to 100:
- https://github.com/microsoft/pxt-microbit/blob/v7.1.31/libs/microphone/microphone.cpp#L8-L9
- microbit-foundation/micropython-microbit-v2#132 (comment)

With the current SoundLevelSPL we don't get values much larger than
100 dB, so it makes sense to make the micro:bit target default to
100 instead of 120.

This was originally intended to go in codal-microbit-v2 v0.2.44,
but it we never got around to it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants