Access Flash Drives with a Microcontroller
The RF command reads from
where n is a previously obtained
file handle, M is a filler character,
and ssssssss is the number of bytes
to read expressed as ASCII hex. If
the requested number of bytes
aren’t available, the USBwiz inserts
the filler character for the missing
This command requests to read
15 (0Fh) bytes from a file opened with
file handle 0 using “X” as the filler
to Access the USBwiz shows how
you can perform similar functions
from a Visual-Basic application.
For a complete Visual Basic
application that accesses the
USBwiz, visit my website at
www.Lvr.com. Another option to
give your programming a quick start
is the free Microchip C library for
the USBwiz available from GHI
About the Author
■ Jan Axelson is the author of
USB Complete, USB Mass
Storage Complete, and Serial Port
Complete. For USBwiz code and
more information about accessing
Flash drives and designing USB
devices and hosts, visit Jan’s
website at www.Lvr.com.
On receiving a valid RF command, the USBwiz returns !00
followed by the requested data, filler
characters if needed, “$”, the number
of bytes read, and !00:
Nuts & Volts
In the example that’s shown
above, the command requested
two more bytes than the file
contained, so the file’s contents
were followed by two filler
The sidebar Using Visual Basic
NEW! HIDmaker FS for Full Speed FLASH PIC18F4550
■ DLP Designs — DLP-
USB232M USB Adapter Board
■ GHI Electronics — USBwiz
■ Microsoft Visual Basic 2005
Creates complete PC and Peripheral
programs that talk to each other over
USB. Ready to compile and run!
• Large data Reports
64,000 bytes/sec per Interface
• Easily creates devices with multiple
Interfaces, even multiple Identities!
• Automatically does MULTITASKING
• Makes standard or special USB HID
NEW! “Developers Guide for USB HID
Peripherals” shows you how to make
devices for special requirements.
Both PC and Peripheral programs
understand your data items (even odd
sized ones), and give you convenient
variables to handle them.
PIC18F Compilers: PICBASIC Pro,
MPASM, C18, Hi-Tech C.
PIC16C Compilers: PICBASIC Pro,
MPASM, Hi-Tech C, CCS C.
PC Compilers: Delphi, C++ Builder,
Visual Basic 6.
HIDmaker FS Combo: Only $599.95
■ Tera Term Pro
DOWNLOAD the HIDmaker FS Test Drive today!
February 2007 71