Flash Qing Xu Tie Chen. Flash An electronic device Non-volatile Can be electrically erased and...

28
Flash Qing Xu Tie Chen

Transcript of Flash Qing Xu Tie Chen. Flash An electronic device Non-volatile Can be electrically erased and...

Page 1: Flash Qing Xu Tie Chen. Flash An electronic device Non-volatile Can be electrically erased and reprogrammed Usage: Digital Music Device Smartphones Digital.

Flash

Qing XuTie Chen

Page 2: Flash Qing Xu Tie Chen. Flash An electronic device Non-volatile Can be electrically erased and reprogrammed Usage: Digital Music Device Smartphones Digital.

Flash

An electronic deviceNon-volatileCan be electrically erased and reprogrammed

Usage:Digital Music DeviceSmartphonesDigital CamerasRemovable Storage Devices

(picpedia.com)

Page 3: Flash Qing Xu Tie Chen. Flash An electronic device Non-volatile Can be electrically erased and reprogrammed Usage: Digital Music Device Smartphones Digital.

Non-Volatile Memory

Non-Volatile Memory in Embedded System:• Stores data after power down– Battery Change– Consumer Electronics

Page 4: Flash Qing Xu Tie Chen. Flash An electronic device Non-volatile Can be electrically erased and reprogrammed Usage: Digital Music Device Smartphones Digital.

FlashNon-Volatile Memory• Read-Only: ROM• Read-Write: EPROM, E2PROM, FLASH

(Figure Credit: Prof. Dennis Sylvester)

Page 5: Flash Qing Xu Tie Chen. Flash An electronic device Non-volatile Can be electrically erased and reprogrammed Usage: Digital Music Device Smartphones Digital.

Flash• Flash Development vs. Moore’s Law

(Figure Credit: H. Cho, Stanford University)

Page 6: Flash Qing Xu Tie Chen. Flash An electronic device Non-volatile Can be electrically erased and reprogrammed Usage: Digital Music Device Smartphones Digital.

MOSFET

How does a MOSFET transistor work?

(Wikipedia - Threshold formation in MOSFET)

Page 7: Flash Qing Xu Tie Chen. Flash An electronic device Non-volatile Can be electrically erased and reprogrammed Usage: Digital Music Device Smartphones Digital.

Flash

How is Flash different from MOSFET?

(Figure Credit: Prof. Grishman, CSCI Inc.)

Page 8: Flash Qing Xu Tie Chen. Flash An electronic device Non-volatile Can be electrically erased and reprogrammed Usage: Digital Music Device Smartphones Digital.

Flash Operations

Writes a Logic ZEROWrites a Logic ONE

(Figure Credit: S. Verna, Stanford University)

Page 9: Flash Qing Xu Tie Chen. Flash An electronic device Non-volatile Can be electrically erased and reprogrammed Usage: Digital Music Device Smartphones Digital.

Flash Wearing

Erosion of a flash memory• Programming and erasing breaks down the oxide layer in the

transistor.• Life of 100,000 Program/Erase cycles

(Figure Credit: Prof. Li-Ping Zhang)

Page 10: Flash Qing Xu Tie Chen. Flash An electronic device Non-volatile Can be electrically erased and reprogrammed Usage: Digital Music Device Smartphones Digital.

Flash Wearing

Flash Memory Controller• Arrange data so that programming/ erasing is distributed

evenly• A block of extended life memory is allocated for the

controller, stores operation data.

Flash Wear Leveling Algorithm:• Dynamic• Static

Page 11: Flash Qing Xu Tie Chen. Flash An electronic device Non-volatile Can be electrically erased and reprogrammed Usage: Digital Music Device Smartphones Digital.

Flash Wear Leveling

Dynamic Wear Leveling: - Controller selects new free data block before write - Mapping points to new block location after write

Disadvantage: - Static blocks where data do not change (eg. OS file) wears slower than other blocks- Reduce lifespan of the flash drive

Page 12: Flash Qing Xu Tie Chen. Flash An electronic device Non-volatile Can be electrically erased and reprogrammed Usage: Digital Music Device Smartphones Digital.

Flash Wear Leveling

Static Wear Leveling: - Works the same as dynamic wear leveling- Static blocks that do not change are periodically moved

Disadvantage:- Moving static blocks takes time

Page 13: Flash Qing Xu Tie Chen. Flash An electronic device Non-volatile Can be electrically erased and reprogrammed Usage: Digital Music Device Smartphones Digital.

Flash Wear Leveling

Dynamic vs. Static

What to use? Use Both!

Static Dynamic

Performance Slower Faster

Complexity More Complex Less Complex

Endurance Longer Shorter

Page 14: Flash Qing Xu Tie Chen. Flash An electronic device Non-volatile Can be electrically erased and reprogrammed Usage: Digital Music Device Smartphones Digital.

Introduction to AT45DB161D

Page 15: Flash Qing Xu Tie Chen. Flash An electronic device Non-volatile Can be electrically erased and reprogrammed Usage: Digital Music Device Smartphones Digital.

Important Facts

• 4,096 Pages (512/528 Bytes/Page) Main Memory (2MB in total)

• Single 2.5V - 3.6V or 2.7V - 3.6V Supply• SPI Serial Port Interface– Mode 0 and Mode 3 compatible

• Two SRAM Data Buffers (512/528 Bytes)• 100,000 Program/Erase Cycles Per Page

Minimum

Page 16: Flash Qing Xu Tie Chen. Flash An electronic device Non-volatile Can be electrically erased and reprogrammed Usage: Digital Music Device Smartphones Digital.

Block Diagram

(Figure Credit: AT45DB161D Datasheet)

Page 17: Flash Qing Xu Tie Chen. Flash An electronic device Non-volatile Can be electrically erased and reprogrammed Usage: Digital Music Device Smartphones Digital.

Pin ConfigurationSymbol Function Asserted State Type

CSn Chip Select Low Input

SCK Serial Clock - Input

SI Serial Input - Input

SO Serial Output - Output

WPn Write protection Low Input

RESETn Reset Low Input

RDY/BUSYn Ready/Busy Low Output

VCC Device Power Supply - Power

GND Ground - Ground

Page 18: Flash Qing Xu Tie Chen. Flash An electronic device Non-volatile Can be electrically erased and reprogrammed Usage: Digital Music Device Smartphones Digital.

SPI Interface• A valid instruction starts with the falling edge of CS

followed by the appropriate 8-bit opcode and the desired buffer or main memory address location.

Page 19: Flash Qing Xu Tie Chen. Flash An electronic device Non-volatile Can be electrically erased and reprogrammed Usage: Digital Music Device Smartphones Digital.

Read Operations

• Main Memory Page Read

• Buffer Read

• Main Memory Page to Buffer Transfer

(Figure Credit: AT45DB161D Datasheet)

Page 20: Flash Qing Xu Tie Chen. Flash An electronic device Non-volatile Can be electrically erased and reprogrammed Usage: Digital Music Device Smartphones Digital.

Write Operations

• Buffer Write

• Buffer to Main Memory Page Program

(Figure Credit: AT45DB161D Datasheet)

Page 21: Flash Qing Xu Tie Chen. Flash An electronic device Non-volatile Can be electrically erased and reprogrammed Usage: Digital Music Device Smartphones Digital.

Erase Operations

• Page Erase (528/512 bytes)• Block Erase (8 pages)• Sector Erase (256 pages)• Chip Erase (all 16 sectors, which is 2MB)

Page 22: Flash Qing Xu Tie Chen. Flash An electronic device Non-volatile Can be electrically erased and reprogrammed Usage: Digital Music Device Smartphones Digital.

Modifying Data in Flash

(Figure Credit: AT45DB161D Datasheet)

Page 23: Flash Qing Xu Tie Chen. Flash An electronic device Non-volatile Can be electrically erased and reprogrammed Usage: Digital Music Device Smartphones Digital.

Why do We need Buffers?

Because it saves us a lot of trouble!• The minimum size of erase/programming is

one page.• You will have to send exactly one page data

through SPI for every write operation without buffers.

• You may have to first send back one page data from flash even before that!

Page 24: Flash Qing Xu Tie Chen. Flash An electronic device Non-volatile Can be electrically erased and reprogrammed Usage: Digital Music Device Smartphones Digital.

Timing Issues

• Erase and Program time• Flash output delay• Setup time, hold time of

all serial port…

You are able to find timing diagrams and characteristic tables in datasheet.

(Figure Credit: AT45DB161D Datasheet)

Page 25: Flash Qing Xu Tie Chen. Flash An electronic device Non-volatile Can be electrically erased and reprogrammed Usage: Digital Music Device Smartphones Digital.

Power Issues• 7 mA Active Read

Current Typical• 12 mA Active

Program/Erase Current Typical

• 25 μA Standby Current Typical

• 9 μA Deep Power Down Typical

(Figure Credit: AT45DB161D Datasheet)

Page 26: Flash Qing Xu Tie Chen. Flash An electronic device Non-volatile Can be electrically erased and reprogrammed Usage: Digital Music Device Smartphones Digital.

Other Features

• Software Sector Protection• Sector Lockdown• Status Register• Security Register• Deep Power-down and Resume• Page Size Option

Page 27: Flash Qing Xu Tie Chen. Flash An electronic device Non-volatile Can be electrically erased and reprogrammed Usage: Digital Music Device Smartphones Digital.

Reference• http://www.eeherald.com/section/design-guide/esmod16.html• http://

digitalelectronics.blogspot.com/2009/10/flash-memroies-introduction.html

• http://picpedia.com/flash-memory-cards• S. Verma, “Tunnel Barrier Engineering for Flash Memory Technology”,

Stanford University, May 2010• H. Cho, “Low Power, Highly Scalable, Vertical Flash Memory Cell and

MOSFET”, Stanford University, Sept 2007• ATMEL, AT45DB161D 16-megabit DataFlash Specification• L.P. Zhang, “Low Cost Wearing Algorithm for Block Mapping Solid State

Disks”, National Chiao Tung University, Taiwan‐

Page 28: Flash Qing Xu Tie Chen. Flash An electronic device Non-volatile Can be electrically erased and reprogrammed Usage: Digital Music Device Smartphones Digital.

Questions?