Home
µALFAT User Manual
Contents
1. Format Z lt sp gt F gt Xxxxx lt cr gt Full power 00 lt cr gt xxxx is Baudrate 2 Bytes 00 lt cr gt First 00 is sent before changing power Second 00 is sent after changing power Z lt sP gt R gt XXXX lt CR gt Reduced power 00 lt cr gt xxxx is Baudrate 2 Bytes 00 lt cr gt First 00 is sent before changing power Second 00 is sent after changing power Z lt sp gt H lt cr gt Hibernate Mode 00 lt cr gt First 00 is sent before Hibernating 00 lt cr gt Second 00 is sent after Hibernating T Initialize Timer Format T lt sp gt S lt cr gt Share Mode The RTC runs from the 00 lt cr gt same processor clock T lt sp gt B lt cr gt Backup Mode Run RTC from 32Khz 00 lt cr gt external crystal and battery so it will keep the time even if the processor power is off S Set Current Time and Date Format S lt sp gt ddddtttt lt cr gt dddditttt time and date 32bit structure 100 lt cr gt Example S lt sp gt 34210000 lt cr gt Set 1 1 2006 00 00 00 100 lt cr gt Rev 3 11 Page 22 of 48 www ghielectronics com GHI Electronics LLC UALFAT User Manual UALFAT Commands Set G Get Current Time and Date Format G lt sp gt X lt cr gt Get 32bit standard time and date 00 lt cr gt structure ddddtttt lt cr gt 100 lt cr gt Format G lt sp gt F lt cr gt Get time and date in a formatted 00 lt cr gt string MM DD IYYYY lt SP gt lt SP g
2. Tera Term Serial port setup r come o Baud rate 9600 X Data 8 bit X Cancel Parity none Dd stop S Elow control none Ad Transmit delay 0 msecj char 0 msecjline Rev 3 11 Page 17 of 48 www ghielectronics com GHI Electronics LLC UALFAT User Manual Getting Started with uALFAT 3 Select to receive a line end with the line feeds LF CR because UALFAT only sends CR For transmitting only CR should be sent Tera Term Terminal setup x Terminal size Newline 90 x 35 Receive CR LF Lo J Term size win size Transmit cA Cancel Auto window resize Terminal ID vr100 Local echo Help Answerback Auto switch T lt gt TEK Kanji receive Kanji transmit UTF 8 UTF 8 gt SB bit katakana bit katakana B locale american CodePage 65001 4 Reset the chip and you will get the GHI electronics starting banner GHI Electronics LLC Boot Loader x xx UALFAT TM x xx 100 5 To update firmware please refer to boot loader chapter in this document First Look The commands and responses in pALFAT are made in a way were they can be understood easily and entered manually and also can be parsed by a simple 8 bit microcontroller Each command is one character Some commands take parameters and others don t For example V command doesn t take any parameters and it returns the version number On the other hand M requires a pa
3. UALFAT Commands Set 00 lt cr gt 01 lt cR gt 00 lt cr gt 7 FAT and Long File Name Support 7 1 Short and Long File Names Earlier FAT File Systems used short file names noted as 8 3 which have the following features e ASCII format e Only capital letters e Maximum of 8 characters for the file name e Maximum of 3 characters for the file extension e No spaces are allowed e Only one dot is allowed preceding the file extension e Numbers are allowed e The following characters are allowed _ amp All these limitation were not appropriate for newer applications Longer names and extensions were required additional characters amp symbols and international languages were needed Long File Name LFN technology by Microsoft was the next addition to the FAT File System and it was a major restructure for how the directory entires are handled yet it was backward compatible LFN does not have most of the prior limitations and supports International Languages It supports the following features e Unicode format which enables International languages and many more characters amp symbols e Capital and small letters e Limit of 255 Unicode characters 2 bytes each character e Multiple periods and spaces are allowed but they do not appear at the beginning or end e New characters are allowed Every Long File Name in the new FAT system has an associated unique short name Rev
4. is low Also when sending WAKE deep sleep command a toggle on this pin will wake up UALFAT 45 UH_GPX USB host GPX 46 UH_INT USB host interrupt All pins that are not listed in the table above must be left unconnected Always consult uALFAT SD schematics Pins ending with the symbol are active low Rev 3 11 Page 11 of 48 www ghielectronics com GHI Electronics _LLC UALFAT User Manual Commanding pALFAT 4 Commanding pALFAT 4 1 Selecting an Interface UALFAT uses UART I2C or SPI to communicate with any external microcontroller At power up UALFAT samples SPl_SSEL and SPI_SCK pins to determine what interface to use The following table describes the states SPI_LSSEL SPI_SCK Interface 0 UART 0 1 Stay in boot loader 1 0 I2C 1 1 SPI In this mode the boot loader will not execute the firmware and will run UART at 9600 baud 4 2 UART Interface In UART interface mode UART_TX pin is used to send data to your microcontroller and UART_RX pin to receive commands from your microcontroller The default baud rate for UART is 9600 Always use 8 bit with no parity and 1 stop bit Baud rate can be changed through the commands CTS and RTS lines must be used to insure no data loss at high speeds CTS pin is an input to UALFAT and when it is high uALFAT will not send data and will wait for it to go low CTS should be low as long as possible to not slow down pALFAT RTS pin is output from YALFAT and it is s
5. operator see FAT LEN section Example L lt sp gt A lt cr gt Passing L command two times 00 lt cr gt and getting the results 00 lt sP gt 0000FE34 lt sp gt 0015 lt cr gt Test0001 2007 Mar TXT 100 lt cr gt L lt sp gt A lt cR gt 00 lt cr gt 00 lt sP gt 0000F 134 lt sp gt 001 5 lt cr gt Test0002 2007 Mar TXT 00 lt cr gt lt cr gt Go to the first list entry 00 lt cr gt L lt sp gt A lt crR gt Reading file named VOL with 00 lt cr gt ASCII characters 00 lt sp gt 0000FE34 lt sp gt 0003 lt cr gt VOL Rev 3 11 Page 27 of 48 www ghielectronics com GHI Electronics LLC UALFAT User Manual UALFAT Commands Set 00 lt cr gt cr gt Go to the first list entry again 00 lt cr gt L lt sp gt lt CR gt Reading the same file VOL using 00 lt cr gt the operator 00 lt sp gt 0000FE34 lt sp gt 000C lt cr gt 0056004F004C 00 lt cr gt File Attributes are one byte Standard Attribute Structure in FAT system 7 6 5 4 3 2 1 0 Reserved Archive Folder Volume System Hidden Read ID Only M Make Directory Creates a folder Format M lt sp gt foldername lt cr gt 00 lt cr gt Example M lt sp gt MYFOLDER lt cr gt Create a folder with name MYFOLDER 00 lt cr gt A Change Directory Changes the current working directory folder It accesses a another folder in the File System Folders tree
6. 100 UALFAT accepted the write command 12 123V User sent 7 bytes 00000007 7 bytes were written successfully 100 Command successful W 2 gt A Request writing 10 bytes to the second file 100 UALFAT accepted the write command 1234567890 User sent 10 bytes 0000000A 10 bytes were written successfully 100 Command successful C1 Close first file 100 Command successful C2 Close second file 100 Command successful Rev 3 11 Page 38 of 48 www ghielectronics com GHI Electronics _LLC UALFAT User Manual FAT and Long File Name Support 8 HALFAT Boot Loader 8 1 General Description The boot loader is used to update the firmware of uALFAT When there is a new firmware release you can simply download the file from the website put it on a storage media and using simple commands UALFAT can update itself through the firmware or Boot Loader The boot loader samples SPI_SCK and SPI_SSEL at power up and it determines if it is going to run the firmware or stay in boot loader for other commands These pins are explained in Commanding pALFAT section If the boot loader become active it will enable UART mode at 9600 and will send BL signaling the boot loader is ready Now you can send commands manually 8 2 Firmware Update The easiest way to update pALFAT is by placing the new firmware on any SD MMC card or USB memory The file must be placed in the root directory not under any folder Formatting the media before placing the firmware is re
7. Command Description Use R Load and run pALFAT If Boot loader returned BL then reprogramming firmware UALFAT is required LOK Load firmware file from the Returns error code xx connected SD MMC card LOU Load firmware from the Returns error code xx connected USB memory WR Write one sector to internal Follow WR by the sector number then 512 bytes FLASH of sector data Transaction must be terminated by a checksum byte Checksum byte is calculated by adding all 512 data bytes Only WR is ASCII For GHI internal use only V Returns the loader version Returned value is ASCII Note The boot loader is entirely separate program that loads pALFAT firmware The version number of the boot loader may not match the version number of UALFAT Rev 3 11 Page 40 of 48 www ghielectronics com GHI Electronics LLC UALFAT User Manual Power Modes 9 Power Modes UALFAT has three power modes Full Reduces and Hibernate modes Full When executing the boot loader or the firmware UALFAT runs in full power mode In this mode UALFAT draws about 38mA including 1 8V regulator and the core runs at 70Mhz Reduced If low power is required you can run UALFAT at reduced power where the core runs at 10 MHz In this mode the complete UALFAT SD OEM board draws about 8mA When changing the clock speed you have to keep many things in mind For example the SPI clock can be the system clock divided by 8 maximum So
8. Format A lt sp gt foldername lt cr gt 00 lt cr gt Example A lt sp gt MYFOLDER lt cr gt Change the working directory to 00 lt cr gt MYFOLDER O Open a File for Read Write or Append The command requires a file handle and a access mode Open Modes are e R Open for read requires the file to exist in the current working directory e W Open for write will create a new file and give write privileges to it If the file already exists it will be erased and re written e A Open for append will write data to the end of the file If the file does not exist it will be created Rev 3 11 Page 28 of 48 www ghielectronics com GHI Electronics LLC UALFAT User Manual UALFAT Commands Set UALFAT has 4 available file handles Each file once opened must be associated with a handle Closing the file would make the handle available again Note UALFAT can access any file and can access unlimited number of files The limitation is 4 simultaneous opened files but a handle can be closed then used to open any other file Use W command to write to the file and R to read from the file The file must be flushed F command or closed C command when done to make sure all buffered data are written to the storage media Otherwise the file and or the file system might get corrupted Format Ox lt sp gt nM gt filename lt cr gt Open file filename and associate it 100 lt cr gt with handle n and access mode M n can
9. Mass Storage device protocol not supported A2 Mass Storage device subclass not supported A3 Invalid sense A4 Mass Storage device invalid response A5 Mass Storage device not found B1 HCD is busy B2 HCD bad request B3 HCD undefined error B4 HCD NACK B5 HCD stall B6 HCD toggle error B7 HCD wrong PID B8 HCD bad BS B9 HCD bad PID BA HCD pad packet BB HCD CRC error BC HCD K error BD HCD J error BE HCD timeout BF HCD babble co Name too long C1 Lead character is invalid C2 Trail character is invalid C5 Max names reached DO Bad address range D1 Flash not blank Rev 3 11 Page 46 of 48 www ghielectronics com GHI Electronics _LLC UALFAT User Manual Error Codes Error Description HEX D2 Error verify D3 Internal error D4 Checksum error D5 Erase failed D6 Broken active sequence D7 Invalid firmware D8 Bad command DA Empty file DB File not found DE Unknown command E5 Device not found FO Unexpected value FD Unknown command These error codes are for GHI internal use Please contact GHI with error number and steps to reproduce the same error Rev 3 11 Page 47 of 48 www ghielectronics com GHI Electronics LLC UALFAT User Manual DISCLAIMER DISCLAIMER IN NO EVENT SHALL GHI ELECTRONICS LLC OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT INDIRECT INCIDENTAL SPECIAL EXEMPLARY OR CONSEQUENTIAL DAMAGES INCLUDING BUT NOT LIM
10. file handle 0 1 2 or 3 Handles give fast access to a file If a user needs to log data to 2 files at the same time VOLTAGE LOG and CURRENT LOGC file handles become very useful To do so open VOLTAGE LOG under handle 1 and CURRENT LOG under handle 2 Now start sending your data to handle 1 and 2 instead of the file names Note pALFAT can access any file and can access unlimited number of files The limitation is 4 simultaneous opened files but a handle can be closed then used to open any other file Example Opening a file VOLTAGE LOG O 1W VOLTAGE LOG Rev 3 11 Page 37 of 48 www ghielectronics com GHI Electronics LLC UALFAT User Manual FAT and Long File Name Support The previous command will create new file in the current directory with name VOLTAGE LOG and the file handle is 1 To save data to the file you can use W 1 gt 10 Which writes 16 bytes to file handle 1 0x10 hexadecimal is 16 decimal YALFAT responds with 00 This indicates that uALFAT is ready for your data Now start sending the 16 bytes of data When all data is sent UALFAT will return another error code Session Description MLOG_DATA Create new directory 100 Command successful ALOG_DATA Change directory 100 Command successful O 1W gt VOLTAGE LOG 100 Create file for writing Command successful O 2W gt CURRENT LOG Create another file for writing 100 Command successful W 1 gt 7 Request writing 7 bytes to the first file
11. if the system is in reduced power mode running at 10 MHz the SPI SCK can be 1 25 MHz maximum Also the UART baud rate needs to be adjusted to hold the correct divider value Look at B command for more details on the divider values The command to change the power mode is Z Switch to run at 70 MHz and set the UART baud rate to 9600 Z F gt DCEF Set the system to run at 10 MHz and baud rate of 9600 Z R gt 1FAB Now what if we are using SPI or 12C interfaces Even in this case you are required to set the UART divider and you can use any one of the values Hibernate Hibernation is also another option If the system doesn t need any file operations UALFAT can hibernate and the core draws about 10uA Keep in mind that regulators have their own current draw UALFAT SD board draws 1mA when it is in hibernate mode When pALFAT goes in hibernation mode it can be woken up by toggling the WAKE pin This in is multi purpose and must always be left disconnected from your system except when there is a need to wake UALFAT This can be accomplished by setting the pin of Rev 3 11 Page 41 of 48 www ghielectronics com GHI Electronics _LLC UALFAT User Manual Power Modes your micro that connects to WAKE to be input When there is a need to wake HALFAT set your pin to output low wait for a few micro seconds and then set the pin back to input Note changing the system clock effects the real time clock RTC After Changing power
12. mechanism to handle this issue Two special numbers are used to handle the flow control OxFF and we will call it NDT No Data Token and OxFE and will call it HDT Half Data Token Whenever pALFAT SPI sees NDT again it is OxFF it will ignore it This allows you to read UALFAT without sending data Of course you are sending NDT but it will be ignored by pALFAT SPI driver This is everything you need to do if you are using numbers from 0 to OxFD Usually this is good in most cases as UALFAT commands are ASCII based and most users save files as ASCII text If you need to send OxFF to UALFAT you have to send HDT followed by any number between 0x00 and OxFD pALFAT will understand this as real OxFF number and will not ignore it For OxFE you have to send HDT followed by a second HDT Here is a simple example in C language on how your transmit routine should work SendData char c if c OxFF SendSPI 0xFE SendSP 0 else if c OxFE SendSPI 0xFE SendSPI 0xFE yelse SendSPI c If polling is preferred it is possible to keep polling ALFAT and not check DATARDY pin at all When there is no data uALFAT will return NDT OxFF Important UALFAT requires the following in order for SPI to work e SCK is output from your system Rev 3 11 Page 13 of 48 www ghielectronics com GHI Electronics _LLC UALFAT User Manual Commanding pALFAT e SCK is idle high e SCK is slower than 8 MHz in full power mode and
13. mode make sure to reinitialize the RTC using the T command 10 Required pALFAT Components UALFAT is very simple to add to your new or existing designs It requires very few components Two voltages are needed 3 3V and 1 8V a 10 MHz crystal and very few RCs Check the pin description and OEM boards schematics for more details uALFAT requires MAX3421E to run if USB access is needed You can also find advanced details on the chipset base LPC2103 using the manual from NXP website UALFAT SD pALFAT TF and pALFAT USB are OEM boards containing uALFAT and the schematics are great reference for your design Links are provided below UALFAT SD Schematics UYALFAT USB Schematics UALFAT TF Schematics Rev 3 11 Page 42 of 48 www ghielectronics com GHI Electronics LLC UALFAT User Manual Error Codes 11 Error Codes Error Description HEX 00 Command successful 01 Failed to read sector 02 Failed to write sector 03 Failed to erase sector 04 SD MMC returned invalid value 05 SD MMC timed out 06 Failed to set the block length on SD MMC 07 Failed to send command to SD MMC card 10 Invalid boot sector Try to format the media 11 Invalid MBR signature Try to format the media 12 Invalid BS signature Try to format the media 13 Sector size is invalid Try to format the media 14 Invalid FSINFO Try to format the media 15 FAT 12 is not su
14. of each command to be sent See command reference Note In the following examples sent data are black and received data are red Example1 Mount File System on MMC card and make a folder called FOLDER 100 M FOLDER1 100 Example2 Mount File System on USB Mass Storage Device and make a folder called FOLDER2 Rev 3 11 Page 36 of 48 www ghielectronics com GHI Electronics _LLC UALFAT User Manual FAT and Long File Name Support U 100 M FOLDER2 100 UALFAT doesn t detect card removal or replacement automatically The final application must detect card removal Also uALFAT doesn t check the protection switch on SD cards This means pALFAT will write on protected cards No harm will be caused to the card if removed as long as no files were open for write Older versions of YALFAT supports the original FAT file system where files are 8 characters long with extension that is 3 characters long This naming structure was revised to add the ability to make files have much longer names with Long File Names Folders Folders are supported by uALFAT and it is possible to change the current working folder folder using A command The user must know what the current working folder is There is no way to retrieve the current location in the folder tree using UALFAT This command will create MYFOLDER folder M MYFOLDER 100 Files Files can be opened for read write or append Each file is associated with a
15. slower than 1 25 in reduced power mode e Data is shifted out MSB first e Data is latched on the rising edges For further details and timing diagrams consult LPC2103 data sheet and manual from NXP Semiconductor 4 4 12C Interface Mode I2C was completely updated starting with firmware version 3 05 The new setup can run with 2 wires only and it is more solid Before version 3 05 and all version 2 xx Four pins are needed for I2C communication The USER_I2C_SCL and USER_I2C_SDA are the two 12C bus lines 12C_DATARDY and I2C_BUSY lines work exactly the same way as SPI_DATARDY and SPI_BUSY work except the interface is half duplex When DATARDY is high you can t send data to uUALFAT until all the data is read and DATARDY is back low pALFAT runs in slave 12C mode always The slave address of UALFAT is 0xA4 with maximum clock on 400K This address is fixed and can t be changed Firmware version 3 05 and above The handshaking pins DATARDY and BUSY are still available if user wants to use them but they are not required DATARDY indicates that uALFAT has some data to send when it is high and BUSY flags that uALFAT input buffer is full and no more data should be sent If data is requested from UALFAT over I2C and pALFAT has no data to send back then it responds with OxFF No Data Token Users who do not wish to use DATARDY can pool UALFAT till it responds with any value other than OxFF Now if uALFAT really needs to send OxFF re
16. to use ASCII to simplify troubleshooting and to enter commands easily through a terminal program A special case is when accessing the data in a file When writing reading to from a file UALFAT will use any kind of data Basically what you send is what goes on the file It doesn t have to be ASCII When UALFAT is done processing a command it will return an error code in the form xx lt CR gt where xx is the error number Also some commands require returning some extra information Returned data will come after the symbol unless noted otherwise You can send multiple commands to pALFAT until its FIFO is full indicated by BUSY or RTS pALFAT will take the commands one at the time process them and send responses for each one All of the commands are supported by uALFAT2 and uALFAT3 unless otherwise indicated Command Description Command Description V Get Version Number Enable Echo Z Set Power Mode T Initialize Timer S Set Current Time and Date G Get Current Time and Date B Change Baudrate l Initialize and Mount MMC SD U Initialize and Mount USB J Detect USB Device K Get Media Statistics Initialize Directory List N Get Next Directory Entry L Get Next Directory Entry N command new version Find File or Folder Update Firmware Delete Folder M Make Directory A Change Directory O Open File F Flush File C Close File R Read File W Write File P File Seek Y File Tell D De
17. xx Some new features are e Long file name support Rev 3 11 Page 8 of 48 www ghielectronics com GHI Electronics LLC UALFAT User Manual UALFAT Architecture e File Seek Tell uALFAT can change any contents of a file without affecting the rest of the data This is done using Seek to change the current position in a file and Tell to get the current position in a file See LFN support and licensing section for details Application running on UALFAT2 should work fine with UALFAT3 However the new internal engines of uUALFAT3 handle data differently and might return a different error code than pALFAT2 If the user is not checking for specific error codes which should be the case for most users the transfer to UALFATS3 is transparent Migrating from PALFAT2 to pALFAT3 If the user is moving from V2 software to V3 attention should be taken for the N command if using Long File Names N command returns the next short name directory in a list This command behaves the same in UALFAT3 and is provided for backward compatibility reasons only In order to correctly report the next directory name with long name support a new command is added the L command which gets the next long name in a list when LFN is enabled Here are the cases the user would encounter with the N command when upgrading to Version 3 firmware e The user does not use this command in the existing system No change is necessary e The user use
18. 0 028B Not possible For example B 1EF4 will set the baud rate to 115200 when using full power mode UALFAT responds with 00 if command is accepted at the old baud rate waits 200 ms and then changes to the new baud rate You will then receive a second 00 at the new baud rate The user after receiving the first 00 should change the baud rate within 200 ms and then read the second 00 at the new baud rate Otherwise the received 00 could be corrupted However the user can still continue normal operations after receiving all data Format B lt sp gt vvvv lt cr gt vvvv 2 Bytes in HEX Baud Rate Divider 00 lt cr gt First 00 is sent before changing baudrate 00 lt cr gt Second 00 is sent after changing baudrate Example B lt sp gt 1EF4 lt cr gt Baud Rate is 115200 00 lt cr gt 00 lt cr gt l Initialize and Mount MMC SD It is a major initializing command which is used to mount File System on a newly attached MMC SD or to re mount it All file handles will be closed automatically After using this command the current working directory is the root directory created files folders will be placed right on the storage media not under any folder Format I lt cR gt Rev 3 11 Page 24 of 48 www ghielectronics com GHI Electronics LLC UALFAT User Manual UALFAT Commands Set 100 lt cr gt U Initialize and Mount USB Mass Storage It is a major initializing comm
19. 120 MB 00040000 lt sP gt 0003C000 lt cr gt 00 lt cr gt Rev 3 11 Page 25 of 48 www ghielectronics com GHI Electronics _LLC Initialize Files and Folders List To list files folders in the current directory first use this command to reset the list counter Afterwards the user should get as much directory names as needed using N L commands UALFAT User Manual UALFAT Commands Set No other commands can be issued among multiple N L commands If issuing another command is needed the user must use command again before calling N L Format lt cr gt 00 lt cr gt N Get Next Directory Entry Deprecated In UALFAT3 this command is replaced with the L command to get Long File Names The command must be used to reset the directory list to the beginning before issuing N commands This command will print out the next Directory Entry File or Folder in the list The file name and extension are 8 and 3 characters respectively and padded with spaces ASCII value 0x20 if they are shorter When the end of the file list is reached UALFAT returns an error indicating the end of the list Format N lt cr gt NNNNNNNN File Name 8 00 lt cr gt Chars NNNNNNNN EEE lt sp gt AA lt SP gt ssssssss lt CR gt EEE File Extension 3 Chars 100 lt cr gt AA 1 byte in HEX File Attributes ssssssss 4 bytes in HEX file size Example N lt cr gt Passing N command two 00 lt cr gt times and
20. 3 11 Page 34 of 48 www ghielectronics com GHI Electronics _LLC UALFAT User Manual FAT and Long File Name Support 7 2 Handling File Names and Licensing Support When sending a command that handles a name parameter the user will just send get the name as ASCII characters for short or long names Using LFN is transparent to the user For example to make a directory the following command is sent to UALFAT M lt sp gt FOLDER lt cr gt which conform to the short names format The user can also send M lt sp gt OLDER CREATED 2007 lt cr gt which conform to the LFN format and not the short name In either case the user does not have to worry about the details UALFAT automatically determines the type and convert the ASCII name to UNICODE if using LFN When direct UNICODE support is needed the user can send the UNICODE bytes as ASCII HEX This way characters in many languages can be used This is done using the operator preceding any name with indicates that this name is in Unicode format Each character is sent as two ASCII hexadecimal bytes The High byte of a character comes first then the low byte follows For example to make a directory named VOL the following command uses ASCII representation M lt sp gt VOL lt cr gt The same can be done in UNICODE format as follows M lt sp gt 0056004F004C lt cr gt The letter V is 0x0056 O is Ox004F and L is 0x004C Also note the use of operator Note All names are no
21. 48 www ghielectronics com GHI Electronics LLC UALFAT User Manual Getting Started with uALFAT 5 Getting Started with pALFAT The following chapter includes steps to get uALFAT working for first time user and that is through UART interface All you need e one of uUALFAT OEM boards uALFAT SD for instance e RS232 adapter connected to UART Tx Rx and connected to PC COMx e PC COMx opened through terminal program e pALFAT latest firmware Step by Step 1 Confirm that all hardware connections are made o Ground SPI_SSEL and SPI_SCK signals to access UART interface o Power is connected to power and VBAT o RS232 adapter signals connections and let s assume it is connected to PC COM4 If CTS and RTS signals are not available user can ground CTS Note that uALFAT and the OEM boards are TTL levels and UART signals are OV to 5V but the PC is RS232 12V to 12V therefore you need a RS232 circuit There are some RS232 converters available such as MAX3232 See schematic below Rev 3 11 Page 16 of 48 www ghielectronics com GHI Electronics _LLC UALFAT User Manual Getting Started with uALFAT MAX3232 Other options are using USB to UART modules or cables You will have a virtual COM port on your PC that communicates with UALFAT Examples are UM232R and TTL 232R from FTDI 2 Open COM port using a terminal program for example TeraTerm and ensure the baud rate is 9600 8 data bits 1 stop bit and no handshaking
22. ATS3 Gets the current byte index in a file Valid values 0 gt file size inclusive Format Y lt sp gt n lt cr gt n File Handle 0 1 2 or 3 00 lt cr gt ssssssss 4 bytes in HEX position in the SSSSSSSS lt CR gt file 00 lt cr gt Example Y lt sp gt 1 lt cr gt The file with handle 1 has the file pointer 00 lt cr gt at index 0x03 00000003 lt cr gt 00 lt cr gt D Delete File Deletes a file Format D lt sp gt filename lt cr gt 00 lt cr gt Example D lt sp gt TEST TXT lt cr gt Remove the file with name TEST TXT 00 lt cr gt Rev 3 11 Page 31 of 48 www ghielectronics com GHI Electronics LLC UALFAT User Manual UALFAT Commands Set E Delete Erase Folder Only applicable to Firmware V3 11 and above The folder must be empty in order to be able to delete it Format E lt sp gt foldername lt cr gt 00 lt cr gt Example E lt sp gt TEST lt cr gt Remove the folder with name TEST 00 lt cr gt Find File or Folder This command searches for a specific file or folder name in the current working folder If the directory exists uALFAT outputs the file size attributes and date amp time of modification otherwise it returns an error indicating that the file is not found Format lt sp gt filename lt cr gt ssssssss 4 bytes in HEX file 00 lt cr gt size ssssssss lt sp gt AA lt sp gt ddddtttt lt cr gt AA 1 byte in H
23. EX file 00 lt cr gt Attributes dddditttt 4 bytes in HEX time and date structure Example lt sp gt TEST TXT lt cr gt File has been found and its 00 lt cr gt size is 3892 bytes with no 00000F34 lt sP gt 00 lt sP gt 34210000 lt cr gt special attributes 100 lt CR gt Last modification time is 00 00 00 date is 1 1 2006 File Attributes are one byte Standard Attribute Structure in FAT system 7 6 5 4 3 2 1 0 Reserved Archive Folder Volume System Hidden Read ID Only Time and Date structure is a 32 bits standard structure used in FAT system For example 0x34212002 is 01 01 2006 04 00 04 Bits s Field Description 0x34212000 Bits in Binary 31 25 Year1980 Years since 1980 001 1010 24 21 Month 1 12 0001 20 16 Day 1 31 0 0001 15 11 Hour 0 23 0 0100 10 5 Minute 0 59 00 0000 Rev 3 11 Page 32 of 48 www ghielectronics com GHI Electronics LLC UALFAT User Manual UALFAT Commands Set 4 0 Second2 Seconds divided by 2 0 30 0 0010 Q Quick Format Only applicable to firmware version 3 11 and above This command performs fast erase to all files folders on the media Note that this is not a Full Format it does not erase low level sectors contents of files it just make them available to be rewritten by new files This command may take several seconds to finish depending on the media size Format Q lt sp gt CONFIRM lt
24. I is used to simplify troubleshooting and to allow commands to be typed manually or coded in software easily 2 3 FAT File System FAT support can connect to two kinds of storage media types The media types are SD MMC cards and USB Mass Storage device SCSI command subclass bulk only protocol which includes thumb flash USB hard drives and card readers Keep in mind that all devices must be formatted FAT16 or FAT32 Some supported FAT File System features e FAT16 FAT32 e Licensed Long File Names V3 11 and up e Access up to 4 opened files simultaneously e Access directories folders e File access functions include read write append seek tell find delete make folder remove folder etc e Modification of files at random offsets using Seek and Tell See LFN support and licensing section for details 2 4 USB Hosting USB hosting is done through MAX3421E USB Host Controller chip pALFAT architecture includes USB hosting driver in addition to Mass Storage Device driver SCSI command subclass bulk only protocol which includes thumb flash USB hard drives and memory card readers 2 5 What s new in PALFAT Version 3 UALFAT3 is a complete rebuilt version of the previous UALFAT firmwares It has an all new USB stack engine and a very robust FAT system structure In UALFAT3 you can enjoy all the features of UALFAT2 and more pALFAT2 firmware is denoted by versions 2 xx whereas UALFAT3 firmware is denoted by version 3
25. ITED TO PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES LOSS OF USE DATA OR PROFITS OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY WHETHER IN CONTRACT STRICT IABILITY OR TORT INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE SPECIFICATONS ARE SUBJ