Tamas Harczos - 2019-10-03

The included program will demonstrate the functionality of the nrf_pwm_audio module.

Upon start, it will play back a sentence "Please use the buttons on the DSK!". By pressing buttons 1, 2, or 3 the program will play back "Sample one" (sampled at 7812 Hz), "Sample two" (sampled at 15625 Hz), or "Sample three" (sampled at 31250 Hz), respectively. By pressing button 4 any current playback will be stopped.

To hear the output, you should connect a headphone between Vdd (not GND!) and the output pin (by default: GPIO pin 3).

Possibilities to reduce static noise:

  • power the board from battery,
  • detach USB cable (disable programming/debug interface),
  • disable logging (NRF_LOG_ENABLED=0 in sdk_config.h),
  • add an electrolytic capacitor between Vdd and Gnd (1000 uF does well),
  • on nRF52840 DSK set SW6 to "nRF ONLY".

To use own audio clips, convert any digital audio to 8-bit signed integer format at any of the supported sampling rates, save as headerless RAW data and convert to .c/.h using e.g. bin2c. For the audio part you may want to use the free software Audacity.

 

Last edit: Tamas Harczos 2019-10-03