Link Search Menu Expand Document

Audio-Tone Application by reading the tone from a text file stored in an SD card on PIC32MZ Embedded Connectivity with FPU Starter Kit + Multimedia Expansion Board II

Download


Description

The application reads an audio text file from the PIC32 Multimedia Expansion Board II (MEB II) SD card and streams it over the PIC32 I²S interface to the audio CODEC. The audio file is saved as a .txt file with comma-separated left and right channel audio data

Modules/Technology Used:

  • Peripheral Modules
    • I2C
    • I2S
    • Timer
    • Core Timer
  • Drivers
    • I2S Driver
    • I2C Driver
    • AK4953 Driver
    • SDCARD (SPI) Driver
  • BSP Library
    • PIC32MZ EF Starter Kit BSP
  • System Services
    • File System

Hardware Used:

Note: This application is a reference only to the existing users of Multimedia Expansion Board II (MEB II) to port/develop their application(s) using MPLAB Harmony v3 as the Multimedia Expansion Board II (MEB II) is now a matured product and the same is not available for purchase from Microchip Direct.

Software/Tools Used:

This project has been verified to work with the following versions of software tools:

Because Microchip regularly update tools, occasionally issue(s) could be discovered while using the newer versions of the tools. If the project doesn’t seem to work and version incompatibility is suspected, It is recommended to double-check and use the same versions that the project was tested with.

Setup:

  • Connect the PIC32MZ Embedded Connectivity with FPU (EF) Starter Kit to the Host PC as a USB Device through a Type-A male to micro-B USB cable connected to Micro-B USB (Debug USB) port.
  • Connect the wired stereo headphone to the audio jack

Note: It is not necessary to have an MPLAB Real ICE™ to program/debug the code. The PIC32MZ EF Starter Kit includes a PICkit™ on-board (PKOB) debugger. The PKOB debugger can be connected to a host PC through the USB Mini-B connector on the PIC32MZ EF Starter Kit for programming/debugging (see the red cable in the hardware setup).

Programming hex file:

The pre-built hex file can be programmed by following the below steps.

Steps to program the hex file

  • Open MPLAB X IDE
  • Close all existing projects in IDE, if any project is opened.
  • Go to File -> Import -> Hex/ELF File
  • In the “Import Image File” window, Step 1 - Create Prebuilt Project, Click the “Browse” button to select the prebuilt hex file.
  • Select Device has “PIC32MZ2048EFH144”
  • Ensure the proper tool is selected under “Hardware Tool”
  • Click on Next button
  • In the “Import Image File” window, Step 2 - Select Project Name and Folder, select appropriate project name and folder
  • Click on Finish button
  • In MPLAB X IDE, click on “Make and Program Device” Button. The device gets programmed in sometime
  • Follow the steps in “Running the Demo” section below

Programming/Debugging Application Project:

  • Open the project (audio_player_lab2/firmware/audio_player_lab2.X) in MPLAB X IDE
  • Ensure “PKOB” is selected as hardware tool to program/debug the application
  • Build the code and program the device by clicking on the “make and program” button in MPLAB X IDE tool bar
  • Follow the steps in “Running the Demo” section below

Running the Demo:

  • Program the micro SD card with the audio text file (tone.txt) by copying it from folder audio_player_lab2\firmware and paste into the micro SD card
  • Insert the micro SD card into the micro SD card slot (J8) on the MEB II Board.
  • Connect a headphone to the HP Out connector on the Multimedia Expansion Board II
  • Wear the headphone and you should hear a tone.

Comments:

Revision:

  • v1.2.0 regenerated and tested the application
  • v1.1.0 regenerated and tested the application
  • v1.0.0 released demo application


Copyright © 2020 Microchip Technology.