- Netduino Forums
- → HAMZA's Content
HAMZA's Content
There have been 12 items by HAMZA (Search limited from 30-March 23)
#41413 Netduino Plus 1 Firmware v4.2.0 (update 1)
Posted by HAMZA on 12 December 2012 - 01:20 AM in Netduino Plus 2 (and Netduino Plus 1)
#41262 WatchDog Timer & netduino Plus
Posted by HAMZA on 09 December 2012 - 12:47 PM in Netduino Plus 2 (and Netduino Plus 1)
Look at this thread: http://forums.netdui...-netduino-plus/
The watchdog is there on the hardware, but the stock firmware just turns off the watchdog, and has stubs for all the functionality.
I got it working on ND+ firmware 4.1.0.6, my next goal is to make it working with CW2's 4.1.1b1 firmware with 1-wire support.
hi ToniA
thank your for help
i have an DS1820 that i want to try with netduino+, if 1-wire work also, i will be very happy
#41248 WatchDog Timer & netduino Plus
Posted by HAMZA on 09 December 2012 - 02:08 AM in Netduino Plus 2 (and Netduino Plus 1)
how can i use the warchdog timer in netduino Plus (with firmware 4.2)
i tried
Watchdog.Enabled = true;
but it still always false !!!!
any help will be welcome
Attached Files
- Program.cs 678bytes 13 downloads
#40420 Netduino Plus - I2C not working
Posted by HAMZA on 29 November 2012 - 12:55 PM in Netduino Plus 2 (and Netduino Plus 1)
Unfortunately, I don't have this particular device to check it, but I think the correct method to write a byte is to create just one write transaction of two byte buffer (address, data):
// Write transaction (up to 8 or 16 bytes, depending on the page size) var xWrite = I2CDevice.CreateWriteTransaction(new [] { RegisterNum[0], Value[0] }); myi2c.Execute(new I2CDevice.I2CTransaction[] { xWrite }, 100); // Write cycle time is 10 ms Thread.Sleep(10000); // Random read transaction requires repeated start condition, but CreateWriteTransaction(...) // followed by CreateReadTransaction(...) generates two separate transactions, // you have to use CreateReadTransaction from http://forums.netduino.com/index.php?showtopic=944 var data = new byte[8]; uint startAddressToReadFrom = 0; var xRead = CreateReadTransaction(data, startAddressToReadFrom, 1); myi2c.Execute(new I2CDevice.I2CTransaction[] { xRead }, 100);Note: The code is written from head, may not even compile.
it work now, thanks
you too NooM, thanks for your help
#40397 Netduino Plus - I2C not working
Posted by HAMZA on 29 November 2012 - 02:14 AM in Netduino Plus 2 (and Netduino Plus 1)
You are using invalid slave address, 0xA2 includes the R/W bit which is not part of the slave address in .NET MF (max. value is 0x7F, hence the exception), try passing 0x51 instead (assuming A2 = 0, A1 = 0, A0 = 1).
i haven't thinking about this trick, thank you .
now it work, i can read data from my eeprom, but i can't write on it anything.
address: 0 data: 72
address: 1 data: 101
address: 2 data: 108
address: 3 data: 108
address: 4 data: 111
.......
Attached Files
- Program.cs 2.26KB 12 downloads
#40360 Netduino Plus - I2C not working
Posted by HAMZA on 28 November 2012 - 12:48 PM in Netduino Plus 2 (and Netduino Plus 1)
try lock(youri2cdevice) and set the timeout lower.
also, do you have pullup resistors on your i2c lines? 4.7kohms are fine.
also try 100khz instead of 400 when talking to your device. you can change that when you found out what was wrong.
i have pullup my eeprom with 1k resistors.
i have locked my "myi2c" object but its still not working.
when i try to read the value of the selected register ,this message appears in output windows
Une exception de première chance de type 'System.ArgumentException' s'est produite dans Microsoft.SPOT.Hardware.dll.
Une exception non gérée du type 'System.ArgumentException' s'est produite dans Microsoft.SPOT.Hardware.dll
with some traduction, it will be somthig like this
A first chance exception of type 'System.ArgumentException' occurred in Microsoft.SPOT.Hardware.dll.
An unhandled exception of type 'System.ArgumentException' occurred in Microsoft.SPOT.Hardware.dll
Attached Files
- Program.cs 2.67KB 11 downloads
#40340 Netduino Plus - I2C not working
Posted by HAMZA on 27 November 2012 - 11:23 PM in Netduino Plus 2 (and Netduino Plus 1)
Attached Files
- Program.cs 2.59KB 8 downloads
#40329 Netduino Plus - I2C not working
Posted by HAMZA on 27 November 2012 - 06:41 PM in Netduino Plus 2 (and Netduino Plus 1)
i added a little more complex sample of how i do it.
it works perfectly on my mini.
maybe you have to change some small things on the ic_ class part, depends on what eeprom your using.
thank you NooM
i will try it in my board with my eeprom(24C04)
#40324 Netduino Plus - I2C not working
Posted by HAMZA on 27 November 2012 - 05:43 PM in Netduino Plus 2 (and Netduino Plus 1)
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 the same error again happen (see the attachement).
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()
{
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 this problem ?
#40319 Netduino Plus 2 - I2C not working
Posted by HAMZA on 27 November 2012 - 05:19 PM in Netduino Plus 2 (and Netduino Plus 1)
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.
ok & thanks ()
#40314 Netduino Plus 2 - I2C not working
Posted by HAMZA on 27 November 2012 - 04:20 PM in Netduino Plus 2 (and Netduino Plus 1)
Is your board a Plus 2? You wrote Netduino Plus.
i have Netduino Plus (not Netduino Plus 2)
#40234 Netduino Plus 2 - I2C not working
Posted by HAMZA on 26 November 2012 - 04:25 PM in Netduino Plus 2 (and Netduino Plus 1)
- Netduino Forums
- → HAMZA's Content
- Privacy Policy