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.

lvw's Content

There have been 11 items by lvw (Search limited from 19-April 23)


By content type

See this member's

Sort by                Order  

#40959 Using both Analog and Digital on same pin

Posted by lvw on 04 December 2012 - 07:18 PM in Netduino Plus 2 (and Netduino Plus 1)

I'll try to illustrate what i'm trying to accomplish here.
My project needs to become a central place to hook up sensors using RJ45 plugs and UTP cable. It also should allow me to control SPI and I2C devices connected to it.


Basic setup is;
N+,
2 bit shift registers.
2 SparkFun Mux/Demux boards.
Some other components that do not have any effect on the above (PWM driver from AdaFruit, a Nokia 5110 display, a RFID reader, etc.).

I'm using the bit shift registers to control the 2 sparkfun boards, that part works as intended.
My code allows me to put in a integer (1-32, it's 16 pins a board) and it enables the appropriate board, and selects the correct port (32 enables board 2, select pin 15).

At that point, I'll look up what type of sensor or piece of hardware is attached, from a list of custom 'port objects'.
Those objects contain a type (analog or digital) and some other information (IN/OUT/SPI/I2C/PWM, a port number, memory value for the last read value, etc.)

I need (want) to initiate a AnalogInput, InputPort or OutputPort at that point, allowing me to read a analog value, read a digital value or write a digital value.

That value will be logged (storage card, webservice and if needed, texted to my phone). If the device attached to the port is a SPI device, and action needs to be taken, it should write true (high) to the same pin, as that port will be used as CS pin.

Since I have 2 SparkFun boards, I need to connect 2 wires (1 wire per board) from the signal pin to a pin on the N+. I want to use the A pins here, as the SparkFun boards allow both analog, digital and data to be connected to the boards.

In code, there is a Thread that runs a loop (no interrupt on the sparkfun boards) to set the port number (that is in a list, enabled and needs to perform 'a' action at that time)

I'll paste some pseudo code to demonstrate what I'm doing.
while(thePortWatcherIsEnabled) 
{
    switchExpanderBoard(toNextPortThatIsDigital);
    Thread.Sleep(10);

    
        using (InputPort d = new InputPort(Pins.GPIO_PIN_A1, false, Port.ResistorMode.Disabled))
        {
             d.Read();
        }
    

    switchExpanderBoard(toNextPortThatIsAnalog);
    Thread.Sleep(10);

  
        using (AnalogInput a = new AnalogInput(Microsoft.SPOT.Hardware.Cpu.AnalogChannel.ANALOG_1))
        {
            a.Read();
        }
    

    switchExpanderBoard(toNextPortThatIsDigitalAgain);
    Thread.Sleep(10);

   
        using (OutputPort d = new OutputPort(Pins.GPIO_PIN_A1, false))
        {
            d.Write(true);
        }
    
}

After a few loops of this, the error as mentioned in the start post is thrown, and it continues throwing it at 'random' intervals (sometimes it works, most of the time it doesn't after the first exception is thrown).



#40831 Using both Analog and Digital on same pin

Posted by lvw on 03 December 2012 - 08:29 AM in Netduino Plus 2 (and Netduino Plus 1)

Alright, reading should not be a problem then, thanks. I probably should have mention this, but I'm also using it for signaling high to some SPI devices, would there be any solution for that?



#40788 Using both Analog and Digital on same pin

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

Hi all,

A little background information;

I'm currently working on a project that uses a Analog/Digital MUX breakout from SparkFun.

The main problem I'm having is that each of these boards have 1 'signal' i/o pin. Since the board can handle both analog and digital signals, I would like to make use of one of the analog pins on the N+.

I tried some short code to switch accordingly between analog and digital, disposing the previous instance of the port before initializing a new one.

After a few times of switching I'm getting 'An unhandled exception of type 'System.Exception' occurred in Microsoft.SPOT.Hardware.dll'

I'm properly disposing the port object AFTER I've retrieved the state/value of the input using the Dispose method of the ports. Im suspecting that somewhere along the way, the object isnt disposed properly in code that is out of my reach (in the .NET framework perhaps).

So my main question is,is there any limitation (think speed wise, number of times, or other..) using this method?
Is this possible at all ( I know it works a few times, but is it possible to have this as permanent solution?)

Thanks



#38952 Netduino Plus 1 Firmware v4.2.0 (update 1)

Posted by lvw on 10 November 2012 - 10:02 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi lvw,

The procedure to set the network settings on Netduino Plus changed with .NET MF 4.2 QFE2. This is due to the WinUSB drivers.

After you flash your board, please put it in TinyBooter mode before setting the network configuration. If you try to change it from the fully-booted (TinyCLR) mode, NETMF may get stuck in TinyBooter mode and require reflashing the board.

Chris




Hi Chris,

Thanks, I tried that and it seems to work.

I feel stupid for not reading that part at the end of the topic start :-(



#38947 Netduino Plus 1 Firmware v4.2.0 (update 1)

Posted by lvw on 10 November 2012 - 09:44 PM in Netduino Plus 2 (and Netduino Plus 1)

So I tried to upgrade the firmware. I think that I upgraded the Bootloader successfully (it says Bootloader Info: Netduino Plus (v4.2.0.1) by Secret Labs LLC). And apparently the new Firmware also got deployed correctly, as a Device Capabilities dump states:

**** more stuff here ****

When I try to modify the Network Configuration (to set the MAC), something gets corrupted. I don't know what, but it *feels* like some location gets overwritten which shouldn't get to.

I think that the issue is related to an IP or Subnet which I'm trying to configure. I'm attempting to set the IP to an address in the 10.x.x.x range, and the subnet to 255.0.0.0.

With the out-of-the-box config of the Netduino (it was a 4.1.x) I didn't have the problem, and was able to set the IP statically to my preferred value. Now I can't do that anymore.

I when pressing update I get a message "Unable to erase configuration sector memory". I believe that this is only after attemtping to change the IP or the subnet. And it takes a while for this message to appear. Like a minute or so.

From then on, occascionally when attemting to read the Network Configuration, I get a message of bad or old configuration, also the Target/Device Capabilities resist to show any info, and Debug/Show Device Info says wrong firmware or something.

If I flash the new Firmware and only update the MAC, and set DHCP to on (which I don't really want to do), then "all" works fine. Except that I can't use the network since it won't use the DHCP provided values, and the 'slow clock' issue still persists.

Kind regards,
Daniel



Same here.

I'm positive I'm using the correct Bootloader with the correct firmware (4.2.0.1), it's packed in the same ZIP file thats in the attachment in the firmware post.

After installing the bootloader (and unplugging + plugging back in), MFDeploy Ping responds with;
Pinging... TinyBooter
Bootloader build info: Netduino Plus (v4.2.0.1) by Secret Labs LLC


After installing the firmware (both ER_FLASH and ER_CONFIG)
Chk signature
Signature PASS

(unplugging + plugging back in)

Pinging... TinyCLR


Then, when I go into Target > Configuration > Network;
The blue (user led) goes on, after a while off, then it hangs a minute or two, shows;
Device has old or unsupported configuration


When I retry to deploy the firmware again it states; 'Error: Unable to deploy to device' in a error box. The console shows
*** nXIP Program found at 0x0010 after a few seconds.



When I'm able to access the network configuration (yes, sometimes it lets me after doing all of the above) saving the settings hangs and stops with an error. After that, Ping results back into:

Pinging... TinyBooter
Bootloader build info: Netduino Plus (v4.2.0.1) by Secret Labs LLC

(As if the firmware is removed again).


Does anyone have any suggestions? I'm suspecting a bad firmware or bad reference to memory somewhere (or maybe even corrupted memory?)

For now i'm left with a non working Netduino Plus :-( (don't want to downgrade to 4.1.*)



#29691 Netduino Firmware v4.2.0 RC3 (all editions)

Posted by lvw on 24 May 2012 - 04:37 PM in Beta Firmware and Drivers

Oh sorry, the Netduino Mini firmware will be updated until a later RC (or the final 4.2 firmware release).

In the meantime, I recommend using 4.1.0.6 or 4.1.1 beta on your Netduino Mini. The 4.2 SDK supports both of those as well (as Stefan noted--thanks Stefan).

Chris



Thanks all.

My Visual Studio thinks different (see attached screenshot).
I think I'll do a re-install of the SDK, thanks again for the help/info.

Posted Image



#29683 Netduino Firmware v4.2.0 RC3 (all editions)

Posted by lvw on 24 May 2012 - 03:38 PM in Beta Firmware and Drivers

I didn't know it was compatible with the Mini (already have it on my Plus), I'll give it a try later on today.

Thanks Chris



It's not compatible with the mini: NETDUINO MINI: Netduino Mini firmware is not available for this release. We will make this available in a future release.


Is there any way to install (a) 4.2 version on the Mini? That way i don't have to install both(is that even possible?) SDK's (because my Plus is already using 4.2)



#29623 Netduino Firmware v4.2.0 RC3 (all editions)

Posted by lvw on 24 May 2012 - 06:19 AM in Beta Firmware and Drivers

Hi Ivw,

This release has been replaced by a newer release candidate (RC5):
http://forums.netdui...-netduino-plus/

Chris


I didn't know it was compatible with the Mini (already have it on my Plus), I'll give it a try later on today.

Thanks Chris



#29604 Netduino Firmware v4.2.0 RC3 (all editions)

Posted by lvw on 23 May 2012 - 08:58 PM in Beta Firmware and Drivers

Could you try again? Your user account wasn't yet approved. Welcome to the community by the way :)


Thanks(/dankjewel) Stefan!

I'm still unable to download. All other links are working on that page except the 4.2.0.0 BETA RC3 Mini TTL & RS232 ones (Edit: and the DEPRECATED ones, but that could be on purpose).



#29599 Netduino Firmware v4.2.0 RC3 (all editions)

Posted by lvw on 23 May 2012 - 07:37 PM in Beta Firmware and Drivers

I found the download links (http://wiki.netduino.com/Firmware.ashx), but im unable to download, it keeps asking for my username and password again and again



#29598 Netduino Firmware v4.2.0 RC3 (all editions)

Posted by lvw on 23 May 2012 - 07:34 PM in Beta Firmware and Drivers

The very first step says:

1. Download and unzip the attached file to a directory on your computer.

Where is this attached zip file you speak of?



I'm also looking for this.. I think i'm going blind!




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.