Easily manage writing, reading files & directories on USB Pen Drive, from simple to use DOS like commands with serial interface.
Simple Commands like DOS to read/write files.
Status LEDs
When USB Drive is inserted, it automatically mounts and red error led will switch off and yellow will come on.
Interface/Power Pins (4x)
Pin# |
Pin Name |
Function |
1 |
GND |
Ground pin |
2 |
+5V |
Provide regulated +5V DC voltage to this pin for board operation. Board has LM1117-3.3V regulator to power all parts. |
3 | TX-OUT | Outgoing Serial data for 3-5V UART. Typically connected to RXD pin of microcontroller or MAX232 or USB-TTL. |
4 | RX-IN |
Incoming serial data at 5V or 3V level. If your data source is microcontroller, then you can connect its TXD pin to RX-IN of the board directly. If your data is at RS232 level data is use a MAX232 to convert that data to 5V UART suitable for board. The board does not interpret the incoming data format, It can be any format, it just takes and writes to file. It is only considering baud rate of incoming data. It should be correctly set as per board configuration to write properly. |
Detect Output pins (2x)
Pin# |
Pin Name |
Function |
1 |
GND |
Ground pin |
2 |
DET |
Interrupt signal output for microcontroller to detect if a USB Drive is inserted or not. If inserted this signal is LOW level. If there is no drive, then the DET level is high.
|
Its recommended and easy to test first with PC before moving to microcontroller interfacing.
Connect the board using USB-TTL or MAX232 to PC.
Download PuTTY to test, Although you can use any software supporting COM port communication, but PuTTY will be prefered since it will give you DOS like prompt.
Start PuTTY and start using the board just like you do on DOS.
There are basically three group of commands you can enter
NOTE: Enter Key (Decimal 13) has to be sent after each command.
Manage Files
CREATE name |
eg. CREATE test.txt To create a file inside directory called 'dir' use like this eg. CREATE dir/test.txt |
CTRL+Z(26 DEC) | save and close the file opened, You can press CTRL+Z in terminal(PuTTY) or issue decimal 26 putchar from your microcontroller. |
TYPE name |
eg. type test.txt To view a file inside directory called 'dir' use like this eg. TYPE dir/test.txt |
DEL name | delete file with 'name' eg. DEL test.txt delete file inside 'dir' eg. DEL dir/test.txt |
REN old new | rename file/dir eg. REN DIR1 DIR2 or REN test.txt new.txt |
Manage Directories
DIR | list all files & dirs |
DIR filter |
list with filter(?,*) eg. *.txt, D?.txt |
MD name | make directory of 'name' eg. MD dir1 |
RD name | remove directory of 'name' eg. RD dir1 |
Setup Commands
? | Show Help |
INF | File System Type FAT12/FAT16/FAT32 |
EXIT | Unmount Drive for removal, Recommended for safe eject. |
NOW |
Show Date Time of internal RTC |
DATE dd:mm:yyyy | Set Date of internal RTC, on start up it defaults to 01-01-1980 |
TIME hh:mm:ss | Set Time of internal RTC, on start up it defaults to 00:00:00 |
To configure your board on which baud rate it should log the data you need to create a simple text file on your card. It can be empty file without any content in it. If there is no file for baud rate configuration default baud rate of 9600 bps will be set. It supports following baud rates. You can insert the USB Pen dive in your PC's USB port to create an empty text file with particular name as below table or create using commands.
Note: In PC, some computer you cannot see file extensions. To see file extensions, you can open windows Explorer > Organize > Folder Options > View > UNCHECK (Hide Extensions for known file types)
Setup File Created on Pen Drive |
Baud Rate Format (8-N-1) |
<No File> Default Baud rate will be 9600 |
9600 |
b115200.txt |
115200 |
b57600.txt |
57600 |
b56000.txt |
56000 |
b38400.txt |
38400 |
b28800.txt |
28800 |
b19200.txt |
19200 |
b14400.txt |
14400 |
b9600.txt |
9600 |
b4800.txt |
4800 |
b2400.txt |
2400 |
b1200.txt |
1200 |
b600.txt |
600 |
To read/write files on your USB Drive using PC, you can also remove drive from board and insert into it PC's USB port. You can view the text files as well as baud rate configuration file which you have created.