Skip to content

dinau/arduino-wave-player-pwm-super-lite-nim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Arduino Wave Player PWM - Super Lite - Nim


  • Description

    • This project is very simple wave player program with SD card using Nim language and using only passive parts, capacitor,diode and resistor except SC card.
  • Prerequisite

    • nim-1.6.0
      • Important: It must be used above nim version otherwise it won't work well.
    • avr-gcc v7.3.0 (inclued in arduino-1.8.16 IDE)
      • For example, if on Windows10 set executable path to
        d:\arduino-1.8.16\hardware\tools\avr\bin
    • make,rm and etc Linux tool commands
  • Target Boards

    • Arduino Uno / Nano
  • Schematic and Photo

    Schematic
    Photo
    Output filter

  • Build project

    • You can use make command for build management as follows,
      $ make # build target
      $ make clean # clean target
      $ make w # upload to flash
      or
      $ nim make # build target
      $ nim clean # clean target
      $ nim w # upload to flash
    • Artifacts (*.hex,*.lst files etc) would be generate to .BUILD folder.
  • Supported SD card

    • SDSC/SDHC card FAT16 and FAT32
      1. First, format SD card using SD Card Formatter
      2. Copy PCM wav files to root directory of the SD card.
  • Supported file

    PCM wave files that have file extension ".wav" on root directory.
    PCM:16bit/8bit, fs(sampling rate)=32kHz,44.1kHz,48kHz.
    Stereo/Mono.

  • Hardware setting

    • Refer to the file ./port_setting.txt
    • PWM output port:
      Audio Left     PWM out : OC1A: PB1, 15pin, D9
      Audio Right    PWM out : OC1B: PB2, 16pin, D10
      
  • User button (S1)

    • D2 (PD2) Button SW
      • Next song : One click during Play mode.
      • Play Pause: Push long time .
      • Play : One click from Pause state.
  • Control from UART

    • Set baudrate: 38400bps
      • Next song: Send from key board 'n' or ' '(Space) during Play or Pause mode.
      • Play/Pause: Send from key board 's' or 'p' or 'ESC'(Escape char) during Play or Pause mode.
        Play or Pause mode would be toggled.
  • Display music filename during play mode by UART output.

    • This is debug purpose so only display 8.3 type filename (ansi).
      • UART output
        OURPLACE.WAV   # Power on. Start playing music.
        RAINBOWS.WAV
        ACOUST~1.WAV
        ARTP7   .WAV
        HOTELC  .WAV
        OURPLACE.WAV   # Repeat form first file. 
        RAINBOWS.WAV
        ...
        
  • Schematic

    • Arduino Nano
      • External 3.3V power is required so that the current consumption of SD card might exceed instantaneously over 100mA when power becomes on.
  • Photo

    • Arduino Nano compatible board
  • Output filter

    filer

Other links2

About

This project is very simple wave player program with SD card using Nim language. This project was made first at 2019/01 using nim-0.19.6. For Arduino Uno / Nano.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published