microsoft / pxt-arcade

Arcade game editor based on Microsoft MakeCode
https://arcade.makecode.com
MIT License
484 stars 210 forks source link

high pitch noise on micro:bit with kittenbot arcade shield #6520

Open fabianhugo opened 1 month ago

fabianhugo commented 1 month ago

Description When playing different makecode arcade games on the micro:bit 2.21 and kittenbot arcade shield 1.0, i noticed a high pitch noise coming from the micro:bit buzzer. I checked with the oscilloscope and measured a 16kHz ringing, see the attached screenshot.

Image

When I used the screen using the arcade shield extension for microbit makecode, the noise is neither hearable nor visible. Which makes me believe that this bug is something that might be fixable by firmware.

To Reproduce Steps to reproduce the behavior:

  1. Generate jumpy plattformer or caterpillar hex files for the N3 hardware in microsoft arcade
  2. Plug micro:bit into kittenbot arcade shield and copy hex file via USB to the micro:bit
  3. Listen to the buzzer on the back of the micro:bit
fabianhugo commented 3 weeks ago

As far as I understand, the relevant files are in the codal-nrf52833-dk repository since it contains the drivers for the N3 hardware. My initial idea was to call the function that corresponds to the ubit.audio.set_silence_level(0) function of the microbit-v2 codal, but since the structure is actually quite different, this is trickier. I found a similar function called: int Mixer2::setSilenceLevel(float level) in github.com/mmoskal/codal-nrf52833-dk/blob/master/source/Mixer2.cpp but im not sure if the problem really lies there.