Code Monkey home page Code Monkey logo

arduino-storage's Introduction

Arduino-Storage

The Storage library for Arduino is designed to abstract handling of external memory, and allow block read/write and streaming of data. The library includes device drivers for SPI SRAM (23LC512/1024), 2-Wire EEPROM (AT24CXX) and internal EEPROM.

Device driver for external storage such as EEPROM and SRAM should implement the Storage class virtual member functions and supply the number of bytes on the device.

The Storage class supports linear allocation. The Storage::Block class handles the allocated block and provides functions to read and write to the block.

In many cases the external block contains data that mirrors data used in the applications. The Storage::Cache handles read and write between the block on external storage and data/variables. The Storage::Cache class also allows handling of large vectors on external storage and element/member access.

Version: 1.0

Classes

Drivers

Example Sketches

  • Benchmarks measurement of characteristics.
  • Block read/write eeprom blocks.
  • Cache cache local variable.
  • Persistent read/write configuration.
  • Stream storage as a print stream.
  • Vector handling large sample vectors.

Benchmarks

AT24C32, 2-Wire EEPROM, 100 KHz

Read

N us us/byte kbyte/s
1 528 528.00 1.89
10 1352 135.20 7.40
100 9680 96.80 10.33
1000 93128 93.13 10.74

Write

N us us/byte kbyte/s
1 408 408.00 2.45
10 1236 123.60 8.09
100 20540 205.40 4.87
1000 206280 206.28 4.85

Note: 1) The read/write operations have a three byte header (8-bit command, and 16-bit address). 2) Write performance increases up to page size. When the block size is larger than the page size the write operation will wait for the device to complete the page write. Typical max 5-10 ms per page. 3) 400 KHz (and even 800 KHz) clock can be used.

23LC1024, SPI SRAM, 8 MHz

Read

N us us/byte kbyte/s
1 24 24.00 41.67
10 36 3.60 277.78
100 156 1.56 641.03
1000 1344 1.34 744.05

Write

N us us/byte kbyte/s
1 24 24.00 41.67
10 36 3.60 277.78
100 172 1.72 581.40
1000 1468 1.47 681.20

Note: The read/write operations have a four byte header (8-bit command, and 24-bit address).

EEPROM

Read

N us us/byte kbyte/s
1 4 4.00 250.00
10 16 1.60 625.00
100 112 1.12 892.86
1000 1072 1.07 932.84

Write

N us us/byte kbyte/s
1 4 4.00 250.00
10 30780 3078.00 0.32
100 308140 3081.40 0.32
1000 3077476 3077.48 0.32

Note: The internal eeprom has a single byte buffer and write of multiple bytes will wait for the device to complete previous write. Typical 3 ms.

Dependencies

arduino-storage's People

Contributors

mikaelpatel avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.