REFERENCE 4D SYSTEMS TURNING TECHNOLOGY INTO ART. μdrive. (μdrive-μsd-g1) COMMAND SET. Document Date: 23 rd October 2012 Document Revision: 4.

Similar documents
DATASHEET 4D SYSTEMS TURNING TECHNOLOGY INTO ART. Embedded DOS micro-drive Module. μdrive-μsd-g1

DATASHEET 4D SYSTEMS. 4D Raspberry Pi Serial Adaptor TURNING TECHNOLOGY INTO ART. 4D-Serial-Pi-Adaptor

udrive-usd-g1 Embedded DOS micro-drive Module Data Sheet

DATASHEET 4D SYSTEMS. 4D Arduino Adaptor Shield TURNING TECHNOLOGY INTO ART. 4Display-Adaptor-Shield

DATASHEET 4D SYSTEMS. 4D Raspberry Pi Serial Adaptor TURNING TECHNOLOGY INTO ART. 4D-Serial-Pi-Adaptor

DATASHEET 4D SYSTEMS. 4D Raspberry Pi Serial Adaptor TURNING TECHNOLOGY INTO ART. 4D-Serial-Pi-Adaptor

DATASHEET 4D SYSTEMS TURNING TECHNOLOGY INTO ART. USB to Serial UART Bridge Converter. Document Date: 5 th September 2012 Document Revision: 1.

4D Systems. Application Note: 4D-AN-G3001. in ViSi Environment. Document Date: 15 th December Document Revision: 1.0

Workshop 4 Installation INSTALL GUIDE. Document Date: February 4 th, Document Revision: 1.1

DATASHEET. 3.2 Display Bezel. 4D-Bezel-32 For the ulcd-32ptu Display Module. Document Date: 16 th September 2013 Document Revision: 1.

4D SYSTEMS TURNING TECHNOLOGY INTO ART. Application Note: 4D-AN-G5002

4D Systems. Application Note: 4D-AN-P2002. Playing Video on PICASO based modules using RAW option. Document Date: 15 th December 2012

DATASHEET 4D SYSTEMS TURNING TECHNOLOGY INTO ART. microusb Programming Adaptor. USB to UART Serial Bridge

DATASHEET 4D SYSTEMS. uusb-pa5 uusb-pa5-ii. microusb Programming Adaptor TURNING TECHNOLOGY INTO ART. USB to UART Serial Bridge

DATASHEET 4D SYSTEMS TURNING TECHNOLOGY INTO ART. Carrier Board for μoled-160-g1/g2 CB-160-G1

DATASHEET. gen4 Programming Adaptor For all gen4 sizes (Picaso and Diablo16) gen4-pa. Document Date: 29 th January 2016 Document Revision: 1.

DATASHEET 4D SYSTEMS. 4Display Shield with 2.2 Display TURNING TECHNOLOGY INTO ART. 4Display-Shield-22

4D SYSTEMS APPLICATION NOTE. Application Note: 4D-AN-P3001 TURNING TECHNOLOGY INTO ART. ViSi - Displaying Third-Party Fonts

USER GUIDE. Workshop 4 User Guide. Document Date: 17 th December 2012 Document Revision: 1.1

DATASHEET. 4D 4.3 LCD CAPE Beagle Bone Black 4.3 LCD CAPE. Document Date: 3 rd February 2014 Document Revision: 1.9

4D SYSTEMS APPLICATION NOTE. Application Note: 4D-AN-G5001 TURNING TECHNOLOGY INTO ART. Serial - Displaying Third-Party Fonts

2.8 microlcd Intelligent PICASO Display Module

DATASHEET. 4.3 Embedded SPI Display. 4DLCD-FT843 Powered by the FTDI FT800 Video Engine. Document Date: 25 th September 2013 Document Revision: 0.

APPLICATION NOTE. Application Note: 4D-AN-P4009. ViSi-Genie Inputs. Document Date: November 19 th, Document Revision: 1.0

APPLICATION NOTE. Application Note: 4D-AN-P4007. ViSi-Genie Play Video. Document Date: November 15 th, Document Revision: 1.

APPLICATION NOTE. Application Note: 4D-AN-P4004. ViSi-Genie Advanced Buttons. Document Date: November 15 th, Document Revision: 1.

Font Tool User Guide. Abstract. Document Date: 1 July 2009 Document Revision: 01

Introduction. Rev.1.2

DATASHEET 4D SYSTEMS. Embedded Audio-Sound Module TURNING TECHNOLOGY INTO ART SOMO-14D. Document Date: 5 th February 2013 Document Revision: 1.

DATASHEET. 4D 7.0 LCD CAPE Beagle Bone Black 7.0 LCD CAPE. Document Date: 3 rd February 2014 Document Revision: 1.2

Serial JPEG Camera Module Data Sheet

DATASHEET 4D SYSTEMS. Serial JPG Camera Module TURNING TECHNOLOGY INTO ART. Document Date: 5 th September 2012 Document Revision: 1.

DATASHEET. 4D 4.3 LCD CAPE Beagle Bone Black 4.3 LCD CAPE. Document Date: 15 th October 2013 Document Revision: 1.7 DISTRIBUTED BY TEXIM EUROPE

DATASHEET. 4.3 Embedded SPI Display. 4DLCD-FT843 Powered by the FTDI FT800 Video Engine. Document Date: 8 th January 2014 Document Revision: 1.

Serial JPEG Camera Module Data Sheet

4D LABS. GOLDELOX-SGC Command Set. Software Interface Specification. Page 1 of 67. Document Date: 12th April 2010 Document Revision: 3.

DATASHEET 4D SYSTEMS. Arduino Display Module Pack TURNING TECHNOLOGY INTO ART. ulcd-43-pt-ar. Featuring 4.3 Serial Display Module

DATASHEET 4D SYSTEMS. Raspberry Pi Display Module Pack TURNING TECHNOLOGY INTO ART. Featuring a 2.8 Display Module ulcd-28-ptu-pi

USER MANUAL. Workshop4 IDE USER GUIDE. Document Revision: 2.1 Document Date: 29 th July 2017

4D SYSTEMS µvga-ii(sgc) Serial VGA Graphics Engine Data Sheet

Application Note: 4D-AN-P4010 ViSi-Genie Connection to a Host with Red- Green-Blue LED Control

DATASHEET. Serial Camera Module. ucam-ii. Document Date: 24 th July 2014 Document Revision: 1.3

DATASHEET. Serial Camera Module. ucam-ii. Document Date: 6 th March 2014 Document Revision: 1.1

QPP Proprietary Profile Guide

4D SYSTEMS µoled-160-g1(sgc) Serial OLED Display Module Data Sheet

GS2K External Flash based Host Firmware Update Application Note NT11608A Rev

USER GUIDE. Workshop4 PRO SMART WIDGETS EDITOR. Document Revision: 1.1 Document Date: 29 th July 2017

µoled 128 USB Connection Using Prop Plug

Installing Your Microsoft Access Database (Manual Installation Instructions)

EDBG. Description. Programmers and Debuggers USER GUIDE

SPECIFICATIONS SUBJECT TO CHANGE WITHOUT NOTICE

Terminal I/O Profile Client Implementation Guide

TO OUR VALUED CUSTOMERS

4D LABS. GOLDELOX-SGC Command Set. Software Interface Specification. Page 1 of 87. Document Date: 17th November 2011 Document Revision: 6.

Preliminary File System User Manual

AVR42789: Writing to Flash on the New tinyavr Platform Using Assembly

DATASHEET. Embedded Audio-Sound Module SOMO-II. Document Date: 8 th January 2014 Document Revision: 0.1

ATAES132A Firmware Development Library. Introduction. Features. Atmel CryptoAuthentication USER GUIDE

End User License Agreement

CEC1702 clicker. a great idea is just a click away

RE866 Interface User Guide

GS2K OV SDK User Guide. 1VV Rev

ESS Utility Android App User Guide

QT3 Xplained Pro. Preface. Atmel QTouch USER GUIDE

How to use the NTAG I²C plus for bidirectional communication. Rev June

Ethernet1 Xplained Pro

Small Logger File System

ComAPI+ API Documentation

4D SYSTEMS µoled-160-g1(sgc) Serial OLED Display Module Data Sheet

DATASHEET. 4DPi-24-HAT. 2.4 Primary Display for the Raspberry Pi. In partnership with. Compatible with A+, B+ and Pi2

USER GUIDE. Atmel QT6 Xplained Pro. Preface

DATASHEET. Embedded Audio-Sound Module SOMO-II. Document Date: 21 st March 2014 Document Revision: 1.1

µoled-96-g1(sgc) Serial OLED Display Module Data Sheet

SOMO-14D Embedded Audio-Sound Module

IoT AppZone Release Notes

AN S1401 Using BlueMod+S as Beacon

AT03262: SAM D/R/L/C System Pin Multiplexer (SYSTEM PINMUX) Driver. Introduction. SMART ARM-based Microcontrollers APPLICATION NOTE

AN LPC1700 secondary USB bootloader. Document information. LPC1700, Secondary USB Bootloader, ISP, IAP

Supplement to InfiniBand TM Architecture Specification Volume 1 Release 1.2. Annex A11: RDMA IP CM Service. September 8, 2006

mikroprog Suite for PIC programming software

USER GUIDE EDBG. Description

USER GUIDE. ATWINC1500 Xplained Pro. Preface

MERIDIANSOUNDINGBOARD.COM TERMS AND CONDITIONS

4D LABS. PICASO-SGC Intelligent Serial Graphics Controller. Advance Information. Page 1 of 25. Document Date: 29th April 2010 Document Revision: 2.

GUI design made easy. Creating the First Project with. additional software

Multifunction Serial Interface (PDL_MFS) Features. General Description. When to Use a PDL_MFS Component. Quick Start 1.0

Optimus.2 Ascend. Rev A August, 2014 RELEASE NOTES.

Title page. Alcatel-Lucent 5620 SERVICE AWARE MANAGER

AT60142H/HT. Rad-Hard 512Kx8 Very Low Power CMOS SRAM ERRATA-SHEET. Active Errata List. Errata History. Abbreviations. 1.

1. License Grant; Related Provisions.

AT09381: SAM D - Debugging Watchdog Timer Reset. Introduction. SMART ARM-based Microcontrollers APPLICATION NOTE

Pi Gateway Windows 7 Operator Manual

ATECC108/ATSHA204 USER GUIDE. Atmel Firmware Library. Features. Introduction

AN NTAG I²C plus memory configuration options. Application note COMPANY PUBLIC. Rev June Document information

AT03975: Getting Started with SAM L21. Descripton. Features. SMART ARM-Based Microcontroller APPLICATION NOTE

T7 Modbus Communication User Guide

This user guide describes how to run the Atmel ATWINC3400 Bluetooth Low Energy (BLE) Provisioning demo from out-of-box conditions.

Reference Guide VIB 10/11. (VIB 10 pictured) vehicle integration box

AN4872 Application note

INCLUDING MEDICAL ADVICE DISCLAIMER

Transcription:

TURNING TECHNOLOGY INTO ART REFERENCE μdrive (μdrive-μsd-g1) COMMAND SET Document Date: 23 rd October 2012 Document Revision: 4.1 Uncontrolled Copy when printed or downloaded. Please refer to the 4D Systems website for the latest Revision of this document

Contents 1. Host Interface... 3 1.1. Protocol : Flow Control... 3 1.2. Serial Set-up : Auto-Baud... 3 1.3. SD/SDHC Card support... 3 1.4. Power-up and Reset... 4 2. Memory Cards FAT16 Format... 5 3. Set... 6 3.1. General s... 7 3.2. Low-Level (RAW) Disk Drive s... 9 3.3. FAT-Level (DOS) Disk Drive s... 12 4. Legal Notice... 18 5. Contact Information... 18

1. Host Interface The μdrive is a slave peripheral device and it provides a bidirectional serial interface to a host controller via its UART. All communications between the host and the device occur over this serial interface. The protocol is simple and easy to implement, without the overhead of complicated packet-based protocols. Serial Data Format: 8 Bits, No Parity, 1 Stop Bit. Serial data is true and not inverted. 1.1. Protocol : Flow Control The μdrive is a slave device and all communication and events must be initiated by the host. Each command is made up of a sequence of data bytes. When a command is sent to the device and the operation is completed, it will always return a response. For a command that has no specific response the device will send back a single byte called the ACK (06hex), in the case of success, or NAK (15hex), in the case of failure. s having specific responses may send back varying numbers of bytes, depending upon the command and response. It will take the device a certain amount of time to respond, depending on the command type and the operation that has to be performed. If the μdrive receives a command that it does not understand it will reply back with a negative called the NAK (15hex). Since a command is only identified by its ʻpositionʼ in the sequence of data bytes sending incorrect data can result in wildly incorrect operation. 1.2. Serial Set-up : Auto-Baud The μdrive has an auto-baud feature which can automatically detect the host speed and can set its internal baud rate to operate from 300 to 256K baud. Prior to any commands being sent to the module, it must first be initialised by sending the auto-baud character U (55hex) after any power-up or reset. This will allow the module to determine and lock on to the baud rate of the host automatically without needing any further set up. Once the device has locked onto the host baud rate it will respond with an ACK byte (06hex). Auto-Bauding must be performed each time the device is powered up or reset. If the host needs to change the baud rate, the μdrive must be power/reset cycled. The U command cannot be used to change the baud rate during the middle of normal usage. 1.3. SD/SDHC Card support The μdrive supports SD, micro-sd and MMC memory cards via its hardware SPI interface. The Device also supports High Capacity HC memory cards (4GB and above). 2012 Page 3 of 18 www.4dsystems.com.au

1.4. Power-up and Reset When the μdrive device comes out of a power up or external reset, a sequence of events must be observed before attempting to communicate with the module: Allow up to 500ms delay after power-up or reset for the μdrive to settle. Do not attempt to communicate with the device during this period. The device may send garbage on its TX Data line during this period, the host should disable its Rx Data reception. The host transmits the auto-baud character (capital U, 55hex) as the first command so the device can lock onto the host s baud rate. Once the host receives the ACK, the μdrive is now ready to accept Disk Drive commands from the host. 2012 Page 4 of 18 www.4dsystems.com.au

2. Memory Cards FAT16 Format The μdrive can communicate with off the shelf standard SDHC/SD/microSD cards. For any FAT file related operations, before the memory card can be used it must first be formatted with FAT16 option. The formatting of the card can be done on any PC system with a card reader. Select the appropriate drive and choose the FAT16 (or just FAT in some systems) option when formatting. The card is now ready to be used in the μdrive based application. The μdrive also supports high capacity HC memory cards (4Gb and above). The available capacity of SD-HC cards varies according to the way the card is partitioned and the commands used to access it. The FAT partition is always first (if it exists) and can be up to the maximum size permitted by FAT16. Windows will format FAT16 up to 2Gb and the Windows command prompt will format FAT16 up to 4Gb. For the RAW partition, byte reads and writes can access 2^32 (i.e. 4gb) of the card, Sector reads and writes can access 2^24 sectors (of 512 bytes, i.e. 8gb). The total amount of the card usable is the sum of the FAT and RAW partitions. 2012 Page 5 of 18 www.4dsystems.com.au

3. Set The data storage and retrieval takes place via the serial interface. A handful of easy to learn commands provide complete access to the memory card for data reads and writes. The simplified command set also means that very low overheads are imposed on the host controller. s and responses can be either single bytes or many bytes. All commands return a response, either an or data. The command set is grouped into 3 sections: General s Low-Level (RAW) Disk Drive s FAT-Level Disk Drive s Each set is described in detail in the following sections. Separation characters such as commas ',' or spaces ' ' or brackets'(' ')' between bytes that are shown in the command/response syntax descriptors are purely for legibility purposes and must not be considered as part of any transmitted/received data unless specifically stated. 2012 Page 6 of 18 www.4dsystems.com.au

3.1. General s Summary of s in this section: AutoBaud 55hex Version-Device Info Request 56hex FAT Protect - 59hex 3.1.1. Autobaud - 55hex 55(hex) or U(ascii) : header byte 06(hex) : ACK byte This must be the very first command sent to the μdrive after powerup or reset. This will enable the device to lock on to the host baud rate. 3.1.2. Version-Device Info Request - 56hex 3.1.3. FAT Protect - 59hex 56(hex) or V(ascii) : header byte device_type, silicon_rev, pmmc_rev, reserved1, reserved2 device_type 03(hex) : This byte indicates the device type is μdrive silicon_rev This byte indicates the GOLDELOX silicon revision pmmc_rev This byte indicates the PmmC firmware revision reserved1 This byte is reserved for future support. If the value is 0 then ignore it reserved2 This byte is reserved for future support. If the value is 0 then ignore it This command requests all the necessary information from the device about its characteristics and capability., mode, value 59(hex) or Y(ascii) : header byte mode 08(hex) : FAT protection byte value 00(hex) : Protection = OFF 01(hex) : Protection = ON 06(hex) : ACK byte if successful 15(hex) : NAK byte if unsuccessful or card not present This command protects the FAT file system (if present) on the card from being read or written to by low level (RAW) commands. If the memory card contains any FAT (FAT16 or FAT32) partition, when the initialise command is executed or the device comes out of a reset, FAT Protection is turned ON automatically. This means the host will not be able to access the card using Low-Level (RAW) read or write commands unless it subsequently turns off the FAT protection. For a Non Standard card containing two partitions, one FAT and one RAW (Partition type DAhex), the default is ON. In this case FAT reads and writes will occur to the FAT partition and RAW reads and writes will be offset into the RAW partition. i.e. a write to sector 0 will write to sector 0 in the raw partition. 2012 Page 7 of 18 www.4dsystems.com.au

FAT32 is currently not supported. If you mount a FAT32 formatted disk, you will not be able to access it at all, both FAT and RAW commands will fail. You can either reformat the memory card as FAT or unprotect the card and replace sector 0 with 512 hex 00s. 2012 Page 8 of 18 www.4dsystems.com.au

3.2. Low-Level (RAW) Disk Drive s The following commands are related to Low-Level Disk Drive operations and they are described in this section. If the memory card contains any FAT (FAT16 or FAT32) partition, when the initialise command is executed or the device comes out of a reset, FAT Protection is turned ON automatically. This means the host will not be able to access the card using Low-Level (RAW) read or write commands unless it subsequently turns off the FAT protection. Use the FAT Protect command described in section 2.1.3. Summary of s in this section: Initialise Disk Drive Memory Card - @69hex Read Sector Block Data - @52hex Write Sector Block Data - @57hex Set Memory Address Pointer @41hex Read Byte Data - @72hex Write Byte Data - @77hex 3.2.1. Initialise Disk Drive Memory Card - @69hex ext_, ext_ 40(hex) or @(ascii) : Extended header byte 69(hex) or i(ascii) : header byte 06(hex) : ACK byte if successful 15(hex) : NAK byte if unsuccessful or card not present or if there is no RAW partition and the FAT protection is turned ON. This command initialises the memory card. The memory card is always initialised upon Power- Up or Reset cycle, if the card is present. If the card is inserted after the power up or a reset then this command must be used to initialise the card. If there is any FAT (FAT16 or FAT32) partition on the card, using this command will automatically protect the card and turn FAT Protection ON. This is implemented for safety reasons so that any important information in the card is not overwritten. The μdrive will not respond to any of the Low-Level (RAW) commands in this section until FAT protection is turned OFF. Use the FAT Protect command described in section 2.1.3. Note! There is no card insert/remove auto detect facility. This command is duplicated also in section 2.3. It is the same command, there is no difference. 3.2.2. Read Sector Block Data - @52hex ext_,, SectorAdd(hi:mid:lo) ext_ 40(hex) or @(ascii) : Extended header byte 52(hex) or R(ascii) : header byte SectorAdd A 3 byte sector address (big endian). Sector Address range from 0 to 16,777,215 depending on the capacity of the card. Each sector is 512 bytes in size. There are 2048 sectors per every 1Mb of card memory. data(1..512) data 512 bytes of sector data This command will return 512 bytes of data relating to a sector. 2012 Page 9 of 18 www.4dsystems.com.au

3.2.3. Write Sector Block Data - @57hex ext_,, SectorAdd(hi:mid:lo), data(1..512) ext_ SectorAdd data 40(hex) or @(ascii) : Extended header byte 57(hex) or W(ascii) : header byte A 3 byte sector address (big endian) 512 bytes of sector data. Data length must be 512 bytes. 06(hex) : ACK byte if successful 15(hex) : NAK byte if unsuccessful or card not present or if there is no RAW partition and the FAT protection is turned ON. This command allows downloading and writing blocks of sector data to the card. The data block must always be 512 bytes in length. For large volumes of data such as images, the data must be broken up into multiple sectors (chunks of 512 bytes) and this command then maybe used many times until all of the data is written. If the data block to be written is less than 512 bytes in length, then make sure the rest of the remaining data are padded with 00hex or FFhex (it can be anything). If only few bytes of data are to be written then the Write Byte command can be used. Once this command is sent, the device will take a few milliseconds to write the data into its memory card and at the end of which it will respond. Only data(1..512) are written to the sector. Other bytes in the command message do not get written. 3.2.4. Set Memory Address Pointer - @41hex ext_,, Address(Umsb:Ulsb:Lmsb:Llsb) ext_ Address 40(hex) or @(ascii) : Extended header byte 41(hex) or A(ascii) : header byte A 4 byte card memory address (big endian) for byte wise access. 06(hex) : ACK byte if successful 15(hex) : NAK byte if unsuccessful or card not present or if there is no RAW partition and the FAT protection is turned ON. This command sets the internal memory address pointer for byte wise reads and writes. After a byte read or write, the memory Address pointer is automatically incremented internally to the next byte address location. 3.2.5. Read Byte Data - @72hex ext_, ext_ data_byte data_byte 40(hex) or @(ascii) : Extended header byte 72(hex) or r(ascii) : header byte 1 byte of card data This command provides a means of reading a single byte of data back from the card. Before this command can be used, memory address location must be set using the Set Memory Address command. Once this command is sent, the device will return 1 byte of data relating to that memory location set by the memory address pointer. The memory address location pointer is automatically incremented to the next byte address location. 2012 Page 10 of 18 www.4dsystems.com.au

3.2.6. Write Byte Data - @77hex ext_,, data ext_ data 40(hex) or @(ascii) : Extended header byte 77(hex) or w(ascii) : header byte 1 byte of card data 06(hex) : ACK byte if successful 15(hex) : NAK byte if unsuccessful or card not present or if there is no RAW partition and the FAT protection is turned ON. This command permits writing single bytes of data to the card. This is useful for writing small chunks of data at irregular intervals quickly. For large data blocks it is more efficient to use the Write Sector Data command described previously. Before this command can be used, the card memory address location must be set using the Set Memory Address command. Once the Write Byte command is sent, a single byte of data will be stored to that memory location set by the memory address pointer. The memory address pointer is automatically incremented to the next location. Only the data byte is written. Other bytes in the command message are not stored. 2012 Page 11 of 18 www.4dsystems.com.au

3.3. FAT-Level (DOS) Disk Drive s The following commands are related to FAT-Level Disk Drive operations and they are described in this section. If the memory card contains a FAT (or FAT32) partition when the initialise command is executed, FAT Protection is turned ON automatically. This means the host will not be able to access the card using Low-Level (RAW) read or write commands unless it subsequently turns off the FAT protection. FAT32 is currently not supported, if you mount a FAT32 formatted disk, you will not be able to access it at all, both FAT and RAW commands will fail. You can either reformat the memory card as FAT or unprotect the card and replace sector 0 with 512 hex 00s. FAT16 is referred to as FAT throughout this documentation. At the time of writing, FAT32 is not supported. Future FAT32 card support is currently planned. Summary of s in this section: Read File - @61hex Write File - @74hex Erase File - @65hex List Directory - @64hex Initialise Disk Drive Memory Card @69hex 3.3.1. Read File - @61hex ext_,, handshaking, file_name, terminator ext_ 40(hex) or @(ascii) : Extended header byte 61(hex) or a(ascii) : header byte handshaking How often the host sends an ACK(06hex) to request more data during transmission:- 00 No handshaking, Use only for small files (<= 512 bytes) 01 Once for each byte 02 Once for each two bytes... 50(32hex), maximum allowed file_name The filename is 1-12 chars long with an assumed '.' between chars 8 and 9, if there is not one specified in the filename. terminator The file_name string must be terminated with a NULL, 00(hex). file_size(umsb:ulsb:lmsb:llsb), file_data(1...n), file_size 4 bytes of file size (big endian format). file_data Complete file data block : No Handshaking Block of file data : block size determined by value set in handshaking. 06(hex) : ACK byte if successful 15(hex) : NAK byte if unsuccessful Using this command, the host can read a DOS compatible (FAT) file from the memory card. Because the time taken to process the read bytes varies, a technique is required to ensure that the host communications buffer does not overflow and data is not lost. This is implemented by a simple handshaking protocol where the μdrive will break up the file into smaller data blocks. When the host receives a block, it sends an ACK(06hex) to request the next block of data. The size of the data block is initially set by the host in the command packet, specified by the value in the handshaking byte. The larger the value the better, as long as the host system can buffer the incoming block size. Setting this value too low will slow the transfer. The first 4 bytes sent by the device, after receiving the command packet, represent the size of the requested file (Umsb:Ulsb:Lmsb:Llsb). The host then responds with an ACK(06hex) to 2012 Page 12 of 18 www.4dsystems.com.au

indicate it wants the file, or NAK(15hex) if it wishes to terminate the receive. The first block of data bytes (block size set by the handshaking value) of the file are then sent from the device, the host then responds with another ACK(06hex) to receive the next block of bytes. This process continues until all of the file data has been received. The device responds with a final ACK if the transfer completes successfully, otherwise it responds with a NAK. The final ACK is not part of the handshaking. Diagram 1: Read File No Handshaking Diagram 2: Read File - Handshaking other than 0 2012 Page 13 of 18 www.4dsystems.com.au

3.3.2. Write File - @74hex ext_,, options, file_name, terminator, filesize(umsb:ulsb:lmsb:llsb), file_data(1.. N) ext_ options 40(hex) or @(ascii) : Extended header byte 74(hex) or t(ascii) : header byte Controls handshaking (how often the device sends an ACK to request more data from the host) and whether an existing file is appended to. Handshaking: 00 No handshaking, limit this to small files (<= 100 bytes) 01 Once for each byte 02 Once for each two bytes... 50(32hex), maximum allowed file_name terminator file_size file_data Append Mode: 00(hex) No Append, file will be created (or overwritten if it exists). 80(hex) Append mode, file will be appended to (or created if it doesn t exist). Performance Mode: 00(hex) High performance. Two ACKS will be sent after the filesize. This keeps transmission running at a high speed, as no time is spent waiting for the return ACK. The same total number of ACKs doesn t change (i.e the last ACK is missing). For simple un-buffered serial ports this may lead to loss of the second ACK. 40(hex) Low performance. Only a single ACK is sent at a time. This is for unbuffered serial port controllers. Note: The three options are added, or ORed together to produce the final options, e.g. 82(hex) would indicate handshaking for every two bytes in High Performance and Append mode. The filename is 1-12 chars long with an assumed '.' between chars 8 and 9, if there is not one specified in the filename. The file_name string must be terminated with a NULL, 00(hex). 4 bytes of file size (big endian format). Complete file data block : No Handshaking Block of file data : block size determined by value set in handshaking. 06(hex) : ACK byte if successful 15(hex) : NAK byte if unsuccessful This command allows the host to write a DOS compatible (FAT) file to the memory card. The μdrive serial port (UART), has a buffer size of 100 bytes for capturing incoming data from the host. If this buffer fills up and overflows, data will be lost. Therefore the host must allow the device enough time to write its buffer to the memory card so it can then receive further file data from the host. For small files (less than 100 bytes in the append mode) the host can send the complete file data in one attempt. However, for larger files a simple handshaking protocol is implemented where the host sends the file data in small blocks. Using this handshaking method, the host always waits for an ACK from the device before sending the next block of data. The size of the data block is initially set by the host in the command packet, specified by the handshaking value in the options byte. The larger the value the better. Setting it too low will slow the transfer. The first ACK is always sent by the device, after the filesize parameter is transmitted by the host, or this could also be a NAK in which case one of the parameters is invalid or a file system error occurred. Note: Do not set handshaking to zero if the file size is larger than 100 bytes. 2012 Page 14 of 18 www.4dsystems.com.au

Diagram 3: Write File - No Handshaking Illustration 4: Write File - Handshaking Other than 0 2012 Page 15 of 18 www.4dsystems.com.au

3.3.3. Erase File - @65hex ext_,, file_name, terminator ext hdr file_name terminator 40(hex) or @(ascii) : Extended header byte 65(hex) or e(ascii) : header byte The filename is 1-12 chars long with an assumed '.' between chars 8 and 9, if there is not one specified the filename. The file_name string must be terminated with a NULL, 00(hex) 06(hex) : ACK byte if file deleted successfully 15(hex) : NAK byte if file not found or an error has occurred Erases the file specified in the file_name. 3.3.4. List Directory - @64hex ext_,, file_name, terminator ext hdr file_name terminator 40(hex) or @(ascii) : Extended header byte 64(hex) or d(ascii) : header byte The filename is 1-12 chars long with an assumed '.' between chars 8 and 9, if there is not one specified the filename. Wild cards such as '*' and '?' are allowed. The file_name string must be terminated with a NULL, 00(hex) filename1, delimiter,.., filenamen, delimiter, filename Character string of the file name in the memory card. Maximum of 12 character bytes (including '.' separator) are returned in the string for the file name. This will be repeated for all files in the directory. An empty directory with no files or the result of an unsuccessful file name or wild card search will only return an ACK. Note: At present the μdrive only supports a single directory structure. Future enhancements will support nested directories. delimiter 0A(hex) : newline 06(hex) : ACK byte if successful 15(hex) : NAK byte if an error has occurred Returns a directory listing (stream of characters) consisting of the files names matching the file_name delimited by a Newline(0Ahex) character. Always responds with an ACK at the completion of a listing. Responds with a NAK if a file error occurs. An empty directory with no files or the result of an unsuccessful file name or wild card search will only return an ACK. 3.3.5. Initialise Disk Drive Memory Card - @69hex ext_, ext_ 40(hex) or @(ascii) : Extended header byte 69(hex) or i(ascii) : header byte 06(hex) : ACK byte if successful 15(hex) : NAK byte if unsuccessful or card not present This command initialises the memory card. The memory card is always initialised upon Power- Up or Reset cycle, if the card is present. If the card is inserted after the power up or a reset 2012 Page 16 of 18 www.4dsystems.com.au

then this command must be used to initialise the card. If there is any FAT (FAT16 or FAT32) partition on the card, using this command will automatically protect the card and turn FAT Protection ON. This is implemented for safety reasons so that any important information in the card is not overwritten. The μdrive will not respond to any of the Low-Level (RAW) commands in this section until FAT protection is turned OFF. Use the FAT Protect command described in section 2.1.3. Note! There is no card insert/remove auto detect facility. This command is duplicated also in section 2.2. It is the same command, there is no difference. 2012 Page 17 of 18 www.4dsystems.com.au

4. Legal Notice Proprietary Information The information contained in this document is the property of 4D Systems Pty. Ltd. and may be the subject of patents pending or granted, and must not be copied or disclosed without prior written permission. 4D Systems endeavours to ensure that the information in this document is correct and fairly stated but does not accept liability for any error or omission. The development of 4D Systems products and services is continuous and published information may not be up to date. It is important to check the current position with 4D Systems. 4D Systems reserves the right to modify, update or makes changes to Specifications or written material without prior notice at any time. All trademarks belong to their respective owners and are recognised and d. Disclaimer of Warranties & Limitation of Liability 4D Systems makes no warranty, either expressed or implied with respect to any product, and specifically disclaims all other warranties, including, without limitation, warranties for merchantability, non-infringement and fitness for any particular purpose. Information contained in this publication regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. In no event shall 4D Systems be liable to the buyer or to any third party for any indirect, incidental, special, consequential, punitive or exemplary damages (including without limitation lost profits, lost savings, or loss of business opportunity) arising out of or relating to any product or service provided or to be provided by 4D Systems, or the use or inability to use the same, even if 4D Systems has been advised of the possibility of such damages. 4D Systems products are not fault tolerant nor designed, manufactured or intended for use or resale as on line control equipment in hazardous environments requiring fail safe performance, such as in the operation of nuclear facilities, aircraft navigation or communication systems, air traffic control, direct life support machines or weapons systems in which the failure of the product could lead directly to death, personal injury or severe physical or environmental damage ( High Risk Activities ). 4D Systems and its suppliers specifically disclaim any expressed or implied warranty of fitness for High Risk Activities. Use of 4D Systems products and devices in 'High Risk Activities' and in any other application is entirely at the buyer s risk, and the buyer agrees to defend, indemnify and hold harmless 4D Systems from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any 4D Systems intellectual property rights. 5. Contact Information For Technical Support: support@4dsystems.com.au For Sales Support: sales@4dsystems.com.au Website: www.4dsystems.com.au Copyright 4D Systems Pty. Ltd. 2000-2012. 2012 Page 18 of 18 www.4dsystems.com.au