The SD Data Logger project is based on the USB Data logger project found in AN1145.
This demonstration is set up to use the Explorer 16 board with a PIC24 or PIC32 part. It will require a serial connection from the D-sub (DB-9) connector on the Explorer 16 to a PC running a terminal program (e.g. HyperTerminal) with the following settings: 57600 BPS, 8 data bits, no parity, 1 stop bit, no flow control.
Upon programming and running the demo code, a command prompt will appear on the PC's terminal screen. By typing "HELP" or "?" and pressing enter, the user can display a list of commands that can be used to access and modify files and directories on the card. Note that the terminal program is only transmitting and receiving information from the microcontroller; all functionality (including echoing characters) is handled by the microcontroller. Available shell commands in this demo include:
COMMAND |
SYNTAX |
EXAMPLE |
FUNCTION |
ATTRIB |
ATTRIB <+|->R <+|->S <+|->H <+|->A <name> |
ATTRIB +S +A -H FILE.TXT |
Clears or sets read-only, system, hidden, or archive attributes from a file or directory. |
CD |
CD <name> |
CD DIR1\DIR2 |
Changes the directory to the path specified by <name>. |
COPY |
COPY <file1> <file2> |
COPY ONE.TXT TWO.TXT |
Copies a file. |
COPY |
COPY CON <file1> |
COPY CON EXAMPLE.TXT |
Copies data from the console into a file as the user types it. |
DATE |
DATE [yyyy-mm-dd] |
DATE 2008-08-19 |
Sets the date. If no date is specified, this command will display the currently set date. |
DEL |
DEL <file> |
DEL FILE.TXT |
Deletes a file. |
DIR |
DIR [file] |
DIR EXAMPLE.* | |
HELP/? |
HELP |
HELP |
Displays a list of available commands. |
LOG |
LOG <POT|TMP> <file> |
LOG TMP DATA.CSV |
Logs data from the temperature sensor to potentiometer on the Explorer 16 to the specified file. |
MD |
MD <name> |
MD ONE\TWO\THREE |
Create one or more directories. |
RD |
RD <name> |
RD ONE\TWO\THREE |
Remove a directory. |
REN |
REN <file1> <file2> |
REN ONE.TXT TWO.TXT |
Rename <file1> to <file2> |
TIME |
TIME [hh:mm:ss] |
TIME [10:52:03] |
Set the time to the specified value. If no value is specified, the current time will be output. |
TYPE |
TYPE <file> |
TYPE EXAMPLE.TXT |
Display the contents of a file in ASCII text |