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.

hendrikdutje

Member Since 01 Feb 2011
Offline Last Active Mar 17 2011 06:50 PM
-----

Posts I've Made

In Topic: Problem with ds1307 sd card e.v.

05 March 2011 - 01:48 PM

Chris,

Excuse me for this late reaction. No time this week.
This nigth I wake up with a possible solution. I just forget the 2 pullup resistors on the SDCL en SDA pin. I tried it with a 24lc256 EEPROM to test the I2C bus. With 2 pullups its works and also the I2C clock.
Thanks again,
Henk.


Hi hendrikdutje,

The DateTime constructor exception in the netduinohelpers library looks like it is caused by invalid input. Can you step into the code and find the exact line which throws the exception?

Chris


In Topic: Problem with ds1307 sd card e.v.

23 February 2011 - 09:01 PM

Nice such a forum to solve your own problems........

I solved the problem with the SD card.....

I updated the firmware and connected pin D8 with a single cable to Pin D10.
I format my sandisk micro sdcard to fat16 (standard format in windows 7) and I used the next code...

Debug and get....

The thread '<No Name>' (0x2) has exited with code 0 (0x0).
directory count: 1
directory: \SD1
file count: 2
filename: \SD1\hallo.txt
contents: first time...
filename: \SD1\Test.txt
contents: Regel 1
regel 2
regel 3
The thread '<No Name>' (0x1) has exited with code 0 (0x0).
Done.
Waiting for debug commands...
The program '[24] Micro Framework application: Managed' has exited with code 0 (0x0).



using System;
using System.Text;
using System.IO;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware;
using SecretLabs.NETMF.Hardware.Netduino;
using SecretLabs.NETMF.IO;



namespace sd
{
public class Program
{
public static void Main()
{

StorageDevice.MountSD("SD1", SPI_Devices.SPI1, Cpu.Pin.GPIO_Pin8);

FileStream Filehandle = new FileStream("\\SD1\\hallo.txt", FileMode.OpenOrCreate);
byte[] data = Encoding.UTF8.GetBytes("first time...");

Filehandle.Write(data, 0, data.Length);
Filehandle.Close();
Thread.Sleep(1000);

string[] directories = System.IO.Directory.GetDirectories(@"\");

Debug.Print("directory count: " + directories.Length.ToString());


for (int i = 0; i < directories.Length; i++)
{
Debug.Print("directory: " + directories[i]);
}

string[] files = System.IO.Directory.GetFiles(@"\SD1");
Debug.Print("file count: " + files.Length.ToString());

for (int i = 0; i < files.Length; i++)
{
Debug.Print("filename: " + files[i]);
FileStream fs = new FileStream(files[i], FileMode.Open, FileAccess.Read, FileShare.None, 512);
StreamReader sr = new StreamReader(fs);
Debug.Print("contents: " + sr.ReadToEnd());
}
StorageDevice.Unmount("SD1");


}

}
}

I go further to solve the problm with the ds1307 . Firt testing the IC2 with a I2C EEPROM 24LC256.

I have updated the firmware to the last version :
When I use MFdeploy then I get the next information.....

DeviceInfo:
HAL build info: 4.1.2821.0, Netduino (v4.1.2.0 a0) by Secret Labs LLC
OEM Product codes (vendor, model, SKU): 34, 177, 4096
Serial Numbers (module, system):
00000000000000000000000000000000
0000000000000000
Solution Build Info: 4.1.1.0, Netduino (v4.1.2.0 a0) by Secret Labs LLC
AppDomains:
default, id=1
Assemblies:
mscorlib,4.1.2821.0
Microsoft.SPOT.Native,4.1.2821.0
Microsoft.SPOT.Hardware,4.1.2821.0
Microsoft.SPOT.Hardware.SerialPort,4.1.2821.0
Microsoft.SPOT.IO,4.1.2821.0
System.IO,4.1.2821.0
Microsoft.SPOT.Hardware.Usb,4.1.2821.0
SecretLabs.NETMF.Hardware,4.1.0.0
SecretLabs.NETMF.Diagnostics,4.1.0.0
SecretLabs.NETMF.IO,4.1.0.0
SecretLabs.NETMF.Hardware.Netduino,4.1.0.0
netduino.helpers,1.0.0.0
DS1307,1.0.0.0

I tried to debug the ds1307 project of netduinohelpers on a Sparkfun micro SDshield where I have made an Maxim ds1307 clock chip on it with a 32678 oscillator and a 3.3v backup battery. De clock runs on 3.3.V.
When I run it on a Arduino Uno it works.
When I debug the solution in Visual Studio 2010 professional edition I get the next error.

#### Exception System.ArgumentOutOfRangeException - CLR_E_OUT_OF_RANGE (1) ####
#### Message:
#### System.DateTime::.ctor [IP: 0000] ####
#### System.DateTime::.ctor [IP: 000e] ####
#### netduino.helpers.Hardware.DS1307::Get [IP: 0079] ####
#### RTC.Program::Main [IP: 0012] ####
A first chance exception of type 'System.ArgumentOutOfRangeException' occurred in mscorlib.dll
An unhandled exception of type 'System.ArgumentOutOfRangeException' occurred in mscorlib.dll

Whe I tried the sd card exactly with the sample on this forum http://forums.netdui...sd-card-sample/
then get the nex error. I use exact the same hardware.

The thread '<No Name>' (0x2) has exited with code 0 (0x0).
#### Exception System.IO.IOException - CLR_E_VOLUME_NOT_FOUND (1) ####
#### Message:
#### SecretLabs.NETMF.IO.StorageDevice::SDSPI_Mount [IP: 0000] ####
#### SecretLabs.NETMF.IO.StorageDevice::MountSD [IP: 0016] ####
#### SecretLabs.NETMF.IO.StorageDevice::MountSD [IP: 0008] ####
#### sd.Program::Main [IP: 0009] ####
A first chance exception of type 'System.IO.IOException' occurred in SecretLabs.NETMF.IO.dll
An unhandled exception of type 'System.IO.IOException' occurred in SecretLabs.NETMF.IO.dll

Someone can help wath is wrong?


In Topic: Problem with ds1307 sd card e.v.

21 February 2011 - 08:22 PM

I have updated the firmware to the last version : When I use MFdeploy then I get the next information..... DeviceInfo: HAL build info: 4.1.2821.0, Netduino (v4.1.2.0 a0) by Secret Labs LLC OEM Product codes (vendor, model, SKU): 34, 177, 4096 Serial Numbers (module, system): 00000000000000000000000000000000 0000000000000000 Solution Build Info: 4.1.1.0, Netduino (v4.1.2.0 a0) by Secret Labs LLC AppDomains: default, id=1 Assemblies: mscorlib,4.1.2821.0 Microsoft.SPOT.Native,4.1.2821.0 Microsoft.SPOT.Hardware,4.1.2821.0 Microsoft.SPOT.Hardware.SerialPort,4.1.2821.0 Microsoft.SPOT.IO,4.1.2821.0 System.IO,4.1.2821.0 Microsoft.SPOT.Hardware.Usb,4.1.2821.0 SecretLabs.NETMF.Hardware,4.1.0.0 SecretLabs.NETMF.Diagnostics,4.1.0.0 SecretLabs.NETMF.IO,4.1.0.0 SecretLabs.NETMF.Hardware.Netduino,4.1.0.0 netduino.helpers,1.0.0.0 DS1307,1.0.0.0 I tried to debug the ds1307 project of netduinohelpers on a Sparkfun micro SDshield where I have made an Maxim ds1307 clock chip on it with a 32678 oscillator and a 3.3v backup battery. De clock runs on 3.3.V. When I run it on a Arduino Uno it works. When I debug the solution in Visual Studio 2010 professional edition I get the next error. #### Exception System.ArgumentOutOfRangeException - CLR_E_OUT_OF_RANGE (1) #### #### Message: #### System.DateTime::.ctor [IP: 0000] #### #### System.DateTime::.ctor [IP: 000e] #### #### netduino.helpers.Hardware.DS1307::Get [IP: 0079] #### #### RTC.Program::Main [IP: 0012] #### A first chance exception of type 'System.ArgumentOutOfRangeException' occurred in mscorlib.dll An unhandled exception of type 'System.ArgumentOutOfRangeException' occurred in mscorlib.dll Whe I tried the sd card exactly with the sample on this forum http://forums.netdui...sd-card-sample/ then get the nex error. I use exact the same hardware. The thread '<No Name>' (0x2) has exited with code 0 (0x0). #### Exception System.IO.IOException - CLR_E_VOLUME_NOT_FOUND (1) #### #### Message: #### SecretLabs.NETMF.IO.StorageDevice::SDSPI_Mount [IP: 0000] #### #### SecretLabs.NETMF.IO.StorageDevice::MountSD [IP: 0016] #### #### SecretLabs.NETMF.IO.StorageDevice::MountSD [IP: 0008] #### #### sd.Program::Main [IP: 0009] #### A first chance exception of type 'System.IO.IOException' occurred in SecretLabs.NETMF.IO.dll An unhandled exception of type 'System.IO.IOException' occurred in SecretLabs.NETMF.IO.dll Someone can help wath is wrong?

In Topic: Problem with ds1307 sd card e.v.

20 February 2011 - 05:00 PM

Chris,

Thanks for your quick response.
I try first to update the firmware from my netduino to resolve the problem with the DS1307 e.v.
I disconnected my USB cable and I run my application with a extern 12v adapter en the not used analog pins connected to ground.
It is then much better and stabilized.
Thanks again.

Hi hendrikdutje,

To use an SD card, you need to be running the latest v4.1.1 alpha firmware. Also, what size is your SD card--and is the SD shield 3.3V compatible?

On the analog inputs, if you can post a diagram of what you're doing perhaps we can help diagnose. Also, the ADC on the Netduino is a full 10-bit ADC, so if you reduce your range to 8-bit using AnalogInput.SetRange(0, 255), you might get more traditional 8-bit results.

Chris


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.