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

News from the MBN team


  • Please log in to reply
13 replies to this topic

#1 Bec à Fuel

Bec à Fuel

    New Member

  • Members
  • Pip
  • 8 posts
  • LocationFrance

Posted 06 February 2015 - 06:43 PM

We have introduced a new feature in the MBN Core, known as Storage class.
 
In short : this class allows the use of different kinds of memories to be used with a single set of instructions, either for simple storage or for file-system (using the TinyFileSystem(*) driver).
 
Here is a sample code that demonstrate the (ease of) use of the new Storage feature :
 
  private static Storage _storage1, _storage2, _storage3, _storage4;
 
        public static void Main()
        {
            _storage1 = new FRAMClick(Hardware.SocketTwo);
            _storage2 = new FlashClick(Hardware.SocketOne);
            _storage3 = new OnboardFlash();
            _storage4 = new EEpromClick(Hardware.SocketOne, memorySize: 256);
 
            TestSimpleStorage(_storage1);
            TestSimpleStorage(_storage2);
            TestTFS(_storage3);
            TestTFS(_storage4);
         
            // We could also have used TFS with the FRAM and Flash Click boards, without changing anything else :
            TestTFS(_storage1);      // See how simple it is
            TestTFS(_storage2);
                     
            Thread.Sleep(Timeout.Infinite);
        }
      
      private static void TestSimpleStorage(Storage storage)
        {
            var bArray = new Byte[3];
 
            storage.WriteByte(10, 200);
            Debug.Print("Read byte @10 (should be 200) : " + storage.ReadByte(10));
            storage.WriteByte(200, 201);
            Debug.Print("Read byte @200 (should be 201) : " + storage.ReadByte(200));
 
            storage.WriteData(400, new Byte[] { 100, 101, 102 }, 0, 3);
            storage.ReadData(400, bArray, 0, 3);
            Debug.Print("Read 3 bytes starting @400 (should be 100, 101, 102) : " + bArray[0] + ", " + bArray[1] + ", " + bArray[2]);
        }
 
        private static void TestTFS(Storage storage)
        {
            var tfs = new TinyFileSystem(storage);
            if (tfs.CheckIfFormatted())
            {
                Debug.Print("Filesystem OK. Mounting...");
                tfs.Mount();
                Debug.Print(" Now reading settings.dat file...");
                if (!tfs.Exists("settings.dat"))
                {
                    Debug.Print("File does not exist");
                    return;
                }
                using (var fs = tfs.Open("settings.dat", FileMode.Open))
                using (var rdr = new StreamReader(fs))
                {
                    string line;
                    while ((line = rdr.ReadLine()) != null)
                    {
                        Debug.Print(line);
                    }
                }
            }
            else
            {
                Debug.Print("Formatting");
                tfs.Format();
                Debug.Print("Creating file");
                using (var fs = tfs.Create("settings.dat"))
                {
                    using (var wr = new StreamWriter(fs))
                    {
                        wr.WriteLine("<settings>");
                        wr.WriteLine("InitialPosX=200");
                        wr.WriteLine("InitialPosY=150");
                        wr.WriteLine("</settings>");
                        wr.Flush();
                        fs.Flush();
                    }
                }
                Debug.Print("FileCreated");
            }
        }
      
Here is a screenshot of the result on a 256KB EEprom Click board :
ScreenShot017.JPG
 
      
What does that mean ? It means that you can use almost any memory storage device with MBN and store data on it in a common and very simple way. As long as you know their capacities and how to read/write an array of byte on it, then you are ready ! 
And now that the drivers already exist for the most common memory kinds (see http://www.mikrobusnet.org/downloads-2 ), you even only have to change the capacity in one driver to have a storage device available in seconds !
 
Of course, you should be careful to not use the same chip with both TFS and simple storage. Their uses are obviously mutually exclusive.
 
An example of such setup can be found on the attached picture, where you can see a Flash Click board, a FRAM one and our Quail board with an onboard 8MB Flash chip.
Then, code like the following code can be used :
 

public static void Main()
        {
            _storage1 = new OnboardFlash();
            _storage2 = new FlashClick(Hardware.SocketOne);
            _storage3 = new FRAMClick(Hardware.SocketTwo);

            _storage1.WriteByte(10,value);
            var _otherValue = _storage2.ReadByte(20);
            var _tfs = new TFS(_storage3);
            if (tfs.Exists("settings.dat")) { Debug.Print ("File found"); }

            Thread.Sleep(Timeout.Infinite);
        }
 
This has had some implications on the MBN Core assembly and the different "memory devices" drivers (EEprom, Flash, FRAM, Onboard Flash). 
Onboard Flash is not a internal static class anymore but rather a single driver like any other. So if you do not need Onboard Flash support, then it will save you some memory for your program.
 
All this has made MBN Core assembly to change its version from 2.0 to 2.1. All the download links are now updated and we recommend you to switch to this new revision.
 
 
 
(*) TinyFileSystem (TFS) driver has been heavily modified by MBN but credits for the original driver go to Chris Taylor (Taylorza).


#2 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 07 February 2015 - 05:04 AM

Very nice, but you'd to file this post under the "Projects showcase" category for better visibility.

Thanks for sharing.


Biggest fault of Netduino? It runs by electricity.

#3 Bec à Fuel

Bec à Fuel

    New Member

  • Members
  • Pip
  • 8 posts
  • LocationFrance

Posted 07 February 2015 - 08:37 AM

Mario,

 

According to its subtitle, "Projects showcase" seems dedicated to Netduino projects. And our project is not "dedicated" to Netduino, although it can be run on Netduino boards as well, hence the choice of "General discussion".

 

If an admin thinks its place is in the projects showcase forum, he can move it there, then.



#4 Bec à Fuel

Bec à Fuel

    New Member

  • Members
  • Pip
  • 8 posts
  • LocationFrance

Posted 15 February 2015 - 01:52 PM

Here are some other news but this time more hardware related.

 

We have received our latest prototypes of the Quail mainboard. We also got the G-Adapters from TKA at the same time.

 

You can find out more about G-Adapters on our forum.

 

And this is not all ;)  

We have also a very good article by Stephen about using Virtual Sockets  with our drivers and other brands modules !

 

 

Regards,

_________

Christophe

MikroBus.Net

http://www.mikrobusnet.org

 

Attached Files



#5 Bec à Fuel

Bec à Fuel

    New Member

  • Members
  • Pip
  • 8 posts
  • LocationFrance

Posted 16 February 2015 - 09:41 AM

Here is another example for MBN VirtualSockets

 

I have a board that exposes the IC bus on a screw terminal (green & yellow wires on the picture) and a Devantech LCD in IC mode. How can I use the MBN driver for this LCD ?

Easy :

             var _vs = new Hardware.Socket
            {
                Scl = Hardware.SocketOne.Scl,
                Sda = Hardware.SocketOne.Sda
            };
            _lcd = new DevantechLcd03(_vs, 0xC8 >> 1)
            {
                BackLight = true, 
                Cursor = DevantechLcd03.Cursors.Hide
            };
            _lcd.ClearScreen();

            _lcd.Write(1,1,"Using...");
            _lcd.Write(1,2,"Virtual Sockets");

This LCD only needs IC pins and power to work, so I create a Virtual Socket with only the IC pins. And since IC is a bus, I do not even have to know the underlying real pins names. I simply take the ones assigned to Socket1. Any other socket on the Quail board will work as well.
 

Attached Files

  • Attached File  vs.jpg   101.26KB   0 downloads


#6 Juzzer

Juzzer

    Advanced Member

  • Members
  • PipPipPip
  • 135 posts
  • LocationHertfordshire, UK

Posted 16 February 2015 - 10:30 AM

Mint  :)



#7 Bec à Fuel

Bec à Fuel

    New Member

  • Members
  • Pip
  • 8 posts
  • LocationFrance

Posted 08 March 2015 - 08:49 PM

Hello all,

 

Today is a big day for us as the board is now available for sale on the MikroElektronika website : http://www.mikroe.com/quail/ 

 

MikroElektronika quality standards are quite high so you are now assured to have a "professionnal quality" board, with support for both hardware and software.

 

There is also a news post on their frontpage :
http://www.mikroe.co...icro-framework/

 

 

Every driver we provide is pure NETMF and is open-source. So it can be used for any module from any brand if it is using the same chip.

_________
Christophe

Attached Files



#8 Juzzer

Juzzer

    Advanced Member

  • Members
  • PipPipPip
  • 135 posts
  • LocationHertfordshire, UK

Posted 09 March 2015 - 06:53 PM

Even Minter :)



#9 neslekkim

neslekkim

    Advanced Member

  • Members
  • PipPipPip
  • 350 posts
  • LocationOslo, Norway

Posted 15 March 2015 - 01:14 PM

Is the chip on this big enough that we can compile the framework with gcc and get it to fit on the chip?

Afaik, the chip used on netduino is too small for that, but this one seems to have lot of flash?

 

To bad shipping cost half the price of the board... 


--
Asbjrn


#10 Juzzer

Juzzer

    Advanced Member

  • Members
  • PipPipPip
  • 135 posts
  • LocationHertfordshire, UK

Posted 15 March 2015 - 01:40 PM

Yes you can use GCC

 

I would email the MBN team about getting one sent from France direct as perhaps they can do cheaper shipping.



#11 scardinale

scardinale

    Member

  • Members
  • PipPip
  • 27 posts
  • LocationNew York, USA

Posted 15 March 2015 - 02:01 PM

Shipping by Post is roughly $9.00 USD (7-12 Business Days). If you do not select Post delivery, it will default to DHL Express which is $25 USD.

 

I will have two boards in a few days to be available to ship in the western hemisphere if anyone is interested.



#12 neslekkim

neslekkim

    Advanced Member

  • Members
  • PipPipPip
  • 350 posts
  • LocationOslo, Norway

Posted 15 March 2015 - 02:04 PM

Its written on the Mikroe.com site:

 

DHL Express: $25.00 USD for up to 5 Kg, usually arrives in 2-4 business days.

 

Post Office $25.00 USD for up to 5 Kg, usually arrives in 7-12 business days.

 

So, $25 either way, or is that an typo?


--
Asbjrn


#13 neslekkim

neslekkim

    Advanced Member

  • Members
  • PipPipPip
  • 350 posts
  • LocationOslo, Norway

Posted 15 March 2015 - 02:07 PM

Ok, it must be some standardtext, when trying to checkout, it shows me $9 for both DHL and Post.. strange system..


--
Asbjrn


#14 scardinale

scardinale

    Member

  • Members
  • PipPip
  • 27 posts
  • LocationNew York, USA

Posted 15 March 2015 - 02:16 PM

Standard boiler plate is very misleading. I have never had to pay the full price for any order from MikroE. The DHL Express is very fast from Serbia to the USA. It usually lands within two business days.






0 user(s) are reading this topic

0 members, 0 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.