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

I2C on Netduino 1 not working

netduino i2c

  • Please log in to reply
23 replies to this topic

#21 kersten

kersten

    New Member

  • Members
  • Pip
  • 9 posts
  • LocationGermany

Posted 18 March 2013 - 08:59 PM

The processing of the 3 bytes in 3 transactions was only to test. The first transaction returns as Return Code: 0 bytes transfers. In the original code, all 3 bytes processed in one transaction but only with the Return Code: 0 Bytes The SCL line has at times no pulse on the instrument but always 4.85V even after the end of the transaction. Next I change my test back to one transaktion.

#22 kersten

kersten

    New Member

  • Members
  • Pip
  • 9 posts
  • LocationGermany

Posted 18 March 2013 - 09:16 PM

My new test with the code: always count is 0: public static void Main(){ var device = new I2CDevice(new I2CDevice.Configuration(0x50, 100)); I2CDevice.I2CTransaction[] actionsWrite; uint adresse = 0x01; byte[] data = new byte[] { 0x42 }; byte[] buffer = new byte[3]; buffer[0] = (byte)(adresse >> 8); buffer[1] = (byte)adresse; data.CopyTo(buffer, 2); uint i = 0; do { actionsWrite = new I2CDevice.I2CTransaction[] { I2CDevice.CreateWriteTransaction(buffer) }; int count1 = device.Execute(actionsWrite, 1000); Thread.Sleep(1000); i++; Debug.Print(i.ToString()+" Count: " + count1.ToString()); } while (true); } I think the board is defective!

#23 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 30 March 2013 - 05:59 PM

Hi kersten, What does the signal look like on a logic analyzer? Are you using Netduino gen1 or Netduino gen2? Which pins are you using? Finally...what value are you using for your pull-up resistors? Chris

#24 kersten

kersten

    New Member

  • Members
  • Pip
  • 9 posts
  • LocationGermany

Posted 04 April 2013 - 03:38 PM

Hi Chris, I currently have no logic analyzer. My board is a "Netduino 2". Through the change of the pull-ups on 1.2 k, my problem currently is solved with the I2C . The board is working correctly. The bus line I first kept short. Am now going to test the OneWire DS 2482-100 with 1 DS18S20 on the I2C Bus. But I find no code example. The onewire functions are new in the 4.2 framework? Where can I get help for Microsoft.SPOT.Hardware.OneWire class?





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.