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.
thanks for the link to loveelectronics tutorial. I have used used this tutorial before the library they have put together is excellent and I also highly recommended it.
The issue isn't with how to write the code for the i2c device but that the device is not working with NP2! for that matter I can't get any device to communicate via I2C with my new NP2!
have you implemented an I2C devices with the new NP2?
thanks for the link to loveelectronics tutorial. I have used used this tutorial before the library they have put together is excellent and I also highly recommended it.
The issue isn't with how to write the code for the i2c device but that the device is not working with NP2! for that matter I can't get any device to communicate via I2C with my new NP2!
have you implemented an I2C devices with the new NP2?
I can't be of any help yet, but I'll have my ND+2s on Saturday. I plan to work on upgrades this coming week to Pandora's Box. I have four I2C devices connected currently. I'll be working to get my ADXL345, RTC, BMP085 and LCD Backpack working with I2C.
I just got my NP2! thanks for making such an awesome update!
I'm not able to get the I2C to work with my ADXL345 connected to the new SC/SD connectors?
So sorry about that. There appears to be a bug in the I2C core which is affecting some users. We have a repro and ordered in test hardware; we should have a bug fix for this in the 4.2.1.1 update next weekend.
So sorry about that. There appears to be a bug in the I2C core which is affecting some users. We have a repro and ordered in test hardware; we should have a bug fix for this in the 4.2.1.1 update next weekend.
Chris
Any news on when to expect the fix for the i2c issue?
Hi
i have netduino plus that i updated last week with the new firmware 4.2 because the I2C don't work in firmware 4.1, and i tried again but nothing the same error again happen.
i use this code that i found here
http://www.tinyclr.c...m/topic?id=9074
using System;
using System.Net;
using System.Net.Sockets;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware;
using SecretLabs.NETMF.Hardware.NetduinoPlus;
namespace i2C
{
public class Program
{
static OutputPort led = new OutputPort(Pins.ONBOARD_LED, false);
public static void Main()
{
// write your code here
i2c();
while (true)
{
led.Write(true);
Thread.Sleep(10);
led.Write(false);
Thread.Sleep(1500);
}
//Thread.Sleep(Timeout.Infinite);
}
static void i2c()
{
// i2c configuration(address of my eeprom , clock speed)
I2CDevice myi2c = new I2CDevice(new I2CDevice.Configuration(0xA2, 400));
// to store the received value from eeprom
byte[] readBuffer = new byte[1];
byte[] address = new byte[] { 1 };
// Reading data stored in the selected address register
I2CDevice.I2CTransaction[] xActions = new I2CDevice.I2CTransaction[1];
xActions[0] = I2CDevice.CreateWriteTransaction(address);
myi2c.Execute(xActions, 1000);
xActions[0] = I2CDevice.CreateReadTransaction(readBuffer);
myi2c.Execute(xActions, 1000);
// print the received data
Debug.Print("address:" + address[0].ToString() + "data:" + readBuffer[0].ToString());
// go to the next address
address[0]++;
led.Write(true);
Thread.Sleep(1000);
led.Write(false);
}
}
}
there are any solution of my problem ?
Just checking since you posted in the wrong thread. This is about Netduino Plus 2 problems with the I2C as these are specific to the Netduino Plus 2. You should create a new thread with your question.
Just checking since you posted in the wrong thread. This is about Netduino Plus 2 problems with the I2C as these are specific to the Netduino Plus 2. You should create a new thread with your question.
I'm very sad to report the update has not resolved my issues and the N+2 is not able to communicate with my I2C devices.
What pins are you using for your I2C devices? The SDA/SCL pins or the A4/A5 pins?
The new Arduino R3 shield format has moved the I2C pins to SDA/SCL. We are working on a software I2C feature which will enable A4/A5 to be used for I2C as well, providing the best of both worlds.
If you are using A4/A5 for your I2C pins, there are two even faster ways to get this to work for you:
Connect jumper wires between the A4/A5 and SDA/SCL headers on your Netduino Plus. This will mirror the pins for you.
What pins are you using for your I2C devices? The SDA/SCL pins or the A4/A5 pins?
The new Arduino R3 shield format has moved the I2C pins to SDA/SCL. We are working on a software I2C feature which will enable A4/A5 to be used for I2C as well, providing the best of both worlds.
If you are using A4/A5 for your I2C pins, there are two even faster ways to get this to work for you:
Connect jumper wires between the A4/A5 and SDA/SCL headers on your Netduino Plus. This will mirror the pins for you.
If you're using the SDA/SCL pins...what value of pull-ups do you have? What is the part you're using?
Chris
Thanks for the quick reply.
I'm using the SD/SC pins, I have also tried A4/5 with no success.
Attached is an image of my setup. setup_example.jpg309.61KB98 downloads
The device has pull-ups built in with 4.7k resistors. I'm using the Sparkfun SEN-10724 (https://www.sparkfun.../products/10724) The sensor works with my N+1 and Nmini (with the above mentioned code).
I'm using the SD/SC pins, I have also tried A4/5 with no success.
The device has pull-ups built in with 4.7k resistors. I'm using the Sparkfun SEN-10724 (https://www.sparkfun.../products/10724) The sensor works with my N+1 and Nmini (with the above mentioned code).
I will look at dave's code and see if that helps.
Hmm, very interesting. A few things:
1. Do you have a logic analyzer by any chance? If you do, it would be _really_ helpful to see what data is on the line and what might be missing. And also measure the pulse width...in case there's a clock mismatch somehow.
2. If you lower the clock speed, does it work?
3. Please let me know if Dave's code works for you.
4. If the above fails, I can order one of these and have it here next week. Then we can run your code on both Netduino and Netduino Plus 2 and figure out what's different. We definitely want to enable existing code to be re-used on the new boards.
Thank you for all your help getting to the bottom of this case,
I'm using the SD/SC pins, I have also tried A4/5 with no success.
Attached is an image of my setup. setup_example.jpg309.61KB98 downloads
The device has pull-ups built in with 4.7k resistors. I'm using the Sparkfun SEN-10724 (https://www.sparkfun.../products/10724) The sensor works with my N+1 and Nmini (with the above mentioned code).
I will look at dave's code and see if that helps.
egeorgiou,
From the picture it looks like you have both the power and the ground plugged into the same row of the bread board, this will short out the power supply, please check your wiring?
Thank you for your hard work to get the update released.
I'm very sad to report the update has not resolved my issues and the N+2 is not able to communicate with my I2C devices.
egeorgiou, your wiring looks fine. While I don't have that specific sensor, I have two of the individual sensors on that board, the Magnetometer and the Accelerometer. I will try to wire them up and see if I can get them working on my ND+2. Meanwhile can you share the code you are using? Perhaps it's a code issue. Today I tried the update with the DS1307 real time clock and that worked fine, but was not working fine with 4.2.1.0.