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.

kiwi65

Member Since 11 Sep 2014
Offline Last Active Jun 03 2016 12:50 AM
-----

Posts I've Made

In Topic: NetMF 4.2 and PKI

19 July 2015 - 09:20 PM

Chris/Anyone, does the Mini support PKCS#11?

 

Because we're having no luck creating Sessions, or enumerating Slots. We get 'NotSupported' exceptions.

 

All we really want to do is encrypt (RSA) from a public key that's within a X.509 certificate.


In Topic: Trying to communicate with a 24LC256

16 June 2015 - 05:29 AM

Hi Chris, Using the standard NetMF code:

    public class Ic24LC256
    {
        private readonly int _clockKhz;
        private readonly int _timeoutMilliseconds;

        /// <summary>
        ///     Contains the IC's address
        /// </summary>
        private readonly ushort _Address;

        /// <summary>
        ///     Reference to the IC on the I2C bus
        /// </summary>
        private I2CDevice _IcDevice;

        /// <summary>
        ///     Defines a 24LC256 EEPROM IC
        /// </summary>
        /// <param name="Address">The IC's address</param>
        public Ic24LC256(byte Address)
        {
            _Address = Address;
            _Init();
        }

        /// <summary>
        ///     Defines a 24LC256 IC
        /// </summary>
        /// <param name="A0">Address pin 0 state (False = Low/Gnd, True = High/Vcc)</param>
        /// <param name="A1">Address pin 1 state (False = Low/Gnd, True = High/Vcc)</param>
        /// <param name="A2">Address pin 2 state (False = Low/Gnd, True = High/Vcc)</param>
        public Ic24LC256(bool A0, bool A1, bool A2, int clockKhz, int timeoutMilliseconds)
        {
            _Address = (byte) (0x50 + (A0 ? 1 : 0) + (A1 ? 2 : 0) + (A2 ? 4 : 0));
            _clockKhz = clockKhz;
            _timeoutMilliseconds = timeoutMilliseconds;
            _Init();
        }

        public int Read(UInt16 Address, byte[] ReadBuffer)
        {
            // Splits the address in two bytes
            byte[] AddressBytes =
            {
                (byte) (Address >> 8), // most significant address byte
                (byte) (Address & 0xff) // least significant address byte
            };

            // Queues the transaction (first write the address, then read the response)
            I2CDevice.I2CTransaction[] ReadTransaction =
            {
                I2CDevice.CreateWriteTransaction(AddressBytes),
                I2CDevice.CreateReadTransaction(ReadBuffer)
            };

            // Executes the transaction
            return (_IcDevice.Execute(ReadTransaction, _timeoutMilliseconds));
        }

        public int Write(UInt16 Address, byte[] WriteBuffer)
        {
            // Splits the address in two bytes
            byte[] AddressBytes =
            {
                (byte) (Address >> 8), // most significant address byte
                (byte) (Address & 0xff) // least significant address byte
            };

            // Queues the transaction (first write the address, then write the data)
            I2CDevice.I2CTransaction[] WriteTransaction =
            {
                I2CDevice.CreateWriteTransaction(AddressBytes),
                I2CDevice.CreateWriteTransaction(WriteBuffer)
            };

            // Executes the transaction
            return (_IcDevice.Execute(WriteTransaction, _timeoutMilliseconds));
        }

        /// <summary>
        ///     Initiates the I2C-bus
        /// </summary>
        private void _Init()
        {
            var IcConfig = new I2CDevice.Configuration(_Address, _clockKhz);
            _IcDevice = new I2CDevice(IcConfig);
        }
    }

I've played with I2C InternalAddress (repeated start bit) support, but to no avail. It was about then I discovered that removing the eeprom from my breadboard made no difference to the program output.... leading me to think I2C just isn't working at all.

 

Appreciate your help .. this problem is driving me nuts. Well... more nuts than my colleagues already take me for :)


In Topic: .NET MF 4.3 or > and Visual Studio

14 June 2015 - 07:46 PM

Chris, I'm keen to understand the relationship between NetMF version, SDK version and hardware.

 

I see above that we can use the Netduino 4.3.1 SDK with a Mini. I'm wanting to update my Mini project with the most stable versions of NetMF and SDK.. and note there's a newish 4.3.2 SDK. Should I install that? 

 

Have been struggling to get my Mini talking I2C to a common eeprom.. and have pretty much removed software and hardware from the problem domain ... so hoping it's something to do with SDK versions.


In Topic: Retain Data While Powered Off

14 June 2015 - 05:54 AM

Hi Mark, Thanks for coming back to me. It's been a lonely couple of days! Yes, I have 4k7 pullups, one on each of the SCL and SDA lines. 


In Topic: Retain Data While Powered Off

14 June 2015 - 05:22 AM

HI Dave,

 

Looks like you've had some success getting your Mini to talk I2C. I'm frustrated at my inability to do likewise, and wonder if I could trouble you for a little help....

 

In a nutshell, I've been trying (unsuccessfully) to get my Mini hooked up to a 24LC256 eeprom. After several days I've concluded that

 

a) My Mini and eeprom hardware setup correctly. I've checked and aligned with 5 or more comments/posts/photos, and confirmed against the datasheet

 

B) My program is correct. The last version I coded by hand turned out to be practically identical to Stefan's, so I binned mine and I'm now using his!

 

c) There is a pesky question floating around in my mind about I2C bugs in the 4.2 firmware. Here's what I'm running:

 

 

.NetMF v4.2.0.0

NetduinoMini, Build Date:        Sep 19 2012 19:40:47
ARM Compiler version 410894
 
TinyCLR (Build 4.2.0.0)
 
Starting...
Created EE.
Started Hardware.
Create TS.
Loading start at 13ed64, end 154648
Assembly: mscorlib (4.2.0.0)
Assembly: Microsoft.SPOT.Native (4.2.0.0)
Assembly: Microsoft.SPOT.Hardware (4.2.0.0)
Assembly: Microsoft.SPOT.Hardware.SerialPort (4.2.0.0)
Assembly: Microsoft.SPOT.IO (4.2.0.0)
Assembly: System.IO (4.2.0.0)
Assembly: Microsoft.SPOT.Hardware.PWM (4.2.0.1)
Assembly: SecretLabs.NETMF.Diagnostics (4.2.0.0)
Assembly: SecretLabs.NETMF.IO (4.2.0.0)
Loading Deployment Assemblies.
Attaching deployed file.Assembly: Microsoft.SPOT.Graphics (4.2.0.0) 
Attaching deployed file.Assembly: Microsoft.SPOT.Net.Security (4.2.0.0)
Attaching deployed file.Assembly: SecretLabs.NETMF.Hardware.NetduinoMini (4.2.0.1)
Attaching deployed file.Assembly: System.Http (4.2.0.0)
Attaching deployed file.Assembly: System (4.2.0.0)
Attaching deployed file.Assembly: System.Net.Security (4.2.0.0)
Attaching deployed file.Assembly: Json.NetMF (1.3.0.0)
Attaching deployed file.Assembly: Roam.Scout (1.0.0.0)
Attaching deployed file.Assembly: Microsoft.SPOT.Net (4.2.0.0)
Attaching deployed file.Assembly: SecretLabs.NETMF.Hardware (4.2.0.0)

 

Dave, is there anything you'd suggest I try to get my I2C eeprom working? I've run out of investigative energy... and Google now turns up pages of purple links... ie I've been to all of those pages already!

 

Thanks in advance.

 

Andrew


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.