
MPLAB Starter Kit for PIC24F User’s Guide
2.2.2
USB Flash Drive Interface (USB Embedded Host)
This demo shows the ability of the PIC24F microcontroller to function as an embedded
host by reading data from a USB Flash drive. To access the demo, select “Flash Drive”
from the main menu.
If a USB Flash drive with files is plugged in to the USB A-receptacle (J4), the display
shows the drive volume name and top level file structure in a list box (Figure 2-5). Long
file and directory names are truncated according to earlier Microsoft 8+3 file system
conventions (e.g., Longfilename.doc would be truncated as LONGFI~1.doc ). Use
the up/down arrow keys to scroll through the directory.
Subdirectories are indicated by names with a folder symbol next to them, and are
opened by pressing the center touch pad. To move up a directory level, select the “..”
entry at the top of the menu window and press the center touch pad.
If a Flash drive is not present, the display shows an empty menu window and the mes-
sage “Insert media”. If the Flash drive has no content, the display will show only the
drive volume name.
To exit the Flash Drive demo and return to the main menu, press the left arrow touch pad.
FIGURE 2-5:
TYPICAL DISPLAYS FOR THE FLASH DRIVE INTERFACE
i Insert media...
i \THUMB
.\SUBDIR~1
.\TRANSFER
CAPTURE.CSV
2.2.3
Real-Time Data Graphing (A/D and Display Multitasking)
As an additional demonstration of the application’s ability to interact with users in real
time, the Data Graphing demo shows the capture and conversion of analog data to
graphic information as it happens. In this demo, the input from the potentiometer (R44)
is converted by the microcontroller ’s A/D converter to digital information, and plotted as
a time vs. amplitude graph on the OLED display.
To access this demo, select “Demos” from the main menu, then “Graph” from the
“Demonstrations” menu. A horizontally scrolling graph appears with a solid line indicat-
ing the current position of the potentiometer. Turning the potentiometer through its
entire range changes the y-coordinate of the line in real time. At its default setting, the
application updates the value from the potentiometer every 100 ms; each time axis
division represents approximately 2 seconds. To increase or decrease the graph’s
update rate, press the right or left arrow touch pads, respectively.
To exit the demo and return to the main menu, press the center touch pad.
DS51725A-page 12
FIGURE 2-6:
DATA GRAPHING DISPLAY
i Potentiometer Graph
? 2008 Microchip Technology Inc.