Upload
gertrude-bailey
View
219
Download
0
Embed Size (px)
Citation preview
SD Card Data Logger
Senior Design II
Final Presentation
April 21, 2011
TEAM
Team Advisor:
Dr. Patrick Donohoe
James Felkins (EE) Team Leader, Web Design,
Test Board
Harry Corey (EE)
Test Cases, Hardware Design, Part Procurement
Brendan Babiak (EE)
Prototype Construction, Buffering Scheme, MDDFS
Jaron Martin (CPE)
Command Set, SPI/UART Input, MDDFS
OUTLINEIntroduction to Project• problem/solution• tech./practical constraints
System Overview• high-level system design• software solutions
Hardware Design• power• PCB
Testing• subsystems• features
Questions
WHAT IS THE S-DRIVE?
The S-Drive is an OEM module that accepts data through a serial connection and saves it to an SD card.
THE PROBLEM
SD cards are a viable storage medium with unique advantages but involve complex overhead.
SOLUTION
The S-Drive will handle the unwanted overhead and make SD cards a more desirable solution.
TECHNICAL CONSTRAINTS
Name Description
Communication The device uses UART and SPI data connections.
VoltageThe device supports an input voltage between 3.3 or 5 V.
Current DrawThe device draws a maximum current of 250 mA in active mode and less than 10 uA in sleep mode.
Storage MediumThe device interfaces with a standard size, 32 x 24 x 2.1 mm SD card.
Memory The device supports all SD cards up to 32 GB.
PRACTICAL CONSTRAINTS -
ECONOMICThe device must cost less than $60.
Competitor Price
VDRIVE2 $24.50 [4]
Logomatic v2 $59.95 [3]
Avisaro M20511 99.00 € (~$133) [2]
[2]
[4][3]
PRACTICAL CONSTRAINTS - MANUFACTURABILITYThe device must easily fit and integrate into other systems.
•Provided on a PCB
•No larger than 5 in2
•Easily mountable
SYSTEM OVERVIEW
SYSTEM OVERVIEWSoftware Implementation
-Microchip’s MDDFS library
-Command Interface
SYSTEM OVERVIEWSize constraint met
SYSTEM OVERVIEWCommand Set
Open File for Append
1 Opens the file LOG1.TXT for appending. Only use if no file is currently open. Returns 1 if successful, else returns error code. Creates the file if it does not exist.
a
Open File for Read
1 2 - ? File name followed by \n character to represent the end of the name. File pointer will start at the beginning of the file. Use only if no file is currently open. Returns 1 after each byte if OK, else returns error code.
o File Name
Close File
1 Closes the file so that another file can be opened or the SD Card can be safely removed. Use only if a file is open in either write or read mode. Returns 1 if successful, else returns error code.
c
Write Data1 2 3 - [4-257] The S-Drive will append the next NumBytes received to the end of the file. Use only
if the file is opened in write mode. Returns 1 after each byte if OK, else returns error code.w # of Bytes Data
Read Data
1 Each time the r command is is received, the next byte in the file is returned and the file pointer moves one by byte. Use only if the file is opened in read mode. Returns the next byte in the file. If at EOF, starts over at beginning of file.
r
Move Read Pointer
1 2 Moves the read pointer NumBytes without replying with each byte of data. Use only if file is open in read mode. Returns 1 if sucessful, else returns error code.m # of Bytes
Flush Buffer
1 Flushes the write buffer. Use to flush the buffer if you do not want to wait for the buffer to automatically get written. Use only if file is open in write mode. Returns 1 if successful, else returns error code.
f
Sleep1
Forces the S-Drive to enter sleep mode.s
Big File1 2 - ? ? Allows for long or unknown lengths of data to be written to SD card. Use only if the
file is opened in write mode. Returns 1 after each byte if OK, else returns error code. End this command by sending a NULL byte.
b Data NULL
SENDING LARGE FILES
Data size not pre-specified•Binary files may contain all possible byte values•Toggle wake pin to signal EOF
INTERFACE MODESSPI & UART
•multiple baud rates•config.txt file•jumper determines mode
BUFFERING SCHEMEFlow Control
•2.3 kB each buffer•READY pin
WHILE INACTIVEEnters ‘Sleep Mode’
•Enters mode via SLEEP command•Dedicated WAKE signal•Uses READY pin while re-initializing SD card
HARDWARE DESIGN & TESTING
HARDWARE INTERFACE
8 wires•UART/SPI TX & RX use same lines
SCHEMATIC
SD CARD SOCKETStandard-sized SD cards
•Supports adapters for mini- and micro- SD cards
POWER SUPPLYAccepts 3.3 and 5 V inputs
•Power mode determined by jumper•5 V mode uses a low-dropout LR
POWER SUPPLYCurrent draw
•SD card has own power rail•SD card is uses ~250uA while inactive•Sleep mode cuts power to SD card•Implemented with a low-dropout LR
POWER AND CURRENT DRAW (SPI)
Power (V) Inactive Current Draw (mA)
Active Current Draw (mA)
Sleep Current Draw (uA)
Constraint Met?
3.3 19.2 68 4.60 Yes
5 19.4 73 69.5 N/A
POWER AND CURRENT DRAW (UART)
Baud Rate Power(V) Inactive Current Draw (mA)
Sleep Current Draw (uA)
28800
3.3 18.6 8.8
5 18.7 74.0
57600
3.3 18.6 8.9
5 18.7 74.1
115200
3.3 18.6 8.9
5 18.7 74.1
PCBPractical Constraints
•Small•Affordable parts•Mountable
PCBIssues
•Disjoint ground planes•SPI buses fused•Issues corrected for web-site
SYSTEM TESTING
TEST-BOARD
SUBSYSTEMS– SPISPI Master SPI Slave
Logic Analyzer
SUBSYSTEMS– UART
Logic Analyzer
Realterm
FULL SYSTEM TESTING
Operational modes• 8 possible combo’s
TESTING - GUI
TESTING - GUIPython Tool
• Handles semantics• Very slow• Used to test robustness• Better demo
TESTING – LARGE FILESReading large file from SD card
• Took appx. 1 hour w/ Python tool for 20kB• File perfectly copied• Testing done in all modes• ~3.5 kbps reading and writing
TESTING – LARGE FILES
TESTING – REAL THRU PUT
Sending/Receiving a large file:• Intermediate MCU sends 5 million chars• Data rate ~15kB/s
TESTING – COMMAND SYNTAX
Command Functions• All functions do their job• Improper commands are ignored (no crash)
PRODUCT COST
FINAL PRODUCT PERFORMANCE
Issue Constraint Actual Spec Met?
Comm. Interface UART & SPI UART & SPI
Voltage 3.3 & 5 (V) 3.3 & 5 (V)
Current Draw <10 uA (sleep) ~4.5 uA
Storage Medium Standard SD Standard SD
SD Card Size Up to 32 GB Up to 32 GB
REFERENCES[7] Microchip, “PIC24F Family Reference Manual, Sect. 21 UART,” Microchip Technology Inc., January 26, 2010. [Online] . Available: http://ww1.microchip.com/downloads/en/DeviceDoc/en026583.pdf. [Accessed September 14, 2010].
[8] Microchip, “PIC24F Family Reference Manual, Sect. 23 Serial Peripheral Interface (SPI),” Microchip Technology Inc., March 22, 2007. [Online] . Available:http://ww1.microchip.com/downloads/en/DeviceDoc/39699b.pdf. [Accessed September 14, 2010].
[9] STEC, “SLDSxxxBS(I)U Data Sheet,” STEC Inc., March 2008. [Online] . Available: http://www.stec-inc.com/downloads/flash_datasheets/SLSDxxxB_I_U61000-05203.pdf. [Accessed September 14, 2010].
[10] Sparkfun Electronics, “Logomatic v2 Serial SD Datalogger,” On-Line Store,2010.[Online].Available:http://www.sparkfun.com/commerce/product_info.php?products_id=8627. [Accessed:September 14, 2010].
[11] C-ONE Technology Corp., “Wide Temperature Industrial SD Card Product Specification,” May 2010. [Online]. Available: http://www.psism.com/c-1sd.pdf. [Accessed: September 14, 2010].
QUESTIONS?