GHI Electronics
FFALFAT SoC Processor
Document Revision History
Rev No. Date
Modification
Rev 2.16 11/30/15 Updated product images
Rev 2.15 10/29/15 Clarified NOP and removed a note about a resistor
Rev 2.14 01/07/15 Simpler banner pseudo code
Rev 2.13 12/03/14 Flow chart, cross-references fixed, OEM Module pinout
clarification,...
Rev 2.12 11/03/14 Misc. changes
Rev 2.11 08/18/14 Micro seconds (Forum 16434)
Rev 2.10 07/21/14 Micro seconds (Forum 16205)
Rev 2.09 06/18/14 SPI max speed, resisters → resistors (Forum 15978)
Rev 2.08 06/18/14 Fixed error in write command syntax description
Rev 2.07 06/02/14 Added need for initialization to free size command (K)
Rev 2.06 05/20/14 Moved some SPI interface sections to proper position
Rev 2.05 05/08/14 Added ALFAT-EVAL / Evaluation Kit
Rev 2.04 04/30/14 Changed wording in description of Z 2>1 example
Rev 2.03 04/03/14 VCAPs from 22uF to 2.2uF
Rev 2.02 04/03/14 ALFAT-SDR
Rev 2.01 03/25/14 More work on SPI interface
Rev 2.00 03/10/14 Preliminary document (for Beta firmware 2.0.0)
Man. Rev. 2.16
Page 2 of 68
www.ghielectronics.com
GHI Electronics
FFALFAT SoC Processor
Table of Contents
1 Introduction.................................................................................................................................. 5
1.1. ALFAT System-on-a-Chip (Soc) Overview................................................................................................................5
1.2. Example applications ............................................................................................................................................. 6
1.3. Key Features............................................................................................................................................................ 6
2 Terminology.................................................................................................................................. 7
3 Operating Modes.......................................................................................................................... 8
3.1. Default Mode............................................................................................................................................................ 8
3.2. SD-Reader Mode...................................................................................................................................................... 9
4 USB Keyboard Access...............................................................................................................10
5 Architecture................................................................................................................................. 11
5.1. Commands............................................................................................................................................................. 11
5.2. FAT File-System Engine......................................................................................................................................... 11
5.3. Memory Card Access (SDHC, SD or MMC)...........................................................................................................12
5.4. USB Host Connections........................................................................................................................................... 12
5.5. Bootloader.............................................................................................................................................................. 12
5.6. Package and Pin-Out............................................................................................................................................. 13
6 Selecting the ALFAT Access Interface. Reset/Booting................................................................17
6.1. Interface Mode Selection........................................................................................................................................ 17
6.2. Boot/Reset Protocol................................................................................................................................................ 18
6.3. UART Interface Mode............................................................................................................................................. 18
6.3.1 UART Configuration...................................................................................................................................... 19
6.4. SPI Interface Mode................................................................................................................................................. 19
6.4.1 SPI Bus Configurations................................................................................................................................. 19
6.4.2 SPI Frames................................................................................................................................................... 20
6.4.2.1. Write Frames......................................................................................................................................... 20
6.4.2.2. Read-Request Frames.......................................................................................................................... 23
6.5. I2C Interface Mode................................................................................................................................................. 25
6.5.1 I2C Bus Configuration................................................................................................................................... 25
7 ALFAT Command Set.................................................................................................................27
7.1. Introduction............................................................................................................................................................. 27
7.2. Terminology and Syntax of Command Definitions:.................................................................................................27
7.3. Summary of All Available Commands:.................................................................................................................... 30
7.4. Full Syntax and Definition of Commands...............................................................................................................30
7.4.1 V - Get Version Number ............................................................................................................................... 30
7.4.2 # - Enable Echo............................................................................................................................................ 31
7.4.3 Z - ALFAT Control......................................................................................................................................... 31
7.4.4 T - Initialize Real Time Clock........................................................................................................................ 33
7.4.5 S - Set Current Time and Date..................................................................................................................... 33
7.4.6 G - Get Current Time and Date..................................................................................................................... 34
7.4.7 B - Set UART Baud Rate.............................................................................................................................. 34
7.4.8 I - Initialize and Configure Devices...............................................................................................................35
7.4.9 J - Read Register.......................................................................................................................................... 38
7.4.10 K - Get Free Size........................................................................................................................................ 40
7.4.11 @ - Initialize Files and Folders List.............................................................................................................40
7.4.12 N - Get Next Directory Entry....................................................................................................................... 41
7.4.13 O - Open File for Read, Write or Append....................................................................................................42
7.4.14 R - Read from File...................................................................................................................................... 43
7.4.15 W - Write to File.......................................................................................................................................... 45
7.4.16 L - Fast Write to File (SPI mode only).........................................................................................................46
7.4.17 F - Flush File Data...................................................................................................................................... 47
7.4.18 C - Close File.............................................................................................................................................. 47
7.4.19 P - File Seek............................................................................................................................................... 48
7.4.20 Y - File Tell.................................................................................................................................................. 49
7.4.21 D - Delete File or Folder.............................................................................................................................. 49
7.4.22 ? - Find File or Folder.................................................................................................................................. 50
7.4.23 M - Copy From File to Another.................................................................................................................... 51
7.4.24 A - Rename file........................................................................................................................................... 52
7.4.25 E - Test Media Speed.................................................................................................................................. 52
7.4.26 Q – Format.................................................................................................................................................. 53
7.4.27 <LF> – No Operation (NOP)....................................................................................................................... 53
8 The Bootloader........................................................................................................................... 54
8.1. General Description................................................................................................................................................ 54
Man. Rev. 2.16
Page 3 of 68
www.ghielectronics.com
GHI Electronics
FFALFAT SoC Processor
8.2. Connecting and Controlling the Bootloader............................................................................................................54
8.3. Firmware Updater Application................................................................................................................................ 54
8.4. Bootloader Commands........................................................................................................................................... 56
8.5. Updating the Firmware Using a Terminal Console.................................................................................................56
9 Hardware integration guide........................................................................................................59
9.1. Power Source......................................................................................................................................................... 59
9.2. Crystals................................................................................................................................................................... 59
9.3. Card Detect and Write Protect signals................................................................................................................... 59
9.4. Full-Speed / High-Speed with ULPI PHY................................................................................................................60
9.5. Real Time Clock..................................................................................................................................................... 60
9.6. Bootloader Access.................................................................................................................................................. 60
9.7. Electrical characteristics......................................................................................................................................... 60
10 ALFAT Off-the-shelf Circuit Boards...........................................................................................61
10.1. OEM Board Pin-outs............................................................................................................................................. 61
10.2. ALFAT OEM Board............................................................................................................................................... 62
10.3. ALFAT SD Board.................................................................................................................................................. 62
10.4. ALFAT USB Board................................................................................................................................................ 62
10.5. ALFAT SDR Board................................................................................................................................................ 63
10.6. ALFAT Evaluation Kit............................................................................................................................................ 63
11 Performance............................................................................................................................. 64
11.1. Selecting the Right Storage Media....................................................................................................................... 64
11.2. File Access Speed................................................................................................................................................ 64
11.3. Serial Interface Speed Overhead......................................................................................................................... 65
12 Result-codes............................................................................................................................ 66
13 DISCLAIMER........................................................................................................................... 68
Man. Rev. 2.16
Page 4 of 68
www.ghielectronics.com
GHI Electronics
FFALFAT SoC Processor
1 Introduction
1.1. ALFAT System-on-a-Chip (Soc) Overview
Creating embedded systems that access FAT file-systems require precious resources to
host the needed libraries; developers need to spend significant amount of time writing and
testing the libraries. Add to that the hardware costs, both physical parts and circuit
complexity, to interface the FAT file-system library with the storage media. In the end,
investment costs of product development becomes prohibitive. With the ALFAT SoC, any
system can quickly and easily access files on SD cards and USB memory devices. ALFAT
uses simple serial commands over UART, SPI or I2C to manage and access FAT
formatted SD Cards and USB storage devices. The ALFAT SoC processor is capable of
accessing two USB mass storage devices and one SD memory card simultaneously.
ALFAT's USB driver also supports USB Keyboards.
ALFAT includes two modes of operation, default and SD-Reader modes. They are covered
in detail in the
Operating Modes
section.
ALFAT developers can take advantage of the “ALFAT Evaluation Kit,” a 100% complete set
of components for investigating ALFAT. The Kit includes a number of ALFAT Off-the-shelf
Circuit Boards.The included software, “ALFAT Explorer”, controls the working ALFAT
directly from a Windows PC. Source code of the “ALFAT Explorer” is shipped with the Kit.
Within ten minutes, the hardware can be assembled into a fully functional ALFAT.
Man. Rev. 2.16
Page 5 of 68
www.ghielectronics.com