Step 5: Verify Application Performance
Congratulations! You are ready to DEBUG the application!1
Connect a USB cable from the micro USB connector (J4) on the PIC32MZEF Starter Kit Board to the PC.
2
Connect a headphone to the HP Out connecter on the Multimedia Expansion Board II (MEB II).
3
Before you start the debugger, you may want to set breakpoints in the application files app.c and app1.c to verify that important stages of the application are executed successfully.
6
7
Open your favorite track and hit the play button on the player. Verify that the application goes through the breakpoints previously set.
8
At this point, remove all breakpoints and hit the stop button on the player. Reset and run the application.
9
Open your favorite track and hit the play button on the player. You should be able to hear the audio track played on your RTOS based USB audio speaker!
Verify the Performance
You should not be able to hear any noise artifacts (static, distortion, clicks or pops) while playing the selected audio track.
Results
You should be able to play audio tracks on a PC, with the MEB II acting as a FreeRTOS-based USB speaker. You should also be able to mute/unmute and increase/decrease the volume of the audio speaker, and hear audio without any distortion. Additionaly, you should be able to observe LED1 (D3 on MEB II) toggling at regular intervals along with the audio played on MEB II.
Analysis
In this exercise, you have demonstrated the performance impact of using a FreeRTOS-based USB speaker over a cooperative multitasking-based USB speaker. The application was designed around two application tasks (USB Speaker and Delay Tasks). Higher CPU bandwidth of Delay Task affects the performance of USB Speaker application. You have integrated FreeRTOS and re-configured the codec, USB Library, TIMER System Service, etc., into the application to ensure the drivers are properly configured to work with the RTOS. You have fine-tuned the USB Speaker application task to provide better performance when used with FreeRTOS.
Conclusions
This tutorial demonstrated the need for a FreeRTOS-based application when the cooperative multitasking-based application no longer works. It also showed how easily and quickly you can add FreeRTOS into your existing cooperative multitasking-based application using MHC. As a next step, you may extend the application by adding graphics equalizer support using MHC and MHGC.
Table of Contents
|