Home

File Transfer between SD Memory Card and USB Flash Drive

image

Contents

1. char tempPtr charfileLineCtr 0 int timeout 0 getFileStringA gain Command NF while timeout lt 10000 if UART1_Data_Ready Q fileLineStr fileLineCtr UARTI Read 43 timeout end of while if strstr fileLineStr 4D 0 tempPtr strchr fileLineStr CR point to the first CR tempPtr inc to alis the CR point to next strncpy exactFullFileStr tempPtr 24 copy the first 24 char so the exess are remove get the Name only strncpy fName exactFullFileStr 12 copy the first 12 char to Name get the attrib fAttrib 0 exactFullFileStr 13 fAttrib 1 exactFullFileStr 14 get the size tempPtr strrchr fileLineStr point to the last tempPtr then inc to point to the next char strncpy fSize tempPtr 8 then copy 8 chars else isEof 1 end of function getFileString void Copy void Paste UARTI Write Text OF 1W gt WritePerCh 12 copvBufferName l 44 UARTI Write CR Dummv Read UARTI Write Text RW 0 1 gt WritePerCh 8 copyBufferSize 1 UARTI Write CR clrscr Cout 2 Copying while UART1_Data_Ready if HandleErrorCodes clrscr Cout 2 Success JIQARTI Write Text CF 0 UART1_Write_Text CF 1 Delay ms 1000 else Cout 2 Error void main Main function initAllQ Start cirscr Home inputA gain choice Cin 2 the the user will wait for
2. Chapter 3 FILE TRANSFER BETWEEN SD MEMORY CARD AND USB FLASH DRIVE THROUGH UART PIC INTERFACING WITH MASS STORAGE DEVICE CONTROLLER Abstract 11 Introduction 11 Methodology 15 Results and Discussion 25 Conclusion 30 iv References Chapter 4 CONCLUSION Chapter 5 RECOMMENDATION REFERENCES APPENDICES Appendix A Appendix B Appendix C Appendix D 38 31 33 35 37 38 49 50 51 LIST OF TABLES Table 3 1 Single File Copy Test Table 3 2 File Accuracy from SD Memory Card to USB Flash Drive Table 3 3 File Accuracy from USB Flash Drive to SD Memory Card Table 3 4 File Accuracy Percentage using MD 5 Checksum from SD Memory Card to USB Flash Drive Table 3 5 File Accuracy Percentage using MD 5 Checksum from USB Flash Drive to SD Memory Card Vi 21 21 22 26 27 LIST OF FIGURES Figure 1 1 Comparison of Prices of Microcontrollers used Figure 2 1 System Setup Figure 2 2 General Block Diagram Figure 2 3 Connection Schematic for the MMC SD card socket Figure 2 4 A USB 2 0 hub uses high speed whenever possible switching to low and full speeds when necessary 8 Figure 2 5 To access generic USB mass storage devices an embedded system must contain a USB host controller which can be on a separate chip or embedded in a microcontroller 9 Figure 3 1 Methodology Flow Chart Figure 3 2 Conceptual Diagram Figure 3 3 Schematic Diagram of the main device Figure 3 4 Program Flow
3. 3 5 1 is the variance computed 2 in sample 1 and 2 is the variance computed in sample 2 The a DIX M variance is computed using the N 1 formula where X is the accuracy percentage of each file M is the mean or the average accuracy percentage of each sample and N is the number of scores in each sample Lastly the t ratio is computed using the formula Write the t ratio formula t meanl mean2 sqrt variancel size of samplel variance2 size of sample2 or If the t value is greater than the critical value 2 060 the Null Hypothesis will be rejected and say that the two samples have the difference Otherwise a significant difference is not found and fails to reject the Null Hypothesis Results and Discussion In performing the MD 5 checksum algorithm for both file transfer between USB Flash Drive and SD Memory Card a table is created to gather the data such as the file name and extension of the sample files and the source and destination s from USB Flash Drive to 26 SD Memory Card or vice versa actual checksums Another column is added to compute for the accuracy percentage per file transfer In this case the computation is based on the ratio of the 32 hexadecimal numbers of the destination from the source Table 3 4 summarizes the data gathered in testing the file accuracy from SD Memory Card to USB Flash Drive Based from the results obtained some file transfers were not successfully established
4. CD ok so now if we just pressed options in the while code above it will 46 WritePerCh 12 fName 1 UARTI Write BS ok kasipag folder dba Ingung extension xemprepag CD folder backspace kaparafoldernamelng UARTI1_Write CR gotoJustOpen IL again jelse if choice 3 PASTE nmannasa folder nakatapat if isCopy Paste else clrscr Cout 2 Do copy first Delav ms 500 gotoJustOpen else Cout 1 Home Delete Cout 2 Copy Cout 3 Paste FileOpInputA gain choice Cin 4 if choice 0 cancel is pressed need to back to current goto Current just back else if choice 1 goto Start jelse if choice 2 this is if copy is chosen if isCopy Command CF 0 UARTI Write Text OF OR gt WritePerCh 12 fName 1 UARTI Write CR strncpv copvBufferName fName 12 strncpy copyBufferSize fSize 8 isCopy 1 goto Current gotoJustOpen else if choice 3 paste is chosen 47 if isCopv Paste else clrscrQ Cout 2 Do copy first Delav ms 500 gotoJustOpen yelse if choice 4 delete is chosen UARTI Write Text DF WritePerCh 12 fName 1 UARTI Write CR cirscr Cout 2 Deleted Delav ms 500 gotoJustOpen end of paste goto Current end of PORTC FO if option is pressed end of main 48 Appendix B Pictures of Prototype 49 Appendix C T Ta
5. Chart Main Figure 3 5 Program Flow Chart Home and Copy Figure 3 6 Program Flow Chart Cin Figure 3 6 Program Flow Chart initAllQ and Command Figure 3 7 File Accuracy Test Results from USB Slave to Slave File Transfer Device Vii 15 16 17 18 19 19 20 24 ABSTRACT Flash memories like SD Memory card and USB Flash drive are widely used nowadays However transferring files within those storage devices cannot be done without the aid of desktop computers laptop etc This paper presents the research and development of a device as an alternative to computers in transferring files between a USB Flash Drive and SD Memory Card A mass storage device controller together with a microcontroller was used to initiate the operation of the device with a maximum capacity of 4 GB in the USB Flash Drive and 4 GB Memory Card The study began by constructing the main device down to its testing part in which the integrity and accuracy of files were considered T test was used as a statistical method to determine whether the difference between two proportions that is the file accuracy of transferring file from the device and from the device of the previous research is significant in the Implementation of a USB Slave to Slave File Transfer Device Using Microcontrollers Though some errors were produced in the testing process the final result stated that there was no significant difference between the file transfer accur
6. Drive to SD Memory Card and the previous study which is USB Slave to Slave File Transfer Device Conclusion The development of the main device for this study requires both the hardware and software to be properly coordinated with each other to meet the objectives of this study The researchers were able to develop the device using Mass Storage Device Controller and microcontroller as the major components of the hardware The user interface of the system provides the capability to browse the contents of the specified file or folder To differentiate a file from a folder a folder has a slash symbol at the end of the name The user navigates through the Options OK button cancel button and to scroll the contents using the previous and next button of the hardware The design has successfully transferred data between the flash drive and SD Secure Digital memory card The file management features of the device are configured correctly to 31 respondto the user activities It is also able to host memory cards that can fit in SD card adapter The accuracy of the file transferred is verified using MD5 checksum which checks for file integrity During the testing process the file transfer from SD Memory Card to USB Flash Drive had a higher transfer speed compared to the other way around even when same exact files are being tested Some errors were produced especially in the part of the first scenario wherein the accuracy of transferring files fr
7. Flow Chart Cin 19 20 commendtehar commana initAll Write serially the command to host l J controller TRISB O 4 TRISC 0x07 TRISD 0x01 ATA PORTB 0 Call predefined C Paste functions for LCD x D ta cirser S Pr 0 _ Does the user did N Do co First SS copy s ee lt lt LA o VU Return g Write serially the command to host controller for paste Figure 3 6 Program Flow Chart initAllQ and Command A transfer transaction is considered successful if for a single file copy the file has been copied completely For folder copy all the contents within the folder directory concerned are copied completely and this includes sub folders and files within the folders to be copied Testing the accuracy of a file or folder transfer is a means of testing the integrity of the written data in a USB flash drive or SD memory card An experiment should be conducted in order to determine the file accuracy percentage by taking the ratio of the size of the successfully transferred file and the original file size in bytes The Message Digest Algorithm 5 MD5 will also be usedto verify data integrity through the creation of a 128 bit message digest from data input which may be a message of any length that is claimed to be as unique to that specific data as a fingerprint is to the specific individual 21 Be
8. Specifically the destination checksum of filel pka is different from its source by 3 hexadecimal numbers Same is through with file4 exe and file14 pdf lastly for filel5 in which an error occurred during the file transfer and therefore no destination checksum was made The file accuracy percentage for each field is 100 if the source is equal to the destination In the case of the three files that yield to different results other than that the computation using the file accuracy percentage formula is done Table 3 4 File Accuracy Percentage using MD 5 Checksum from SD Memory Card to USB Flash Drive File Source Destination Accuracy Name MD5 MD5 Filel pka b7calcc671e70c0cd350833e b7calcc671e10a2cd350833e 90 62590 2b22e1f3 2b22e1f3 File2 txt 88fcc62dbc58d1f4b3fa8dedb 88fcc62dbc58d1f4b3fa8ded 100 b6aaf38 bb6aaf38 File3 mp3 6418464099797641232d7dd 6418464099797641232d7dd 100 c9a96b6ee c9a96b6ee File4 exe c7722c4ec4fe3ac818658ef00 c7722c4eca3dbad818658ef0 81 25 a49e2b4 0a49e2b4 File5 xls 13ae3a6aldb81cfcef570d0a2 13ae3a6aldb81cfcef570d0a 100 4ea09e2 24ea09e2 File6 docx f59cb7d6c15ffe465a76c1b01 f59cb7d6c15ffe465a76c1b0 100 66f772c 166f772c File7 bmp 033d47aab079aa403f96f033c 033d47aab079aa403f96f033 100 78eb5ec c78eb5ec File8 cache c8221439a4d15092bc29f0f0 c8221439a4d15092bc29f0f0 100 7909fef7 7909fef7 File9 rar 5d84e04b9c11f600e9daaae7 5d84e04b9c1 1f600e9daaae7 100 4dec0b9d 4dec0b9d File10 jpg Filell exe File12 pp
9. be in specific applications wherein it keeps the cost at minimum due to its use of limited resources The device is capable of transferring data to and from the Secure Digital card and Universal Serial Bus disk It supports only File Allocation Table FAT FAT32 file system to be able to access data Since the memory card slot is Secure Digital compliant it can mount other memory card s that can be plugged via SD adapter However this is not covered by the study Some SD type memory cards such as Secure Digital High Capacity SDHC and Secure Digital Extended Capacity SDXC are newer standards which are not supported by the device Only flash drive s with total space of 4 0 Gigabyte can be plugged on the USB port that conforms to USB 2 0 standard while external hard drives are not supported due to their high power requirements The device will have LCD and directional buttons for file folder navigation as well as another button to show the available options Copy paste delete and auto replace of file only are supported due to time constraints in the development and the file name follows the 8 3 convention Chapter 2 REVIEW OF RELATED LITERATURE Implementation of a USB Slave To Slave File Transfer Device Using Microcontrollers A thesis study entitled Implementation of a USB Slave to Slave File Transfer Device by Mark Alvin U Chua Charles D Jorge Ana Marian M Pedro Brian Emmanuel G Tam and Gregory G Cu is about developing a de
10. the screen that will be used in the device and therefore it will not be as expensive as the device used in the previous research It is important to note that the speed of data transfer is slow compared to a computer due to the host controller used which is USB 2 0 full speed Theoretically if the host microcontroller used follows the USB 2 0 high speed standard the speed of data transfer should be much faster than the computer since there is no associated overhead in the bus compared to the computer The main objective of this study is to develop a device that can transfer files from flash drive to memory card and vice versa Specific objectives include the following to create an interface that will list all the file s or folder s in the current directory to make sure that the user has the ability to navigate through it using the buttons to have a successful file transfer between flash drive and memory card and to determine whether there is a significant difference between the file accuracy of transferring file from USB Flash Drive to SD Memory Card or vice versa used in the present study and that of the previous study Since there is only one display the user can choose if he she wants to see the contents of the flash drive or the memory card only The compatibility between the flash drive and the memory card will depend on the capacity standard used and additional features added by the manufacturer such as creating additional encrypted partiti
11. the sizes are tested from the accuracy results from SD Memory Card to USB Flash Drive On the other hand n2 will be obtained from the accuracy results of the previous research wherein its sample size is equal to 12 Accuracy Filename MD5 Single File Transfers D9324F3FA083452F 100 STANDA LTXT 04C5CAABABF26681 REFLE DOC COD07E2C71C2F9CE 100 f 1CB3DC3D782FD927 4856547D0F70C6D3 100 HE EDS C91E2FF162F7834D ADB0379FB28E36A6 100 a 4BDOD6COBCA0681F 605195ED403842DD 100 JINT BEIRTE ES A10CFF5A41D1B4B5 64A70C3DEDB53345 100 fa 9C0B9D6954B6C3CB Folder Transfers LitFileDeep 6Lvi 10090 SimpleManvLargeFile 10090 s TotalMix 61vl 100 MultiFolder 2 100 Multi ASmall Lvil 10090 Mixl argeSmall 2Lvi 100 Figure 3 7File Accuracy Test Results from USB Slave to Slave File Transfer Device The next step is to determine the level of confidence alpha The t distribution table is used to determine the critical value in order to get the level of confidence for a two tailed t test In this case the level of confidence for a degree of freedom equal to 25 is Alpha 05 with a critical value tcv 2 060 See Appendix The next step is to compute for the standard error SE of the sampling distribution difference between two proportions 23 f 3 r GDS 6 Da Ju 7 CR A LL sic XL Ya 1 a a 9 i AM l 3 ha l ki 12 2 where n is the size of Table 3 2 and no is the size of Figure
12. 4 VOLTAGE COMMON vVvi 9v T vo E 13 TPE il En E ww J J8Mhz es H 1kQ so H T l ae 5 1kQ USBWiz1 15pF RX 10kQ it 10kQ z D O 10kQ Options Ok L ao ew Cancel km Prev I 86 g Next A vcc Figure 3 3 Schematic Diagram of the main device The user interface will be connected to the host controller and PIC microcontroller and will serve as the main component in which the user can view the file s inside the flash drive and memory card It will consist of a 4x20 Liquid Crystal Display LCD and buttons for selection The PIC will accept inputs from the user through buttons and the PIC will determine what button is pressed to perform functions and processes that are needed When a file has been successfully copied or transferred from one storage device to another an indication will be displayed on the screen which confirms that the file is done copying 18 The program flow chart for different subroutines for the PIC microcontroller in the following figures below shows the process in responding to the user activity specifically in the file management between the SD Memory Card and USB Flash Drive initAll v Homel Y Display Menu Input Menu Choice Y choice Cin 2 x se E a A pear Y L choice 1 P Command FM 1 Q gi Initialize Flash Files P D Command FM S Ini
13. 5 652KB 1 58 100 11 Filell exe 7 925KB 2 39 100 12 File12 pptx 302KB 0 3 100 13 File13 exe 3 783KB 1 16 100 14 Filel4 pdf 2 045KB 0 53 71 875 15 File15 avi 6 384KB 0 2 0 Table 3 3 File Accuracy from USB Flash Drive to SD Memory Card File Name File Extension File Size in Transfer Speed Accuracy Bytes 1 Filel pka 85KB 0 3 100 2 File2 txt 1KB 0 1 100 3 File3 mp3 5 546KB 2 31 100 4 File4 exe 1 386KB 0 22 100 5 File5 xls 46KB 0 2 100 6 File6 docx 1 255KB 0 27 100 7 File7 bmp 2 903KB 1 17 100 8 File8 cache 8KB 0 1 100 9 File9 rar 4 365KB 2 17 100 10 File10 jpg 5 652KB 2 48 100 11 Filell exe 7 925KB 3 01 100 12 File12 pptx 302KB 0 7 100 13 File13 exe 3 783KB 1 34 100 29 14 File14 pdf 2 045KB 0 52 100 15 File15 avi 6 384KB 2 38 100 Based from the results gathered differences can be seen during the file transfer of the device between the SD Memory Card and USB Flash Drive especially on the transfer speed of the device It can be observed that in terms of the transfer speed transferring files from USB Flash Drive to SD Memory Card requires more time than transferring files from SD Memory Card to USB Flash Drive when using the device However in terms of the file accuracy percentage Table 3 2 has obtained file accuracy less than 100 which means that errors were produced during the testing process and the transfer of a single file was unsuccessful for some The accuracy M for the sample files ni transf
14. 749f661b2 efafOlec Destination MD5 b7calcc671e70c0cd350833e 2b22e1f3 88fcc62dbc58d1f4b3fa8ded bb6aaf38 6418464099797641232d7dd c9a96b6ee c7722c4ec4fc3ac818658ef0 0a49e2b4 13ae3a6aldb81cfcef570d0a 24ea09e2 f59cb7d6c15ffe465a76c1b0 166f772c 033d47aab079aa403f96f033 c78eb5ec c8221439a4d1 5092bc29f0f0 7909fef7 5d84e04b9c 1 1f600e9daaae7 4decOb9d 417634ec8dbfa3fb6c57c36a 614398d 30be90d08f03a4a749f661b2 efafOlec Accuracy 100 100 100 100 100 100 100 100 100 100 100 File12 pptx 02e3ac32137dd06b10df59b4 02e3ac32137dd06b10df59b4 100 46885fec 46885fec Filel3 exe 3a9500a528286d773309bc1d 3a9500a528286d773309bc 1 100 21d91469 d21d91469 File14 pdf c7722c4ec4fc3ac818658ef00 c7722cdecdfc3ac8 18658ef0 100 a49e2b4 0a49e2b4 File15 avi al15b7bb3d272fb148e1fb75 al115b7bb3d272fb148e1fb75 100 85ffd806 85ffd806 28 The file accuracy results obtained in Tables 3 4 and 3 5 are transferred to the last columns of Tables 3 2 and 3 3 so as to complete the File Accuracy tables of both scenarios Table 3 2 File Accuracy from SD Memory Card to USB Flash Drive File Name File Extension File Size in Transfer Speed Accuracy Kbytes 1 Filel pka 85KB 0 1 90 625 2 File2 txt 1KB 0 1 100 3 File3 mp3 5 546KB 1 50 100 4 File4 exe 1 386KB 0 29 81 25 5 File5 xls 46KB 0 1 100 6 File6 docx 1 255KB 0 25 100 7 File7 bmp 2 903KB 1 00 100 8 File8 cache 8KB 0 1 100 9 File9 rar 4 365KB 1 32 100 10 File10 jpg
15. Computer Engineering as fulfillment of the practicum requirement for the Degree Bachelor of Science in Computer Engineering Felicito S Caluyo Dean School of EECE li ACKNOWLEDGEMENT This study would not have been possible without the people who supported and helped us First of all we would like to thank Engr IsaganiVillamor our thesis adviser for helping guiding and giving us valuable advices He imparted us his knowledge and expertise for the completion of this study We give our deepest gratitude to our parents for continuously supporting and inspiring us to our long journey To all of our closest friends and love ones for giving us emotional care and camaraderie that helped us get through difficult times We would also like to thank our panel members and instructor Engr Jerry Turingan Engr Dionis Padilla and Engr AyraPanganiban for giving us recommendations and corrections to improve this study Lastly to the Almighty God for providing us the strength knowledge and willpower to finish this study lii TABLE OF CONTENTS TITLE PAGE i APPROVAL PAGE li ACKNOWLEDGEMENT jii TABLE OF CONTENTS iv LIST OF TABLES vi LIST OF FIGURES Vii ABSTRACT Vili Chapter 1 INTRODUCTION 1 Chapter 2 REVIEW OF RELATED LITERATURE 5 Implementation of a USB Slave To Slave File Transfer Device Using Microcontroller 5 Interfacing To an MMC or SD Card via SPI 6 Elements of a Transfer 8 Embedded Universal Serial Bus Host 8 Bus Speeds 9
16. File Transfer between SD Memory Card and USB Flash Drive through UART PIC Interfacing with Mass Storage Device Controller by Meryl Anne Filomena B Coching Kristine Doctor Francis Mark V Evangelista Lynda Clarissa C Santos A Thesis Report Submitted to the School of Electrical Engineering Electronics Engineering and Computer Engineering in Partial Fulfillment of the requirements for the degree Bachelor of Science in Computer Engineering Mapua Institute of Technology December 2011 APPROVAL SHEET This is to certify that we have supervised the preparation of and read the practicum paper prepared by Meryl Anne Filomena B Coching Kristine Doctor Francis Mark V Evangelista and Lynda Clarissa C Santos entitled File Transfer Between Sd Memory Card And Usb Flash Drive Through Uart Pic Interfacing With Mass Storage Device Controller and that the said paper has been submitted for final examination by the Oral Examination Committee Se Te ee ire TS Isagani V Villamor Academe Adviser As members of the Oral Examination Committee we certify that we have examined this paper and hereby recommend that it be accepted as fulfillment of the practicum requirement for the Degree Bachelor of Science in Computer Engineering Ayra G aka A Turingan Panel Member Panel Member Committee This practicum paper is hereby approved and accepted by the School of Electrical Engineering Electronics and Communications Engineering and
17. Instead the host serves as the start and finish for communications with device endpoints 2 0 HOST AND ROOT HUB HIGH SPEED H A LOW FULL SPEED a HIGH SPEED ion sreeo N K TA i i FULL SPEED ll i GH FULL SPEED LOW SPEED 2 0 HUB HIGH SPEED LL 3PE i 1 X HUB Q j AS LOW SPEED FULL SPEED B SI 7 A FULL SPEED FULL SPEEDY Low SY 7 SPEED HIGH SPEED J Low sPEED HIC LOE SPEED HIGH SPEED DEVICE t ass DEVICE FULL SPEED FULL SPEED DEVICE DEVICE Figure 2 4 A USB 2 0 hub uses high speed whenever possible switching to low and full speeds when necessary Embedded Universal Serial Bus Host A USB host controller is needed to access such USB storage devices An embedded system that functions as a USB host for flash drives requires the following hardware Figure 2 5 A microcontroller or intelligent hardware is required to manage the embedded system s operation A USB host controller which can be embedded in a microcontroller chip or on a separate chip that interfaces to the CPU microcontroller or other intelligent hardware is needed A flash drive is connected to a USB port on the host Axelson 2006 The host manages the flow of data on the bus Multiple peripherals may want to transfer data at the same time The host controller divides the available time into segments called frames on a full speed host or microframes on a high speed host The host gives each transmissi
18. SD Card via SPI 2008 Chapter 4 CONCLUSION The development of the main device for this study requires both the hardware and software to be properly in accordance with each other and to meet the objectives of this study The researchers were able to develop the device using Mass Storage Device Controller and microcontroller as the major components of the hardware The user interface of the system provides the capability to browse the contents of the specified file or folder To differentiate a file from a folder a folder has a slash symbol at the end of the name The user navigates through the Options OK button cancel button and to scroll the contents using the previous and next button of the hardware The design has successfully transferred data between the flash drive and SD Secure Digital memory card The file management features of the device are configured correctly to respond for the user activities It is also able to host memory cards that can fit in SD card adapter The accuracy of the file transferred is verified using MD5 checksum which checks for file integrity During the testing process the file transfer from SD Memory Card to USB Flash Drive has a higher transfer speed compared to the other way around even when same exact files are being tested Some errors were produced when the accuracy of transferring files from SD Memory Card to USB Flash Drive was tested and is less than a hundred percent Factors affecting such may i
19. Second EditionCOM Ports USB Virtual COM Ports and Ports for Embedded Systems Dec 2007 4 Jan Axelson USB Mass Storage Designing and Programming Devices and Embedded Hosts 5 GHI Electronics USBWiz User Manual Rev 2 27 April 2009 6 GHI Electronics USBWiz OEM Manual 2006 7 Dogan Ibrahim Advanced PIC Microcontroller Projects in C From USB to RTOS with the PIC 18F Series 8 MikroElektronika C Compiler for Microchip PIC Microcontrollers User s Manual 9 John Morton The PIC Microcontroller Your Personal Introductory Course Third Edition 10 Cyan Technology Interfacing to an MMC or SD Card via SPI 2008 37 APPENDICES Appendix A Program Listing LCD declarations sbit LCD_RS at RD2_bit sbit LCD_EN at RD3_ bit sbit LCD D7 at RB7_bit sbit LCD D6 at RB6_bit sbit LCD D5 at RB5 bit sbit LCD D4 at RB4_bit sbit LCD D3 at RB3 bit sbit LCD D2 at RB2 bit sbit LCD DI at RBI bit sbit LCD D0 at RBO bit sbit CD RS Direction at TRISD2 bit sbit CD EN Direction at TRISD3 bit sbit LCD D7 Direction at TRISB7 bit sbit LCD D6 Direction at TRISB6_bit sbit LCD D5 Direction at TRISB5_bit sbit LCD D4 Direction at TRISB4_bit sbit LCD D3 Direction at TRISB3 bit sbit LCD D2 Direction at TRISB2 bit sbit LCD DI Direction at TRISBI bit sbit LCD DO Direction at TRISBO bit IGLOBAL VARIABLES char CR OxOD JICARRIAGE RETURN char BS 0x08 IBACKSPACE char devOn charfName 12 fAttrib 2 fSize 8 c
20. acy of the device and the previous study Keywords USB Flash Drive SD Memory Card USB Embedded Host Controller UART File Transfer viii Chapter 1 INTRODUCTION Portability and mobility of storage devices like flash drives and memory cards are becoming so popular to carry and transport data on the go Unlike CD DVD hard drive floppy disk or tape drive a flash memory has no moving parts so it guarantees fast read write speeds and more durable compared to other forms of storage media Flash memory does not follow a standard form factor so it can be designed or shaped depending on what the customer wants Using a flash drive memory card to transfer a file typically uses a computer e g laptop pc netbook or tablet to initialize mass storage communication which is not portable Although a memory card is used in mobile phones withtheir diminutive sizes it limits another memory card type of larger size to host them Additionally mobile phones cannot host a flash drive and memory card at the same time to transfer data The proposed system bridges the gap of flash drive to memory card data transfer when a computer is not at hand Moreover booting a computer just to transfer a file s brings annoyance In an earlier research an embedded system is used wherein a slave to slave flash drive transfer makes it possible to transfer file s using a programmable microcontroller with USB multi role embedded host peripheral controller and navigation
21. ble cum prob ty trs ta tas to tos fan ta tos tow fs onetaill 0 50 025 020 045 040 0 05 0 025 0 01 0 005 0 001 0 0005 two tails 1 00 0 50 040 030 020 040 005 002 0 01 0 002 0 001 df 1 2 3 4 5 1303 1 684 1296 1671 2 000 1202 1664 1 000 1290 1660 1 984 1 282 1646 1 962 80 90 95 Confidence Level 50
22. ble of transferring data to and from the Secure Digital card and Universal Serial Bus disk It supports only File Allocation Table FAT FAT32 file system to be able to access data Since the memory card slot is Secure Digital compliant it can mount other memory card s that can be plugged via SD adapter However this is not covered by the study Some SD type memory cards such as Secure Digital High Capacity SDHC and Secure Digital Extended Capacity SDXC are newer standards which are not supported by the device Only flash drive s with total space of 4 0 Gigabyte can be plugged on the USB port that conforms to USB 2 0 standard while external hard drives are not supported due to 15 their high power requirements The device will have LCD and directional buttons for file folder navigation as well as another button to show the available options Copy paste delete and auto replace of file only are supported due to time constraints in the development and the file name follows the 8 3 convention Methodology Figure 3 1 Methodology Flow Chart The methodology in this study is summarized through a flow chart shown in Figure 3 1 and is followed with a detailed discussion for each method in order to meet the desired objectives 16 A conceptual diagram is created by the researchers in order to visualize the main device to be made and also its functions A study is conducted for the suitable materials needed to build the system The conce
23. control This makes it possible to transfer data from a flash drive to another flash drive with 100 data integrity using MD5 checksum algorithm That research also benchmarks the speed of data transfer depending on the size of the file and the depth of the file location in a folder The device consumes a small amount of power only has low memory footprint and less resources are utilized The research project being proposed in this study addresses the problem of flash drive to flash drive transfer without the use of a computer The transfer of data between flash drive and memory card is not included This study focuses on a design that is inexpensive and can readily be implemented without the use of a computer Figure 1 1 shows the comparison of prices for the microcontrollers used by the previous research and the proposed system Microchip Microcontrollers 18FXXX High Performance Series Description More In Package Price Info Stock Qty US 9 90 PIC18F458 1 P PIC18F458 Flash 40 pin 32kB 40MHz Microcontroller with CAN 9 9 PIC18F4550 1 P PIC18F4550 Flash 40 pin 32kB Microcontroller with USB Figure 1 1 Comparison of Prices of Microcontrollers used It can be shown that PIC18F458 the one that was used in the previous research costs more than the microcontroller that will be used in this research project which is PIC18F4550 The previous researchers used 20x4 Liquid Crystal Display LCD screen which is larger than the size of
24. erred as shown in Table 3 2 is 90 625 100 100 81 25 100 100 100 100 100 100 100 100 100 71 875 0 15 89 5833 The variance si for sample n was computed to be 90 625 89 5833 100 89 5833 100 89 5833 81 25 89 5833 100 89 5833 100 89 5833 100 89 5833 100 89 5833 100 89 5833 100 89 5833 100 89 5833 100 89 5833 100 89 5833 71 875 89 5833 0 89 5833 14 685 9189 Since all the 12 files are 100 accurate for sample n2 as shown in Figure 3 5 which is 2 the data from the previous study the mean M is equal to 100 and the variance 1 is equal to 0 The standard error SE of the sampling distribution difference between two proportions was obtained by ama Iss 7 5901 30 Finally the t ratio t was obtained to be 1 3724 Since 1 3724 lt 2 060 the null hypothesis is not rejected It then implies that there is no significant difference between the accuracy of the transferring files from SD Memory Card to USB Flash Drive and the previous study which is USB Slave to Slave File Transfer Device For the second part of the statistical treatment Table 3 3 is then compared to Figure 3 5 However since the file accuracy percentage in Table 3 3 is also the same as the latter it is automatically concluded that P P2 and the null hypothesis is not rejected implying that there is no significant difference between the file accuracy of the transferring files from USB Flash
25. fore the accuracy test the information about the sample files to be copied must be gathered first For the single file copy test Table 3 1 summarizes the different information such as the individual file name file name extension and the file size in bytes to be copied Note that 15 sample files will be tested and copied from a 4 GB USB Flash Drive to a 4 GB SD Memory Card and 15 samples also from 4 GB SD Memory Card to a 4 GB USB Flash Drive for a total of 30 samples Table 3 1 Single File Copy Test File Name File Extension File Size in Bytes 1 Filel pka 85KB 2 File2 txt 1KB 3 File3 mp3 5 546KB 4 File4 exe 1 386KB 5 File5 xls 46KB 6 File6 docx 1 255KB 7 File7 bmp 2 903KB 8 File8 cache 8KB 9 File9 rar 4 365KB 10 File10 jpg 5 652KB 11 Filell exe 7 925KB 12 File12 pptx 302KB 13 File13 exe 3 783KB 14 File14 pdf 2 045KB 15 File15 avi 6 384KB After the information has been gathered the file accuracv test is next Table 3 2 summarizes the file accuracv test results when files are being copied from a 4 GB SD Memory Card to a 4 GB USB Flash Drive Table 3 2 File Accuracv from SD Memorv Card to USB Flash Drive File Name File Extension File Size in Transfer Speed Accuracv Kbytes 1 Filel pka 85KB 2 File2 txt 1KB File3 22 5 546KB 3 4 File4 5 Files 6 File6 7 File7 8 File8 9 File9 10 File10 11 Filell 12 File12 13 File13 14 File14 mp3 exe xls docx bmp cache rar jpg exe p
26. har isEof 0 int nextMinus1 0 intprevCtr 0 charcopyBufferName 12 char copyBufferSize 8 char isCopy 0 voidclrser Lcd Cmd LCD CLEAR void Command char command UARTI Write Text command 38 39 UART1_Write CR voidCout char lineNum char fileLineString Lcd_Out lineNum 1 fileLineString voidgotoxy char row char col LCD_Out row col void Home Cout 1 Open USB Mem Files Cout 2 Open SD Mem Files Led_Out 4 8 CDES charchecklfFolder char fAttrib if fAttriblO l amp amp fAttrib 1 0 Il fAttriblOI 3 amp amp fAttrib 1 2 Il fAttrib 0 l amp amp fAttrib 1 2 return 1 Jelsef return 0 voidWritePerCh char size char array char type char ctrSize 0 if type 0 0 if write in LCD while ctrSize lt size if array ctrSize Led_Chr_CP array ctrSize ctrSize jelse if type 1 if 1 write in UART while ctrSize lt size if array ctrSize UART1_Write array ctrSize 40 ctrSize void FilesDisplay clrscrQ Led_Out 1 5 devOn gotoxv 3 1 WritePerCh 8 fSize 0 gotoxy 2 1 WritePerCh 12 fName 0 if checkIfFolder fAttrib LCD_Cmd _LCD_MOVE_CURSOR_LEFT LCD Chr Cp chardummy_char void Dummy_Read int timeout 0 while timeout lt 30000 if UART1_Data_Ready dummy_char UART1_ReadQ timeout voidinitA
27. is the two proportion or the so called two sample t test This test procedure will be made to determine whether the difference between two proportions that is the file accuracy of transferring file from the device and from the previous research is significant It would also verify if same actual files are copied and transferred directly from whichever source and destination be it USB Flash Drive of SD Memory Card Therefore two kinds of statistically treated tests are expected at the end of this chapter the first one will compare if the file accuracy of transferring file s from SD Memory card to USB Flash Drive and from the previous research is significant The second test will compare if the file accuracy of transferring file s from USB Flash Drive to SD Memory card used in the present study and from the previous research is significant The two sample t test begins by stating the null and alternative hypothesis In this case the null hypothesis states that there is no difference between the two population proportions Therefore the null and alternative hypotheses will be stated in the following form Ho P P2 Ha Pi P2 24 The next step will be stating the rejection criteria starting with the degrees of freedom df wherein the formula is stated to be the sum of the samples in both groups minus 2 df nl n2 2 In this case df is defined to be 15 12 2 25 Note that the sample size nl is the sample size from Table 3 2 wherein
28. llO TRISB 0 TRISC 0x07 TRISD 0x01 PORTB 0 LCD_InitQ Lcd Cmd LCD UNDERLINE ON Lcd Cmd LCD BLINK CURSOR ON UARTI1_Init 9615 Dummy_Read 41 Cout 1 Initializing Delay_ms 1000 clrscrQ charCin char maxIndex char isCancel 0 isOk 0 char input 1 while isCancel amp amp isOk buttons if PORTC F2 previous Delay_ms 500 input if input 0 input maxIndex if PORTD FO next Delay_ms 500 input if input gt maxIndex input 1 if PORTC FO OK is pressed Delay_ms 500 isOk 1 if PORTC F1 Cancel is pressed Delay_ms 500 isCancel 1 input 0 lend of buttons determination if input 1 gotoxv 1 1 jelse if input 2 gotoxv 2 1 42 jelse if input 3 gotoxy 3 1 jelse if input 4 gotoxv 1 15 else if input 5 gotoxy 2 15 jelse if input 6 gotoxv 3 15 end of while return input endof Cin function charHandleErrorCodes function HandleErrorCodes char errorCode 10 igg gt charerrorCodeCtr 0 char noError 0 while errorCodeCtr lt 4 if UART1_Data_Ready errorCode errorCodeCtr UARTI Read Lcd_Chr_CP errorCode errorCodeCtr Delay_ms 1 errorCodeCtr start of identifying the errors if strstr errorCode 00 noError 1 returnnoError voidgetFileString GETFILESTRING charexactFullFileStr 25 char fileLineStr 40
29. mats since it will not deal with the content of the file but rather its existence on the 14 physical medium However it is important to mention that the study will concentrate on the integrity of the data copied The user s ability to transfer data between flash drive and memory card in a small devicecan reduce the utilization of computer which translates into saving power and resources Additionally it uses less amount of carbon footprint because of low heat emission and only uses portable electricity The device emits low heat in such a way that it does not require that high amount of electricity which produces heat whenever it functions Also compared to the computers used in transferring files between a USB flash drive and a memory card the device has lesser components than the first The device is said to use portable electricity in such a way that the device only uses 5V source of power which is low compared to other computers such as laptops which uses 15V to 20V The device can also be battery operated A portable embedded system capable of transferring data can save unexpected circumstances such as no electricity or no computer availability It can be also interfaced with other designs provided that they have a common port to transmit data The key importance of this design is to show how powerful an embedded system can be in specific applications wherein it keeps the cost at minimum due to its use of limited resources The device is capa
30. mory Card USB Embedded Host Controller UART File Transfer Introduction Portability and mobility of storage devices like flash drives and memory cards are becoming so popular to carry and transport data on the go Unlike CD DVD hard drive floppy disk or tape drive a flash memory has no moving parts so it guarantees fast read write speeds and more durable compared to other forms of storage media Flash memory does not follow a standard form factor so it can be designed or shaped depending on what the customer wants Using a flash drive memory card to transfer a file typically uses a computer e g laptop pc netbook or tablet to initialize mass storage communication which is not portable Although a memory card is used in mobile phones withtheir diminutive sizes 11 12 it limits another memory card type of larger size to host them Additionally mobile phones cannot host a flash drive and memory card at the same time to transfer data The proposed system bridges the gap of flash drive to memory card data transfer when a computer is not at hand Moreover booting a computer just to transfer a file s brings annoyance In an earlier research an embedded system is used wherein a slave to slave flash drive transfer makes it possible to transfer file s using a programmable microcontroller with USB multi role embedded host peripheral controller and navigation control This makes it possible to transfer data from a flash drive to another fla
31. nclude both external and internal device errors External factors include the noise and interferences obtained by the physical device Internal device errors include the program inside the USB host controller Nevertheless after the statistical 33 34 treatment it is concluded that there is no significant difference between the file transfer accuracy of the device and the device used in previous study Chapter 5 RECOMMENDATION There are still several functions that need to be improved in the prototype of this study As designed the directories cannot be transferred between SD Memory card and USB Flash Drive Therefore it is recommended that the system be reprogrammed to transfer folders between the two memories Searching files can also be difficult especially when traversing many files and folders It may also be time consuming for the user especially when there are a lot of files in the memory To make the system more efficient a search or find function should be integrated to the system The LCD is limited to 4 x 20 characters only As a result only one file can be viewed at a time Simultaneous viewing for both drives can help the user look for files and switch between two drives faster Thus instead of using a normal 4 x 20 Liquid Crystal Display future researchers can use a larger size of it LiquidGraphics Crystal Display can also be used for a high quality of visual experience however it can be a trade off with the low powe
32. om SD Memory Card to USB Flash Drive is less than a hundred percent Factors affecting such may include both external and internal device errors External factors include the noise and interferences obtained by the physical device Internal device errors include the program inside the USB host controller Nevertheless after the statistical treatment it is concluded that there is no significant difference between the file transfer accuracy of the device and device used in the previous study References 1 Mark Alvin U Chua Charles D Jorge Ana Marian M Pedro Brian Emmanuel G Tam Gregory G Cu Implementation of a USB Slave to Slave File Transfer Device Using Microcontrollers 2 Jan Axelson USB COMPLETE Second Edition Madison WI Lakeview Research LLC 2004 3 Jan Axelson Serial Port Complete Second EditionCOM Ports USB Virtual COM Ports and Ports for Embedded Svstems Dec 2007 4 Jan Axelson USB Mass Storage Designing and Programming Devices and Embedded Hosts 32 5 GHI Electronics USBWiz User Manual Rev 2 27 April 2009 6 GHI Electronics USBWiz OEM Manual 2006 7 Dogan Ibrahim Advanced PIC Microcontroller Projects in C From USB to RTOS with the PIC 18F Series 8 MikroElektronika C Compiler for Microchip PIC Microcontrollers User s Manual 9 John Morton The PIC Microcontroller Your Personal Introductory Course Third Edition 10 Cyan Technology Interfacing to an MMC or
33. on The design is an extension of the previous research but of different implementation The device should handle all file formats since it will not deal with the content of the file but rather its existence on the physical medium However it is important to mention that the study will concentrate on the integrity of the data copied The user s ability to transfer data between flash drive and memory card in a small devicecan reduce the utilization of computer which translates into saving power and resources Additionally it uses less amount of carbon footprint because of low heat emission and only uses portable electricity The device emits low heat in such a way that it does not require that high amount of electricity which produces heat whenever it functions Also compared to the computers used in transferring files between a USB flash drive and a memory card the device has lesser components than the first The device is said to use portable electricity in such a way that the device only uses 5V source of power which is low compared to other computers such as laptops which uses 15V to 20V The device can also be battery operated A portable embedded system capable of transferring data can save unexpected circumstances such as no electricity or no computer availability It can be also interfaced with other designs provided that they have a common port to transmit data The key importance of this design is to show how powerful an embedded system can
34. on a portion of a frame or microframe A frame is 1 millisecond a microframe is 125 microseconds GENERIC MASS i USB KOST HOST CPU OR rat orl A es CONTROLLER MICROCONTROLLER DEVICE Tse CONTROLLER GENERIC HOST CPU OR MASS STORAGE MICROCONTROLLER daar A e WITH EMBEDDED DEVICE S USB HOST CONTROLLER Figure 2 5 To access generic USB mass storage devices an embedded system must contain a USB host controller which can be on a separate chip or embedded in a microcontroller Bus Speeds The USB 2 0 specification defines three bus speeds high speed at 480 Mbps full speed at 12 Mbps and low speed at 1 5 Mbps In addition to data the bus carries status 10 control and error checking signals All peripherals share the bus so the data throughput is always less than the bit rate on the bus In theory on an otherwise idle bus a full speed device can transfer just over 1 2 MBps and a high speed device can transfer more than 53 MBps The actual rate of data transfer varies depending on the efficiency of the host s and device s programming how busy the bus is and hardware capabilities of the host and drive A review of the literature shows that there had been studies on host controller devices storage controllers and file transfer using embedded systems However these studies show that there is no existing system similar to this study Existing studies only transfer files of both USB flash drive and no s
35. ptual diagram shown in Figure 3 2 includes the system design necessary in the hardware and software integration Serial Communication Figure 3 2 Conceptual Diagram To be able to transfer file s between a USB Flash Drive and an SD Memory Card a device will be developed using a Mass Storage Device Controller and a microcontroller The USB Device or Host Controller has built in commands and file system support particularly a FAT file system which will be utilized to aid the file transfer The microcontroller will be programmed and will be responsible for reading and writing files in a flash memory or flash drive Specifically the PIC18F4550 microcontroller will access the said host hardware controller via an asynchronous serial UART port In UART mode UART_TX pin is used to send data responses to the microcontroller and UART_RX pin to receive commands data from the microcontroller The said two pins will be connected to the TX and RX UART pins of PIC18F4550 respectively The command set provided by the mass storage host controller will be parsed by the microcontroller using C language To make the device portable a 9V battery supply to be regulated into 6V will be used A schematic diagram shown in Figure 3 3 is simulated to come up with the desired output TITITITI 5V LM7806KC LINE VREG
36. ptx exe pdf avi 1 386KB 46KB 1 255KB 2 903KB 8KB 4 365KB 5 652KB 7 925KB 302KB 3 783KB 2 045KB 15 File15 6 384KB On the other hand Table 3 3 summarizes the file accuracv test results when files are being copied from a 4 GB Flash Drive to a 4 GB SD Memory Card Note that the same files will be copied and for the purpose of testing those files inside the Flash Drive that were copied during the previous test will be erased first to avoid overwriting of files and to give way to the next test Table 3 3 File Accuracv from USB Flash Drive to SD Memorv Card File Name Filel File2 File3 File4 File5 File6 File7 File8 File9 10 File10 11 Filell 12 File12 13 File13 14 Filel4 OOOO OR GN File Extension pka txt mp3 exe xls docx bmp cache rar jpg exe pptx exe pdf File Size in Bytes 85KB 1KB 5 546KB 1 386KB 46KB 1 255KB 2 903KB 8KB 4 365KB 5 652KB 7 925KB 302KB 3 783KB 2 045KB Transfer Speed 15 File15 i avl 6 384KB 23 However it is worthwhile to note that the accuracv of transferring files between a SD Memorv Card and a USB Flash Drive cannot be assured to be a hundred percent accurate due to several factors The accuracv results of Tables 3 2 and Tables 3 3 will then be compared individuallv with the past research in which a USB Slave to Slave File Transfer Device shown in Figure 3 5 is used and tested its file accuracv The statistical treatment to be used
37. r advantage of the device Since the device is capable of transferring data to and from the Secure Digital card and Universal Serial Bus disk only it is recommended to have additional memory slots of some memory cards such as Memory Stick Pro and the like This will enable the microcontrollerto be used to handle numerous input output ports for serial communication The filenames to be displayed in the device are limited to only 8 characters long and the file extension is limited to 3 characters only because of the FAT FAT32 implications If ever future researchers advise the support of New Technology File System NTFS on the 35 36 device the USB host controller should be replaced with a host controller to support it The need to implement the system using larger memory size is also recommended Copy paste delete and auto replace of file are the only features of the current device Additional file management features should be added to make the device more useful and beneficial since it can be easily implemented inside the program code of the device as long as the right algorithm and structure is acquired REFERENCES 1 Mark Alvin U Chua Charles D Jorge Ana Marian M Pedro Brian Emmanuel G Tam Gregory G Cu Implementation of a USB Slave to Slave File Transfer Device Using Microcontrollers 2 Jan Axelson USB COMPLETE Second Edition Madison WI Lakeview Research LLC 2004 3 Jan Axelson Serial Port Complete
38. r data bits and are compatible though they have different initialisation The major difference is that the SD card is designed to provide optional security by allowing encryption of the device contents The MMC card supports additional bus widths up to 8 bits The SD card also supports several modes that are not present in the MMC card including SDIO secure digital input output that can be used as an external communications interface using the standard SD card format The application is based on the use of an MMC SD card interface daughter board connected to the eCOGIk evaluation board The daughter board contains a card socket as well as the necessary connections for monitoring and control Figure 2 3 shows the schematic of the daughter board including eCOG1k specific connections GPIOIS Figure 2 3 Connection Schematic for the MMC SD card socket Elements of a Transfer According to Jan Axelson who wrote the book entitled USB COMPLETE Second Edition the elements of transferring data consist of the following Please refer to Figure 2 4 All bus traffic travels to or from a device endpoint The endpoint is a buffer that stores multiple bytes Typically the endpoint is a block of data memory or a register in the controller chip The data stored at an endpoint may be received data or data waiting to transmit The host also has buffers that hold received data and data waiting to transmit but the host does not have endpoints
39. rch It is important to note that the speed of data transfer is slow compared to a computer due to the host controller used which is USB 2 0 full speed Theoretically if the host microcontroller used follows the USB 2 0 high speed standard the speed of data transfer should be much faster than the computer since there is no associated overhead in the bus compared to the computer The main objective of this study is to develop a device that can transfer files from flash drive to memory card and vice versa Specific objectives include the following to create an interface that will list all the file s or folder s in the current directory to make sure that the user has the ability to navigate through it using the buttons to have a successful file transfer between flash drive and memory card and to determine whether there is a significant difference between the file accuracy of transferring file from USB Flash Drive to SD Memory Card or vice versa used in the present study and that of the previous study Since there is only one display the user can choose if he she wants to see the contents of the flash drive or the memory card only The compatibility between the flash drive and the memory card will depend on the capacity standard used and additional features added by the manufacturer such as creating additional encrypted partition The design is an extension of the previous research but of different implementation The device should handle all file for
40. sh drive with 100 data integrity using MD5 checksum algorithm That research also benchmarks the speed of data transfer depending on the size of the file and the depth of the file location in a folder The device consumes a small amount of power only has low memory footprint and less resources are utilized The research project being proposed in this study addresses the problem of flash drive to flash drive transfer without the use of a computer The transfer of data between flash drive and memory card is not included This study focuses on a design that is inexpensive and can readily be implemented without the use of a computer Figure 1 1 shows the comparison of prices for the microcontrollers used by the previous research and the proposed system Microchip Microcontrollers 18FXXX High Performance Series Description in PIC18F458 1 P PIC18F458 Flash 40 pin 32kB 40MHz Microcontroller with CAN no PIC18F4550 1 P PIC18F4550 Flash 40 pin 32kB Microcontroller with USB Figure 1 1 Comparison of Prices of Microcontrollers used 13 It can be shown that PIC18F458 the one that was used in the previous research costs more than the microcontroller that will be used in this research project which is PIC18F4550 The previous researchers used 20x4 Liquid Crystal Display LCD screen which is larger than the size of the screen that will be used in the device and therefore it will not be as expensive as the device used in the previous resea
41. the user input if choice 0 gotoinputA gain else if choice 1 Command FM 1 devOn Flash Files jelsef Command FM S devOn SD Mem Files if HandleErrorCodes Dummy_Read Cout 3 Error gotoinputA gain else view files in storage JustOpen clrscr Command IL Dummy Read Cout 1 Loading Delay_us 3000 nextMinus1 0 Current if cancel is pressed clrscr Cout 2 Press Next do if PORTD FO0 ithis is the next button gt pressNext Delav ms 500 nextMinus1 getFileString if isEof nextMinus 1 isEof 0 Cout 4 EOF Press Previous else FilesDisplay end of next button if PORTC F2 this is the previous button lt Delay_ms 500 prevCtr 1 45 nextMinus1 if nextMinus 1 lt 0 nextMinus1 else Command IL Dummv Read while prevCtr lt nextMinus 1 getFileStringQ prevCtr end of while FilesDisplay end of else end of if previous button jwhile lPORTC FO option go here if options is pressed if PORTC FO automatically go here clrscr Delay_ms 500 if checkIfFolder fAttrib Cout 1 Home Cout 2 Open Folder Cout 3 Paste FolOpInputA gain choice Cin 3 if choice 0 cancel is pressed goto Current just back else if choice 1 goto Start else if choice 2 for open folder UARTI Write Text
42. tialize SD Files clrscr Wait for input from button X _ Bee Pores Y mt De ae ki PA a While not option tits N ie N lt bi 2 TI Next Button P lt Previous Button gt SS utton Si Le Se S OX P e SS SS N Er y Ta checkifFolder Get Next File Get Previous File Displav option choices DS Le LR AS ata ik ki AN jii N a p S mm NUN if Fold d Choice cin 3 y Delete L Copy gt lt Paste gt lt BER SED gt A lt qg N ll TM Bi 7 y y y Delete Copy Paste OpenFolder Figure 3 4 Program Flow Chart Main Display Open USB Mem Files Display Open SD Mem Files Display CDES Return s there a copy in memory Clear previous copied file ge Write Serially the DF and CR Write serially the command to host controller for copy clrscr K Return Return Figure 3 5 Program Flow Chart Home and Copy Geen pn char isCancel 0 isOk 0 char input 1 Get Input from Button Previous Button Next Button Ok Button Cancel Button input Input isOk 1 isCancel 1 Input gt maxindex input maxindex ta Return input Figure 3 6 Program
43. tudy existsin managing file between different devices like SD memory card and USB flash drive Chapter 3 FILE TRANSFER BETWEEN SD MEMORY CARD AND USB FLASH DRIVE THROUGH UART PIC INTERFACING WITH MASS STORAGE DEVICE CONTROLLER Abstract Flash memories like SD Memory card and USB Flash drive are widely used nowadays However transferring files within those storage devices cannot be done without the aid of desktop computers laptop etc This paper presents the research and development of a device as an alternative to computers in transferring files between a USB Flash Drive and SD Memory Card A mass storage device controller together with a microcontroller was used to initiate the operation of the device with a maximum capacity of 4 GB in the USB Flash Drive and 4 GB Memory Card The study beganby constructing the main device down to its testing part in which the integrity and accuracy of files were considered T test was used as a Statistical method to determine whether the difference between two proportions that is the file accuracy of transferring file from the device and from the device of the previous research is significant in the Implementation of a USB Slave to Slave File Transfer Device Using Microcontrollers Though some errors were produced in the testing process the final result stated that there was no significant difference between the file transfer accuracy of the device and the previous study Keywords USB Flash Drive SD Me
44. tx File13 exe File14 pdf File15 avi f417634ec8dbfa3fb6c57c36a 614398d 30be90d08f03ada749f661b2 efafOlec 02e3ac32137dd06b10df59b4 46885fec 3a9500a528286d773309bc1d 21491469 c7722c4ec4fc3ac8 18658ef00 a49e2b4 al 15b7bb3d272fb148e1fb75 85ffd806 f417634ec8dbfa3fb6c57c36a 614398d 30be90d08f03a4a749f661b2 efafOlec 02e3ac32137dd06b10df59b4 46885fec 3a9500a528286d773309bc1 d21d91469 c7722c4ec4fc3ac8 18658efaa a83f7c4 21 10090 10090 10090 10090 71 87590 0 On the other hand Table 3 6 summarizes the file accuracy percentage from USB Flash Drive to SD Memory Card Based from the results in the table the checksum of the source is equal to that of the destination for all file transfer operations Therefore the accuracy percentage for all files being transferred from USB Flash Drive to SD Memory Card is 100 Table 3 5 File Accuracy Percentage using MD 5 Checksum from USB Flash Drive to SD Memory Card File Source Name MD5 Filel pka b7calcc671e70c0cd350833e 2b22e1f3 File2 txt 88fcc62dbc58d1f4b3fa8dedb b6aaf38 File3 mp3 6418464099797641232d7dd c9a96b6ee File4 exe c7722c4ec4fc3ac8 18658ef00 a49e2b4 FileS xls 13ae3a6aldb81cfcef570d0a2 4ea09e2 File6 docx 59cb7d6c15ffe465a76c1b01 66f772c File7 bmp 033d47aab079aa403f96f033c 78eb5ec File8 cache c8221439a4d15092bc29f0f0 7909fef7 File9 rar 5d84e04b9c 1 1f600e9daaae7 4dec0b9d File10 jpg f417634ec8dbfa3fb6c57c36a 614398d Filell exe 30be90d08f03a4a
45. vice that copies and transfers file from one flash drive to another flash drive using the USB 1 1 interface without the need for a Personal Computer PC to act as mediator Figure 2 1 shows the system setup while Figure 2 2 shows the general block diagram of the system Contents of the flash drives are displayed in their 8 3 filename format through a twenty character by four lines sized dot matrix character liquid crystal display LCD The system is also able to check for identical file folder directory names and requests for a user confirmation to either proceed and overwrite a file folder directory or not In addition the system is able to check if there is a sufficient memory space for the file folder directory to be copied onto the destination flash drive if not the system requests the user to delete some files or folder directories to free some memory in the destination flash drive The system uses the Cypress CY7C67300 a programmable microcontroller and USB multi role embedded host peripheral controller which has its own Basic Input Output System and Framework program IU OU EE Ji LUULU OULELLEIULELRUIULER UUL Fig 2 2 General Block Diagram Interfacing To an MMC or SD Card via SPI Cyan Technology wrote an article entitled Interfacing to an MMC or SD Card via SPT The article discusses that MMC card and the SD card are flash memory storage based devices Both card types support proprietary data transfer protocols using fou

Download Pdf Manuals

image

Related Search

Related Contents

STP1-S02 USER MANUAL    2 Wählen Sie  

Copyright © All rights reserved.
Failed to retrieve file