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.

mobilegamer999

Member Since 15 Nov 2012
Offline Last Active Jan 20 2013 02:32 AM
-----

Topics I've Started

Netduino Plus 2 I2C Issues

09 January 2013 - 03:44 AM

Hello, I have a netduino plus 2, and I have been trying to get the I2C working for the past little white, with no success :(.

As it stands, I have very simple code (copied below), and a scope hooked up to the I2C lines.

My netduino is fully upgraded 4.2.1.2 and I have the correct pull-up resistors on the I2C lines, but the pins never change state, they always stay at 3.3v, or 0v with no pullups.

As far as software goes, it appears that the writes are timing out, because when putting a timeout of 1000ms, the function takes one second before it attempts to execute again.

 

Here is my current code.

 

I2CDevice.Configuration accelConfig = new I2CDevice.Configuration(0x53, 50);byte[] data = new byte[6];I2CDevice.I2CTransaction[] ReadAccel;ReadAccel = new I2CDevice.I2CTransaction[]{     I2CDevice.CreateWriteTransaction(new byte[]{0x30}),     I2CDevice.CreateReadTransaction(data)};I2CDevice accel = new I2CDevice(accelConfig);while(true){     int read1 = accel.Execute(new I2CDevice.I2CTransaction[] { ReadAccel[0] }, 1000);}

 

 


I2C On Netduino Plus 2.0

17 November 2012 - 09:02 PM

I have a netduino plus 2.0 and I am trying to access the I2C port on it and nothing I do gets the SCL/SDA pins to so much as change state. The two pins are floating low because when I pull them up with resistors, the pin is at a HIGH state, but with no resistors the pins are at 0V on my scope. The code I am using for testing is below.

byte[] data = new byte[6];
            I2CDevice.Configuration config = new I2CDevice.Configuration(0x1D, 100);
            I2CDevice dev = new I2CDevice(config);

            I2CDevice.I2CTransaction[] trans = new I2CDevice.I2CTransaction[]{I2CDevice.CreateWriteTransaction(new byte[]{0x32}), I2CDevice.CreateReadTransaction(data)};

            while (true)
            {
                Debug.Print("Reading...");
                int val = dev.Execute(trans, 1000);
                Debug.Print(val + ", " + data[0] + ", " + data[1]);
                //Thread.Sleep(500);
            }

Unable to communicate with Netduino Plus 2

15 November 2012 - 02:13 AM

I just got my Netduino Plus 2 today and I was programming it when it no longer program the netduino.
MFDeploy errors when I try to ping it and bringing the RESET pin to 3v3 and power cycling did nothing as it still shows up as a netduino instead of a COM port.
Not sure what to do next to try and get it to work.

If at all helpful the last successful program to it just initialized 2 PWM port but due to a rogue copy and paste they both initialized on the same port. Here is that code that was flashed to it.
PWM p = new PWM(Cpu.PWMChannel.PWM_0, 45.45 / 2, 0.10, false);
p.Start();
PWM p2 = new PWM(Cpu.PWMChannel.PWM_0, 45.45 / 2, 0.18, false);
p2.Start();

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.