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.

demonGeek

Member Since 19 Feb 2011
Offline Last Active Apr 08 2014 10:01 PM
-----

Topics I've Started

USB Communication Between Two Netduino's?

30 March 2011 - 01:16 AM

With 4.1.2 already offering early USB client support, will USB communication between two Netduino's become a possibility?

Perhaps using a USB Host Shield like this one.

Thanks.

- Adam

Battery Power Solutions for Motors?

20 March 2011 - 07:23 PM

I'm just starting to think about powering my projects from batteries.

I got this 2000mAh Polymer Lithium Ion Battery and this converter so I think I have the Netduino and sensors covered but I'm wondering about devices, such as motors, that require a bit more power.

I know there are a ton of options out there but I wanted to find out what people here are using and what works well.

Thanks in advance.

- Adam

Threading Problems After Deploy

18 March 2011 - 11:18 PM

I'm playing with some code to drive a Sparkfun Serial LCD and ran into some timing issues which caused a garbled display unless I put an 80ms delay (Thread.Sleep) between each write operation.

This was fine for testing but with the delay on the main thread it slows everything down whenever I write to the LCD. So I thought it might be a good idea to put the write operation on its own thread like this:

private void Write(byte[] data)
{
	new Thread(delegate { this._Write(data); }).Start();
}

private void _Write(byte[] data)
{
	this.port.Write(data, 0, data.Length);
	Thread.Sleep(80);
}

This code works fine as long as the debugger is attached but as soon as I deploy and reset the Netduino, the display ceases to function. The code itself is still operational (no exceptions, as far as I can tell) but the display thread doesn't seem to be doing anything. If I remove the threading and write to the device directly everything is fine again.

Is this expected behaviour? Is there some better way of doing this that I don't know about?

- Adam

[N+ firmware v4.1.1.0 ALPHA7]

Interrupts on TristatePort

18 March 2011 - 08:32 PM

I'm playing with a Parallax Ping))) Sensor and was wondering what would be the best way to interface it to my Netduino.

I've found some code samples that are based on a TriStatePort but it seems to me that an InterruptPort might be a better way of doing things. The trouble is that I'm not very experienced with either of those types of port so I'm looking for some help and advice.

I tried to set an interrupt event handler on a Tristate port like this:

TristatePort tristatePort.OnInterrupt += new NativeEventHandler(Port_OnInterrupt);

but that produces a System.InvalidOperationException. No idea why...

I then tried creating an Interrupt port and event handler which seems to be fine but I don't see how to send the trigger pulse in that situation so the interrupt never occurs.

Thanks.

- Adam

SPI + InvalidOperationException

11 March 2011 - 07:27 PM

I just want to instantiate an SPI object but I keep getting this:

An unhandled exception of type 'System.InvalidOperationException' occurred in Microsoft.SPOT.Hardware.dll

Here's the code:

SPI.Configuration spiConfig = new SPI.Configuration(Pins.GPIO_PIN_D8, false, 250, 250, true, true, 1000, SPI.SPI_module.SPI1);
SPI spi = new SPI(spiConfig);

What am I doing wrong?

 
EDIT:
I've been looking at this for a while now and I'm beginning to wonder if this error might indicate that there's a problem with the connection to the SPI device (or the device itself). The device is this flash memory board connected as follows:

CS# <-----> D8
SCK <-----> D13
SDI <-----> D12
SDO <-----> D11


I've also tried (unsuccessfully) connecting the BUSY# pin on the board to D7 and then specifying that in the other constructor overload:

SPI.Configuration spiConfig = new SPI.Configuration(Pins.GPIO_PIN_D8, false, 250, 250, true, true, 1000, SPI.SPI_module.SPI1, Pins.GPIO_PIN_D7, false);
SPI spi = new SPI(spiConfig);

[N+ firmware v4.1.1.0 ALPHA7]

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.