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