Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Serial Ram 23K640 Library


  • Please log in to reply
7 replies to this topic

#1 Nart Schinackow

Nart Schinackow

    Advanced Member

  • Members
  • PipPipPip
  • 38 posts
  • LocationLondon

Posted 02 July 2013 - 07:31 PM

Hello EveryOne,

I would like to share this simple library driver for the 23K640 chip which is a simple serial ram that is interfaced via SPI upto a speed of 20mhz, this comes very handy when needing extra ram storage and space.

 

The Library And DataSheet is available Here

 

Library comes with its documentation.

 

NOTE:- Soon a simple RamString class will be added in order to manipulate and store strings inside the serial ram.

 

 

Attached Files



#2 Nart Schinackow

Nart Schinackow

    Advanced Member

  • Members
  • PipPipPip
  • 38 posts
  • LocationLondon

Posted 05 July 2013 - 02:31 PM

Hello EveryOne,

The Library Was Updated With A New RamString Class Which Allows Storing Strings Into The Ram.

 

Check Out The Update Here

 



#3 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 05 July 2013 - 02:46 PM

Nice!

 

Many stream type classes can be created by passing a System.IO.Stream to the constructor. I'm not sure for which this holds true but I think it goes for TextWriter, StringWriter, XMLWriter etc.

 

This would mean that if your class RamStream where to inherit from the System.IO.Stream class (and implement a few basic methods), you could pretty much store all kinds of data onto that nifty little chip.

 

For example, I think it would let you implement memory files so that you can pass in a such a "virtual file" to any method expecting a regular FileStream.



#4 Nart Schinackow

Nart Schinackow

    Advanced Member

  • Members
  • PipPipPip
  • 38 posts
  • LocationLondon

Posted 05 July 2013 - 03:50 PM

Hello hanzibal,

Well yes i will reach that approach soon :), actually i am planning to use this ram to work with my HttpLibrarV3 So that it stores all the requests and manipulates them from the ram instead of an internal buffer hence making alot of free memory for code use and variable allocation,

my next project will be itegrating the ram with the HttpLibrary



#5 baxter

baxter

    Advanced Member

  • Members
  • PipPipPip
  • 415 posts

Posted 05 July 2013 - 07:12 PM

Here is a similar project (in VB) to demonstrate the use of secondary ram using a Microchip 23K256 32k byte SPI SRAM to store variables by name and log data. The project is here,

https://www.dropbox....7wf2/uxi2L9B_zk

It stores/retrieves the following types by name, String, Int16, Int32, Int64, UInt16, UInt32, UInt64, Single, Double, DateTime and Byte[]. For example to store and retrieve a variable,

Dim Data As SRAMStore = New SRAMStore()Dim StoredRecord As SRAMStore.FetchRecordDim MyDouble As Double = 0.000000012300011234964Data.StoreData("MyDouble", MyDouble)StoredRecord = Data.GetData("MyDouble")Debug.Print("MyDouble  " & StoredRecord.StringData) --> MyDouble  1.2300011234963999e-08and also,Dim D As Double = Data.GetData("MyDouble", True).TypeDataDebug.Print("MyDouble, D = " & D.ToString)Dim MyDate As DateTime = DateTime.NowData.StoreData("MyDate", MyDate)Dim DT As DateTime = Data.GetData("MyDate", True).TypeDataDebug.Print("MyDate, DT = " & DT.ToString(DateTimeFormat))

Name/Value pairs are maintained using a hashtable where the Value is a symbol record structure. It will also log data by time stamp using a queue to keep order in the hashtable. With the exception of string and Byte[], all of the above types are converted to a string and the bytes of the string are stored. No attempt is made to optimize storage by deleting unwanted variables. New variables are simply added sequentially. Also, conversion of value types to a string for storing as bytes is inefficient, but easy.

The project is for a netduino Plus, but it should also run on any Netduino by changing to the appropriate reference and pins. The 23K256 driver is from the Codeshare on the TinyClr forum and was written by Savich.



#6 Nart Schinackow

Nart Schinackow

    Advanced Member

  • Members
  • PipPipPip
  • 38 posts
  • LocationLondon

Posted 05 July 2013 - 09:02 PM

Hello baxter,

Thanks for providing that useful info :) , i checked the code and yes it is a very useful library, i will implement one with the same concept soon.



#7 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 06 July 2013 - 12:45 AM

Hello hanzibal,

Well yes i will reach that approach soon :), actually i am planning to use this ram to work with my HttpLibrarV3 So that it stores all the requests and manipulates them from the ram instead of an internal buffer hence making alot of free memory for code use and variable allocation,

my next project will be itegrating the ram with the HttpLibrary

Cool!

 

I really love this kind of small IC drivers, they're just so nice to have when you need them. It's really stupid we don't have a central repository for these kind of things.

 

As an example, people (including myself) keep making those LCD drivers with multi channel I2C support over and over...



#8 Nart Schinackow

Nart Schinackow

    Advanced Member

  • Members
  • PipPipPip
  • 38 posts
  • LocationLondon

Posted 14 July 2013 - 08:34 PM

Hello All,

As an example project using the 23K640 serial ram library Check Out The New Version Of The HttpLibrary V.3.1 which now supports an external ram for handling requests,

many changes where done to the previous version, an example project is available along with the library.

 

Download this library here






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.