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.

Flores's Content

There have been 64 items by Flores (Search limited from 23-May 23)


By content type

See this member's


Sort by                Order  

#2860 Wrong network addressing breaks netduino plus

Posted by Flores on 25 September 2010 - 07:48 AM in Netduino Plus 2 (and Netduino Plus 1)

I'm experimenting with the code I posted earlier:

using System; 
using System.Threading; 
using Microsoft.SPOT; 
using Microsoft.SPOT.Hardware; 
using SecretLabs.NETMF.Hardware; 
using SecretLabs.NETMF.Hardware.Netduino; 
using Microsoft.SPOT.Net.NetworkInformation; 
using Microsoft.SPOT.Net; 
using System.Net.Sockets; 
using System.Net; 
using System.Text; 
 
namespace NetduinoApplication2 
{ 
    public class Program 
    { 
 
        public static void Main() 
        { 
 
            using (System.Net.Sockets.Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)) 
            { 
 
                IPHostEntry entry = Dns.GetHostEntry("192.168.5.111"); 
                IPAddress address = entry.AddressList[0]; 
                IPEndPoint endpoint = new IPEndPoint(address, 80); 
 
                socket.Connect(endpoint); 
                socket.Send(Encoding.UTF8.GetBytes("Hallo Netduino plus")); 
            } 
 
        } 
 
    } 
}

This works.. I'v got IIS running on my notebook, and i'm seeing this in my logfiles:

2010-09-25 07:39:58 192.168.5.150 4098 192.168.5.111 80 - Hallo Netduino 400 - BadRequest -

Which is expected.


However, if I change the ip address in the code above to a non existant address (like 192.168.5.10)..just to test what happens.. this totally crashes the netduino plus and VS 2010. Only way to recover is to reset the netduino with the reset button.

Am I just the wrong code? or is this a bug?



#2875 Wrong network addressing breaks netduino plus

Posted by Flores on 25 September 2010 - 12:46 PM in Netduino Plus 2 (and Netduino Plus 1)

If you try to connect to a non-existant address, it's possible that lwIP has a timeout of "infinite" and will just never stop trying :) Or it's possible that there's a bug in there. .NET MF is using interop with networking, and any native code (i.e. lwIP's socket connect routines) that don't return could cause Visual Studio to wait and wait and wait... There is room to improve this--and this is great feedback to start down that path.

If I understand it right, connecting to a good address is successful--and you can easily recover by pressing the reset button on the Netduino Plus--correct? That's a good backup plan for now.

We'll look at timeout values and see what we can do to make it throw an exception quickly rather than wait forever...

Thank you very much for the feedback!

Chris



Yes, connecting to a existant address works fine. And yes, I can recover using the reset button.
I timeout would be nice, I would expect and exception.



#495 Which components?

Posted by Flores on 15 August 2010 - 10:12 AM in Netduino 2 (and Netduino 1)

Yes, any general purpose transistor like BC54x (Ic = 100 mA) or 2N4401 (Ic = 600 mA) will be fine. I often use ULN280x Darlington array (Ic = 500 mA) or serial-in/parallel-out shift register 74HC595 (20-35 mA, various derivatives) to drive multiple LEDs (matrices).

However, there are still a few other things to consider, for example 8*50 mA = 400 mA, which is close to the limit a USB port can provide (500 mA) and I think I have seen in the firmware source code that Netduino is configured at only 280 mA (have to verify this), so you may not be able to power the Netduino and LEDs from the USB port, an external power supply would be required. And, if you are driving the LEDs by PWM or multiplexing, the peak current can be significantly higher, so you'd need to account for it when selecting the components.

This is why I (annoyingly) ask for details, in my experience "connecting a LED" can mean anything from multiplexed 16*16*16 cube to 20 W RGB power LED...


Just for playing around and testing. Ordered myself a ULN2804. Thanks



#413 Which components?

Posted by Flores on 14 August 2010 - 08:37 AM in Netduino 2 (and Netduino 1)

I just want to connect a number of 50mA leds. Will any transistor do then? And does something like 8 transistors in a IC package exist, so I can connect them to all my outputs and connect 8 leds?



#407 Which components?

Posted by Flores on 14 August 2010 - 06:50 AM in Netduino 2 (and Netduino 1)

For LEDs and the like, you should be fine as-is. If you have the chance to buy a 3.3V version of a component rather than a 5V version of the component, you'll generally want to do so.

The most important case is with communication protocols (SPI, I2C, UARTs, etc.) Many components can take either 3.3V or 5V, but some are more particular.

If in doubt, feel free to ask questions about particular parts here... There are a lot of people with electronics experience in the community.

Chris


Isn't a 5mm led using about 30mA, so too much for directly to the digital outs which can supply only 16mA?
Shouldn't we use a driver of some sort ?



#411 Which components?

Posted by Flores on 14 August 2010 - 07:52 AM in Netduino 2 (and Netduino 1)


Yes. Unlike AVRs, Netduino cannot drive 20~30 mA LEDs directly. Depending on your intended usage, it may be sufficient to drive the LED with only 15 mA, it will be a bit dimmer, or you can use LEDs for smaller current (2 - 10 mA).

Please note Netduino has only three pins that can draw 16 mA (D3, D4, D7), analog pins can draw only 2 mA in digital mode, the rest of pins can draw only 8 mA.


Okay. What would be the simplest schematic and/or component to use, if I want to make sure I don't wreck my netduino connecting the outputs to stuff drawing more than those mA's?

Thanks.



#4000 USB Dual Interface

Posted by Flores on 19 October 2010 - 07:59 PM in Netduino Plus 2 (and Netduino Plus 1)

I know there is a firmware with which you can debug over serial, and use the usb as you want. But never used it.



#4002 USB Dual Interface

Posted by Flores on 19 October 2010 - 08:07 PM in Netduino Plus 2 (and Netduino Plus 1)

Sorry, I guess it is not totally done yet..

See here



#298 Unboxing: first impressions?

Posted by Flores on 12 August 2010 - 02:33 PM in Netduino 2 (and Netduino 1)

Could be.. it looks like the box has been opened (because it taped shut now with a dutch postal service tape) Still would be a little strange that if they opened the box they would leave the boxes out...



#294 Unboxing: first impressions?

Posted by Flores on 12 August 2010 - 08:29 AM in Netduino 2 (and Netduino 1)

Ordered with Makershed 2 units to be shipped to the Netherlands, and they did come with a cable. But not in a box, mine were in their anti static bags only.. They look very cool, even smaller than I thought they would be.



#367 Steps to restore an Erased Netduino

Posted by Flores on 13 August 2010 - 06:35 PM in Netduino 2 (and Netduino 1)

All,

Can someone provide the steps needed to restore an Netduino that has been erased? Believe it or not.. I managed to accidentally erase my Netduino during testing...

Jason.


How did you do that. Could you share a tip so it won't happen to us too?

Thanks



#68 Shipping to France

Posted by Flores on 05 August 2010 - 11:43 AM in Netduino 2 (and Netduino 1)

www.makershed.com will ship to europe.



#4570 Shield Request: Self-upgrade shield

Posted by Flores on 07 November 2010 - 08:28 AM in Netduino Plus 2 (and Netduino Plus 1)

You don't state this directly.. but this would allow upgrades by network, right?



#11714 Serial to PC just wont work, What am I Doing Wrong

Posted by Flores on 06 April 2011 - 08:53 AM in Netduino 2 (and Netduino 1)

If the cable is the problem, and you want a cheap solution for converting the signals you could use the TI MAX232. Works for me.



#1143 PWM shape

Posted by Flores on 23 August 2010 - 01:02 PM in Netduino 2 (and Netduino 1)

Hi, I've been experimenting with the PWM signal, and connected it to my soundcard to see what is happening. What I've found is that the PWM signal is some sort of sinus, and if I change the duty cycle the amplitude goes up. I was expecting a block form signal.. and the duty cycle varies the on width time of the block. Is my soundcard fooling me (I kwow I should get a scope) or is the signal a sinus wave? Thanks



#1147 PWM shape

Posted by Flores on 23 August 2010 - 02:05 PM in Netduino 2 (and Netduino 1)

he he.. okay thanks.. gonna buy a scope.. I promise.



#40 PWM maximum frequency

Posted by Flores on 04 August 2010 - 12:41 PM in Netduino 2 (and Netduino 1)

Okay cool thanks. I mean the build in PWM.



#36 PWM maximum frequency

Posted by Flores on 04 August 2010 - 11:22 AM in Netduino 2 (and Netduino 1)

Hi, Very cool project. I've been through the specs of the processor but can't find the answer to what the maximum frequency of the PWM is. Does anybody know?



#47 PWM maximum frequency

Posted by Flores on 04 August 2010 - 03:08 PM in Netduino 2 (and Netduino 1)

Yes, And it would be great if the SetDutyCycle would take a floating point percentage (in my case). ...as I think of it, an integer would probably also do.. Thanks.



#38 PWM maximum frequency

Posted by Flores on 04 August 2010 - 11:49 AM in Netduino 2 (and Netduino 1)

Please have a look at page 426 for waveform period formulas.


Does that mean there is no hardware limitation? Based on my calculations I can easily go above 20Kkz.. is that correct?

Thanks



#44 PWM maximum frequency

Posted by Flores on 04 August 2010 - 02:11 PM in Netduino 2 (and Netduino 1)

Chris, Thanks for the information. In my application I want to be able to modify the pulse width based on an analogue input, and use the netduino as a controller for a mosfet dimmer, with a frequency above 16Khz. So for me just being able to modify the pulse width from 0 to 100% would do. Thanks



#838 Powerplug

Posted by Flores on 19 August 2010 - 01:59 PM in Netduino 2 (and Netduino 1)

Hi, I want to order a powerplug to connect my netduino to an external powersource. But i'n unsure of which one to order. Is there a universal standard/typeid that I can order? Thanks



#1209 Power supply connector dimensions

Posted by Flores on 24 August 2010 - 08:22 AM in Netduino 2 (and Netduino 1)

See here: http://forums.netdui...__fromsearch__1 I've ordered them 4 days ago, but haven't got them yet. If you are patient I can test it for you.



#3931 Netduino output pin and external LED

Posted by Flores on 16 October 2010 - 06:42 PM in Netduino 2 (and Netduino 1)

If you want to drive more leds this way (up to eight), the uln2803 could be handy.

See it in action with a netduino and an analog input here



#497 Measuring performance.. strange behaviour

Posted by Flores on 15 August 2010 - 10:36 AM in Netduino 2 (and Netduino 1)

I've setup a small program to measure the performance of the netduino:

    public class Program
    {
        static bool state = false;
        static OutputPort led = new OutputPort(Pins.ONBOARD_LED, false);
        static AnalogInput input1 = new AnalogInput(Pins.GPIO_PIN_A0);
        static int analogValue = 0;
        static bool ledstate = false;
        static int counter = 0;

        public static void Main()
        {
            long start = DateTime.Now.Ticks;

            for (int i = 0; i < 2500; i++)
            {
                analogValue = input1.Read();
                ledstate = !ledstate;
                counter = counter + 1;
                led.Write(ledstate);
            }

            long end = DateTime.Now.Ticks;
            TimeSpan span = new TimeSpan(end - start);
            Debug.Print("timespan: " +span.Milliseconds.ToString() + "ms");

        }

    }

If I run this code, it reports that it took 37ms. But if I comment out the
counter = counter + 1
part it reports that it took 979ms !! Thats strange right?

I increased the for to about 20000, then it reports it took 900ms, but the led is way longer on than a second. So it simply reports the wrong time. But why? Can't figure it out.




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.