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.

MartinK's Content

There have been 3 items by MartinK (Search limited from 02-May 23)


By content type

See this member's

Sort by                Order  

#45366 Netduino Plus 2 problems (InterruptPort & I2C)

Posted by MartinK on 12 February 2013 - 10:05 AM in Netduino Plus 2 (and Netduino Plus 1)

Thanks CW2, you were spot on! :-)

 

The netduino plus 2 is  faster than the old one and so I never noticed that I ignored the max write cycle time - it just wasn't able to poll the eeprom fast enough.

 

Thanks Chris, this could have been the problem - in the meantime I updated to the newest release so I am not absolutely sure if swapping the reference or updating to the newest firmware solved my problems.

 

Anyway, both problems are fixed - thanks for the support!

 

Take care,

Martin




#41945 Netduino Plus 2 problems (InterruptPort & I2C)

Posted by MartinK on 20 December 2012 - 02:55 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi, I am using the Netduino Plus in my application before and I just tried switching to the Netduino Plus 2. I have encountered two problems so far: 1) When I try to create instances of the InterruptPorts, the debug session crashes and I have to reflash the netduino to redeploy the binaries. The code that crashs the board is one of the following lines: new InterruptPort(Pins.GPIO_PIN_D4, true, Port.ResistorMode.Disabled, Port.InterruptMode.InterruptEdgeBoth) new InterruptPort(Pins.GPIO_PIN_D5, true, Port.ResistorMode.Disabled, Port.InterruptMode.InterruptEdgeBoth) new InterruptPort(Pins.GPIO_PIN_D6, true, Port.ResistorMode.Disabled, Port.InterruptMode.InterruptEdgeBoth) new InterruptPort(Pins.GPIO_PIN_D7, true, Port.ResistorMode.Disabled, Port.InterruptMode.InterruptEdgeBoth) new InterruptPort(Pins.GPIO_PIN_D8, true, Port.ResistorMode.Disabled, Port.InterruptMode.InterruptEdgeBoth) new InterruptPort(Pins.GPIO_PIN_D9, true, Port.ResistorMode.Disabled, Port.InterruptMode.InterruptEdgeBoth) new InterruptPort(Pins.GPIO_PIN_D10, true, Port.ResistorMode.Disabled, Port.InterruptMode.InterruptEdgeBoth) new InterruptPort(Pins.GPIO_PIN_D11, true, Port.ResistorMode.Disabled, Port.InterruptMode.InterruptEdgeBoth) I will try narrowing it down as soon as I have the time. Did something change with the ports that I should be aware of? 2) I am writing data to an EEPROM using i2c. After writing some data, I read the data again for verification purposes. On the netduino plus 2 the read data does not match the written data when the code is running. When I set a breakpoint between the writing and the reading, the data verification succeeds, which leads me to believe that some arbitrary delay between the writing and reading operation is needed now. Do you have any pointers on the reliability of the i2c communication? fyi: both problems do not exist on the Netduino Plus 1. Thank you, Martin [Edit: grammar]



#33220 Netduino Firmware v4.2.0 RC5 (Netduino + Netduino Plus)

Posted by MartinK on 07 August 2012 - 01:47 PM in Beta Firmware and Drivers

Hi,
I am using Netduino Plus (v4.2.0.0 RC5) and I've got the following problem:

When reading some files from an Sd-Card an ArgumentOutOfRangeException is thrown when calling StreamReader.ReadLine().

using (FileStream fs = File.OpenRead(filePath))
{
  using (TextReader tr = new StreamReader(fs))
  {
    string line;
    while ((line = tr.ReadLine()) != null)
    ...
  }
}

The stacktrace shows that the exception is thrown inside StreamReader.Peek() which is called internally by StreamReader.ReadLine().

StackTrace:
IndexOutOfRangeException HRESULT: 2835349504
System.IO.StreamReader::Peek
System.IO.StreamReader::ReadLine

The exception
- is only thrown in some files
- is never thrown on the first line
- is always thrown on reading the same line in a file, so I can reproduce it
- is thrown in bigger files (24Kb+), in smaller ones it's working (could be coincidence)

I checked the lines in question and they are neither longer than lines where it works, nor are there any special characters. The only common factor I see atm is the size of the file.

I'd be grateful for suggestions.

EDIT:

I refactored the code to not use the StreamReader and ReadLine and got rid of the exception.

int read;
var buffer = new byte[100];

using (FileStream fs = File.OpenRead(filePath))
{
  while ((read = fs.Read(buffer, 0, buffer.Length)) != 0)
  ..
}

Take care,
Martin




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.