Skip to content

pic16f1xxx-wave-player-pwm-super-lite-jalv2. pwm,pcm,wave,player.sd card sound,music,fat32,sdhc,fat16,sdsc,

License

Notifications You must be signed in to change notification settings

dinau/16f-wave-player-pwm-super-lite-jalv2

Repository files navigation

PWM Wave Player Super Lite for PIC16F1xxx with Jalv2

I came across this page WAVE PLAYER FOR PIC16F877A.! and
had an impression for very small code size about 1700 words.
But I struggled with the program that aimed to old and particular MMC FAT16 format
in the now, so I'd rewritten it using Jalv2(Jal) language
in order to work with SDSC(FAT16) / SDHC(FAT32) SD card from 2GB to 32GB.

Specification:

  1. Supported PICs are 8bit Enhanced Midrange PIC16F1xxx series
    and PIC18F26J50 etc, as follows:

    • Programmed by PicKit2/3:

      PIC12F1840
      PIC16F1455 PIC16F1459
      PIC16F1705 PIC16F1709
      PIC16F1825 PIC16F1827 PIC16F1829
      PIC16F1938
      PIC18F14K50
      PIC18F26J50
    • Programmed by PicKit3 or later:

      PIC16F1619
      PIC16F1764
      PIC16F18313
      PIC16F18325
  2. PCM wave music file
    Select 8bit stereo or mono.
    fs (Sample frequency) = 44.1KHz.

  3. Auto play after power on.

  4. One push switch controls Play,Pause and Next song operation.

  5. Code size is about 1700 words.

Youtube demo movie:

alt_image

Schematic:

Output filter:

  • Schematic
    img

SD Card connection:

  • Pin side
     --------------.
             9     = \    DAT2/NC
                 1 ===|   CS/DAT3    [CS]
                 2 ===|   CMD/DI     [DI]
                 3 ===|   VSS1
     Bottom      4 ===|   VDD
     View        5 ===|   CLK        [CLK]
                 6 ===|   VSS2
                 7 ===|   DO/DAT0    [DO]
             8       =|   DAT1/IRQ
     -----------------'
    
  • Logo side
                                             Arduino  NUCLEO-F411  NUCLEO-F030R8
     -----------------.
             8       =|   DAT1/IRQ
                 7 ===|   DO/DAT0    [DO]     D12       D12/PA_6      D12/PA_6
                 6 ===|   VSS2
     Top         5 ===|   CLK        [CLK]    D13       D13/PA_5      D13/PA_5
     View        4 ===|   VDD
                 3 ===|   VSS1
                 2 ===|   CMD/DI     [DI]     D11       D11/PA_7      D11/PA_7
                 1 ===|   CS/DAT3    [CS]     D8        D10/PB_6      D10/PB_6
             9     = /    DAT2/NC
     --------------'
    

Pickit2/3 pin map

 ------------------
 Pickit2/3 pin map
 ------------------
 ----------.
            \
             \
          ==> |1 Vpp/MCLR
              |2 VDD Target
              |3 Vss ground
              |4 ICSPDAT/PGD
              |5 ICSPCLK/PGC
              |6 Aux N.C.
              /
             /
 -----------'

Download:

Write hex file to flash:

  • You can find hex files in hex folder,
    for instance,
    sd-wav-player-16F1705-v8.8-2019-02.hex
    You can write this file to flash using PicKit2/3 Programmer.

Converting to fs=44.1kHz,PCM 8bit stereo or mono data:

  • For 8pin PICs: The .wav files must be converted to 'Mono' data.
    For other PICs:The .waf files must be converted to 'Stereo' data.
  • Use converter tools for example,
    foobar2000
    Audacity
    SoX
    etc.

Supported SD card:

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

References: