Simple Wave Player with PWM, Lite version.

Dependencies:   mbed

Information

Under construction

/media/uploads/mimi3/wave_player_pwm_lite.jpg http://mpu.up.seesaa.net/image/wave_player_pwm_10bit_nucleo-f030r8-frizing.gif

Description

  • This is a simple wave player application(not library) using PWM ports.
  • This is Lite version.
    (difference from https://developer.mbed.org/users/mimi3/code/wave_player_pwm/)
  • Speed up SD card accsess by modified SDFileSystem library with DMA capability.
  • Only very simple User Interfaces.
  • 32 step digital volume capability. (New feature)
  • Variable speed functionality to play. (Up usability)
  • 10bit PWM resolution quality. (Decent audio quality)
  • Small code size. (About 32K byte)
  • LED indicator while playing music. (New feature / (Inaccurate :D ))
  • Using only passive electric components except SD card.
    ( It is needed only some resisters and capacitors )

Spec.

  • Input data: WAVE file(PCM:*.wav files). ( must be converted by foobar2000)
  • Data length: 16bit, 8bit.
  • fs : ... 32kHz,44.1kHz,48kHz.
  • Channel: Stereo, mono
  • Output data: PWM 10bit resolutuon.
    fs and Channels are the same as input data.

Board

Using Library

Terminal base CUI

UART Terminal (e.g. Tera Term) base operation, /media/uploads/mimi3/wave_player_pwm_lite_cui_terminal.png

Tera Tem settings

  • Serial om port: Baudrate 115200bps.
  • Main Menu - [Setup] - [Terminal] dialog:

New-line settings.

/media/uploads/mimi3/terraterm-new-line-settings.png

Operation

KeyOperationon Playon Pause
p,sPause or Play.PausePlay
., n, SpaceNext song.oo
dPlay slowly 3 step.oo
uPlay rappidly 3 step.oo
0(Zero)Set normal play speed.oo
+,-Digital Volume 32 stepoo
hHelp menu.-o
!Show system information.oo
qQuit player mode.oo

Playing music

Now You can hear the sound from PWM port of mbed board.

Music01: Serenity

Music02: About That Oldie

Music03: Gemini Robot

Committer:
mimi3
Date:
Sat Dec 26 09:25:32 2015 +0000
Revision:
0:b5e8059dd716
led blink test

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mimi3 0:b5e8059dd716 1 #include "mbed.h"
mimi3 0:b5e8059dd716 2
mimi3 0:b5e8059dd716 3 DigitalOut myled(LED1);
mimi3 0:b5e8059dd716 4
mimi3 0:b5e8059dd716 5 int main() {
mimi3 0:b5e8059dd716 6 while(1) {
mimi3 0:b5e8059dd716 7 myled = 1; // LED is ON
mimi3 0:b5e8059dd716 8 wait(0.5); // 200 ms
mimi3 0:b5e8059dd716 9 myled = 0; // LED is OFF
mimi3 0:b5e8059dd716 10 wait(0.5); // 1 sec
mimi3 0:b5e8059dd716 11 }
mimi3 0:b5e8059dd716 12 }