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.

Kenny Kerr's Content

There have been 17 items by Kenny Kerr (Search limited from 29-March 23)


By content type

See this member's

Sort by                Order  

#7077 C++ compilers

Posted by Kenny Kerr on 05 January 2011 - 04:11 PM in Netduino 2 (and Netduino 1)

Thanks for the link!



#7078 C++ compilers

Posted by Kenny Kerr on 05 January 2011 - 04:12 PM in Netduino 2 (and Netduino 1)

C++0x as in "the new *draft* version of C++"?

http://en.wikipedia.org/wiki/C%2B%2B0x

Impressive, I didn't think it had arrived yet.


Yes, Visual C++ 2010 has implemented many of the new language and libraries defined by the upcoming C++0x proposed standard.



#7081 C++ compilers

Posted by Kenny Kerr on 05 January 2011 - 04:38 PM in Netduino 2 (and Netduino 1)

Does it have the proposed/optional Garbage Collector as well?


No, it includes rvalue references (essential for move semantics and perfect forwarding), type inference (auto), lambda functions and expressions, trailing return types, nullptr, static assertions, new standard hash tables, regular expressions, shared_ptr and unique_ptr, function objects (kinda like C# delegates), type traits, and some others. It’s a great start. The next release should include most of the outstanding items and any changes once C++0x is finalized.



#7072 C++ compilers

Posted by Kenny Kerr on 05 January 2011 - 03:04 PM in Netduino 2 (and Netduino 1)

Hi Chris, If we decided to throw some native code into the mix what C++ compilers are available? On the desktop I use Visual C++ 2010 with its good support for C++0x language features and libraries. Presumably the Standard C++ Library won’t be available but at least a compiler with good support for templates is a must. Also, is it pretty straightforward to mix some native functions into an otherwise C# based Netduino project? My Netduino Plus has finally shipped. Can’t wait! Cheers, Kenny



#7225 C++ compilers

Posted by Kenny Kerr on 07 January 2011 - 07:14 PM in Netduino 2 (and Netduino 1)

Well, exploding complexity in order to fix up a language, sounds more like 'beginning to an end' to me :-/

But C++ could really use a refurbish, so it'll be very interesting to see if it sticks. (Eg. will it be implemented in GNU etc.)


Many of the C++0x language features are already available in the GCC compiler.



#8317 RS485 between two Netduinos

Posted by Kenny Kerr on 24 January 2011 - 06:50 PM in Netduino Plus 2 (and Netduino Plus 1)

What RS485 transceivers are you using? If using RTS/CTS, you generally need to wire _both_ RTS and CTS.


I'm using the LT1785 tranceiver. I thought I didn't need to wire up the CTS but I could be wrong.

Also, are RX and TX swapped between the two boards (RX1<->TX2 and RX2<->TX1)?


I'm not sure what you mean. I tried to wire both board identically: DI to TX (pin 3) and R0 to RX (pin 2).

Cheers,
Kenny



#8310 RS485 between two Netduinos

Posted by Kenny Kerr on 24 January 2011 - 06:00 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi there,

I have a Netduino and a Netduino Plus that I’ve connected to RS485 transceivers in an attempt to test serial communication between the two. My wiring may well be wrong but I’m just trying to eliminate coding errors first.

The tranceiver requires 3 pins which map to RX, TX and RTS on the netduino I believe. I have connected these to digital pins 2, 3 and 7. I assume this maps to COM2.

The netduino plus attempts to send a few bytes when the button is pressed:

class Program
{
    static SerialPort m_port;

    static void Main()
    {
        m_port = new SerialPort("COM2", 9600, Parity.None, 8, StopBits.One);
        m_port.Handshake = Handshake.RequestToSend;
        m_port.DataReceived += OnDataReceived;
        m_port.ErrorReceived += ErrorReceived;
        m_port.Open();

        InterruptPort button = new InterruptPort(Pins.ONBOARD_SW1, false, Port.ResistorMode.Disabled, Port.InterruptMode.InterruptEdgeBoth);
        button.OnInterrupt += OnButton;

        Thread.Sleep(Timeout.Infinite);
    }

    static void ErrorReceived(object sender, SerialErrorReceivedEventArgs args)
    {
        Debug.Print("error");
    }

    static void OnDataReceived(object sender, SerialDataReceivedEventArgs args)
    {
        Debug.Print("data");
    }

    static void OnButton(uint data1, uint data2, DateTime time)
    {
        if (0 == data2)
        {
            var bytes = Encoding.UTF8.GetBytes("hello from netduino plus");
            int count = m_port.Write(bytes, 0, bytes.Length);
            Debug.Assert(bytes.Length == count);
            m_port.Flush();
        }
    }
}

The netduino on the other end simply waits to receive data:

class Program
{
    static SerialPort m_port;

    static void Main()
    {
        m_port = new SerialPort("COM2", 9600, Parity.None, 8, StopBits.One);
        m_port.Handshake = Handshake.RequestToSend;
        m_port.DataReceived += OnDataReceived;
        m_port.ErrorReceived += ErrorReceived;
        m_port.Open();

        Thread.Sleep(Timeout.Infinite);
    }

    static void ErrorReceived(object sender, SerialErrorReceivedEventArgs args)
    {
        Debug.Print("error");
    }

    static void OnDataReceived(object sender, SerialDataReceivedEventArgs args)
    {
        Debug.Print("data");
    }
}

Although the SerialPort.Write call succeeds, data is never received on the remote SerialPort. Am I doing something obviously wrong?

Cheers,
Kenny



#8555 RS485 between two Netduinos

Posted by Kenny Kerr on 27 January 2011 - 01:57 PM in Netduino Plus 2 (and Netduino Plus 1)

Anyway, about the RTS, I'd avoid to modify the driver for the TX-enabling. I'd prefer to manage "manually" the line...


Hi Mario,

Yes for the netduino it’s probably simplest to let the chip think it’s an RS232 and handle the RTS manually. We’re just going to use native code with our own board, so we can use the RS485 driver.

Cheers,
Kenny



#8471 RS485 between two Netduinos

Posted by Kenny Kerr on 26 January 2011 - 05:04 PM in Netduino Plus 2 (and Netduino Plus 1)

FYI, I'm working to do the same thing, but for connect the Netduino+ to a PC.


Thanks Mario,

Did you get it to work? From reading through the Atmel docs on their USART and looking at the Micro Framework firmware (native code) it looks like the Micro Framework hardcodes the USART to operate in “normal” mode but we require it to be switched to “rs485” mode to ensure the right RTS behavior. Unfortunately this requires a recompilation of the netduino’s firmware to flip this register value.

Cheers,
Kenny



#6620 Schematic files

Posted by Kenny Kerr on 29 December 2010 - 01:48 AM in Netduino Plus 2 (and Netduino Plus 1)

Hi Chris, I’ve ordered a few netduino boards. It’s working great as a development board for a project we’re working on. I heard in an interview that netduino is an “open source” project. I was hoping to get the schematic files so that we can use them as a starting point for our project hardware. We need to add a bunch of comm ports, RAM, etc. and it would save us a lot of time. I see the .brd files are available online but it would be great if we could get the .sch file for the netduino plus for use in CadSoft Eagle. Cheers, Kenny



#6641 Schematic files

Posted by Kenny Kerr on 29 December 2010 - 12:52 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi Kenny,

Welcome to the Netduino community!

We use Candence Allegro for board layout on sophisticated boards like the Netduino. We do print the schematics out as PDFs, which are available on the Downloads page.

Does that give you a good start?

Chris


Thanks Chris!



#7725 Using netduino plus without .NET

Posted by Kenny Kerr on 15 January 2011 - 02:39 PM in Netduino Plus 2 (and Netduino Plus 1)

If you're doing heavy development, I'd recommend picking up the Atmel AT91SAM7X-EK devboard, solder a 512KB MCU onto it, and buying a nice compiler and JTAG unit. These can range in price from low-cost (GCC and one of the low-cost JTAGs) to really nice (the ARM RVDS compiler and RVICE JTAG...about $10k). We use the latter, but you can certainly do this sort of thing using GCC and Netduino on a budget if you don't mind using printfs for debugging...


Could you recommend a basic JTAG unit for single-step debugging that I could use with GCC? I want to get a feel for what this is like with a microcontroller, but have no idea where to start or where to purchase such a thing.

Cheers,
Kenny



#7661 Using netduino plus without .NET

Posted by Kenny Kerr on 14 January 2011 - 05:11 PM in Netduino Plus 2 (and Netduino Plus 1)

Thanks for the advice Chris. I’ll see how far I can get performance-wise by mixing in some C++ interop. Would you recommend using the .NET Socket class and passing each packet buffer to native code for encoding/decoding/handling? I assume the .NET Socket class is internally pretty efficient in its communication with the transport layer. Cheers, Kenny



#7650 Using netduino plus without .NET

Posted by Kenny Kerr on 14 January 2011 - 03:10 PM in Netduino Plus 2 (and Netduino Plus 1)

I’m doing a lot of UDP networking and am not too pleased with the performance of the interpreter (encoding, decoding packets etc). On the desktop I’m using C++ and am wondering whether I can use the netduino boards I have to prototype some completely native firmware. In particular I was thinking of using uIP or lwIP. I’m not sure which one so I’ll probably just try them both and see what the pros and cons are. Is netduino suited for this type of development? Also if there are any suggestions for tooling I’d appreciate it. I’m new to microcontroller development but have used C++ on the desktop for years. Should I write to the metal or use some kind of mini OS? What about drivers for the network adapter and SD card? I’ll probably just try and figure out what the Micro Framework is doing under the covers but any suggestions would be appreciated. At the very least I want to prototype a native UDP implementation to compare the performance against the Micro Framework’s Socket implementation written in C#.



#7666 Using netduino plus without .NET

Posted by Kenny Kerr on 14 January 2011 - 05:44 PM in Netduino Plus 2 (and Netduino Plus 1)

Thanks Chris - that sounds promising.



#6807 Big-endian

Posted by Kenny Kerr on 02 January 2011 - 12:29 AM in Netduino 2 (and Netduino 1)

Hi Chris, Do you know whether it’s possible to switch the netduino to big-endian? I’m doing a boatload of network I/O and it would save a lot of effort in the firmware if it were big-endian rather than little-endian. I know the ARM processors support switching this and the Micro Framework obviously supports both modes. I’m just not sure how to switch it on the Atmel microprocessor. My only concern is that the Atmel’s memory controller may only support little-endian. Cheers, Kenny



#6812 Big-endian

Posted by Kenny Kerr on 02 January 2011 - 02:18 AM in Netduino 2 (and Netduino 1)

Hi Chris, Most of the I/O is to support a niche industry UDP protocol so the packets are relatively small and the multi-byte values are not encoded with a fixed number of bytes. I don’t think it would be worth it in this case. It’s not a big deal – just hoping to simplify my encoding and decoding – performance is not a problem. Thanks for the input! Cheers, Kenny




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.