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.

Pablo020's Content

There have been 5 items by Pablo020 (Search limited from 05-May 23)


By content type

See this member's

Sort by                Order  

#60882 Where can I find StorageDevice?

Posted by Pablo020 on 06 December 2014 - 03:37 AM in Netduino 2 (and Netduino 1)

Ok, I found the DLL and StorageDevice Class  ... I needed to add a reference to SecretLabls.NetMF.IO to my project .. that's all.

After reading more and more posts about ND+2 and sd card support ... I think I have it clear now that and external SD Card is not supported on the ND+2, since the NetMF only supports 1 SD card, and the ND+2 has one onboard already.

 

The one that is supported, does not seem to need the Storage Device class, since the mounting of SD card is already handled behind the scenes by the SecretLabs framework ...

 

Am I right??




#60881 Which reference to use

Posted by Pablo020 on 06 December 2014 - 03:32 AM in Netduino Plus 2 (and Netduino Plus 1)

Hello,

this might sound like a really stupid question, I hope it is easy to answer for someone ....

 

I have a NetDuino Plus 2, running VS2013 and the latest firmware and framework.

 

Which DLL's should I include in my projects?

SecretLabs.NETMF.Hardware.Netduino, or ...

SecretLabs.NETMF.Hardware.NetduinoPlus, or ...

Both??

 

The obvious would be to include NetDuinoPlus, however when I create a new application of Type Netduino Plus 2, it automatically ads the SecretLabs.NETMF.Hardware.Netduino reference and not the SecretLabs.NETMF.Hardware.NetduinoPlus reference.

 

 

And .. do I need to reference the following:

SecretLabs.NETMF.Diagnostics

SecretLabs.NETMF.Hardware

SecretLabs.NETMF.Hardware.AnalogInput

SecretLabs.NETMF.Hardware.PWM
SecretLabs.NETMF.IO
 
Thanks for clearing this up if possible.
Paul

 

 

 

 




#60880 Problem getting I2C to start

Posted by Pablo020 on 06 December 2014 - 01:34 AM in Netduino Plus 2 (and Netduino Plus 1)

Hello folks,

I have a ND+2, VS2103, Latest firmware etc..

 

I run the following code snippet:

using System;
using System.Net;
using System.Net.Sockets;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;

namespace BasicMaster
{
    public class Program
    {
        private static I2CDevice.Configuration _i2cDeviceConfiguration = null;
        private static I2CDevice _i2cDevice;
        public static void Main()
        {
            Debug.Print("Main started");
            _i2cDeviceConfiguration = new I2CDevice.Configuration(0x00, 400);
            _i2cDevice = new I2CDevice(_i2cDeviceConfiguration);


            for (int i = 0; i < 100000; i++)
            {
                SendOnlyI2cMessage(i);
                Thread.Sleep(50);
            }
        }
        private static void SendOnlyI2cMessage(Int32 counter)
        {
            I2CDevice.I2CTransaction[] transactions = new I2CDevice.I2CTransaction[1];

            byte[] RegisterNum = new byte[1] { 2 };
            transactions[0] = I2CDevice.CreateWriteTransaction(RegisterNum);
            Int32 executeResult = _i2cDevice.Execute(transactions, 1000);
            if (executeResult == 0)
            {
                Debug.Print("I2C transaction, Counter = " + counter.ToString() + ", ExecuteResult = Failed (value = 0)");
            }
            else
            {
                Debug.Print("I2C transaction, Counter = " + counter.ToString() + ", ExecuteResult = " + executeResult.ToString());
            }
        }
    }
}

I connected the SD and SC pins via 10K resistors to the +3.3V.

A scope is connected to both the clock and the data (SC and SD pins).

 

 

Scenario 1:

- build app

- deploy and debug app

- app starts and code is running, as I see the debug print stuff coming in.

 

Result: 

I see both channels on the scope indicating a flat 3.3V... but no signs of any signal generated by the netduino. (See first attachment)

Strange ... I expected the execute to fail, however, I ought to see some 'proof' of attempts on the signals.

 

Then ... 

- I disconnect 3.3V pin, and reconnect ....

Result:

I see the expected signal. See second attachment.

 

 

The same effect I get in the following scenario:

 

Scenario 2:

- above code is running. I did the 3.3V disconnect - reconnect routine. And i can see the signal.

- I press the reset button of the ND+2

- After restart, again I see the image 1... a flat 3.3V

- Disconnect 3.3V and Reconnect 3.3V 

- Result: image 2, a clear signal!

 

 

Am I doing something wrong?

Can I fix this from the software?

 

Any feedback would be appreciated!!

 

Paul

Attached Files




#60870 Some help with my SD card issue

Posted by Pablo020 on 05 December 2014 - 01:51 AM in Netduino Plus 2 (and Netduino Plus 1)

Hello,

After experimenting a lot and reading all examples, I'm still not getting my SD card up and running.

So ... I thought, I'll go back to the bare basics ...

 

I have: Netduino Plus 2. Latest Firmware 4.3.1. SD Card formatted on FAT, 1.93GB

 

 

I created a new netduino plus 2 app.

Added the assemblies:

- System.io

- SecretLabs.NETMF.Hardware.NetduinoPlus

 

Removed :

SecretLabs.NETMF.Hardware.Netduino

 

Then I have this program:

 
using System;
using System.IO;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware;
using SecretLabs.NETMF.Hardware.NetduinoPlus;
 
namespace SimplySD
{
    public class Program
    {
        public static void Main()
        {
            // write your code here
            var fileName = @"\SD\test.txt";
            Debug.Print(fileName);
            byte[] testBytes = new byte[] { 1, 2, 3, 4 };
            File.WriteAllBytes(fileName, testBytes);
        }
    }
}
 

This ought to work right? Unfortunately it doesnt:

 

The result looks like:

A first chance exception of type 'System.NotSupportedException' occurred in Microsoft.SPOT.IO.dll
A first chance exception of type 'System.NotSupportedException' occurred in System.IO.dll
An unhandled exception of type 'System.NotSupportedException' occurred in System.IO.dll

 

Any ideas?

Paul

 

 

 

 

 

 




#60868 Where can I find StorageDevice?

Posted by Pablo020 on 04 December 2014 - 11:01 PM in Netduino 2 (and Netduino 1)

Hello,

I'm using netduino sdk (v 4.3.1), VS2013Pro and a netduino plus 2.

 

I'm trying to get an SD Card adapter working which I connected to the SPI bus. But i'm running into some questions.

 

All the samples I found are talking about StorageDevice.MountSD ...

 

But I cant find that class.

 

Where is it? Any ideas?

 

The same examples I've seen are using SecretLabls.NetMF.IO namespace. But that doesnt show up in my VS.

 

Any thoughts where to look? Do i need it?

Any feedback is highly appreciated!

Paul





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.