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.
Photo

Just Basic Discussion/Education


  • Please log in to reply
15 replies to this topic

#1 Ryder

Ryder

    Member

  • Members
  • PipPip
  • 13 posts

Posted 18 January 2012 - 03:40 AM

Hi All, For those contemplating or totally new to Netduino (plus), I was hoping to engage those that have experience with a little fact finding that can help with the very basic concepts of what the Netduino is, and what it means to work with it. Your experience can be a great help to those like me that just have a toe in the water. A few Questions... We know the Netduino is hardware and software that can communicate over the web... Q: What is this .Net Micro Framework thing? Is it part of NetDuino? Doesn't it really belong to Microsoft? Can we get rid of it? Would we want to? Q: We're told that we program the Netduino with the C# programming language... so, why do we need the .Net Framework? Why isn't C# code enough? Q: If the .Net Micro Framework is to stay, what do we do with it anyway? Q: It seems there is code already on Netduino when we buy it, and is there along side our programs. What is this code for? Like I said... these are very basic questions, but to people with NO idea what is going on, like me... a little light is better than cursing the darkness. Thank you for your help!

#2 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 18 January 2012 - 08:19 AM

Hi Ryder and welcome to the Netduino community!

I see more question signs then Q's, so forgive me if I forget a question ;)

Q: What is this .Net Micro Framework thing?

It's a more compact version of the .NET Framework, with some additions specific for microcontrollers.

Is it part of NetDuino?

The Netduino has it's own framework built over the .NET Micro Framework (.NETMF)

Doesn't it really belong to Microsoft?

Yep

Can we get rid of it? Would we want to?

You can also program the Netduino using native code, but it's more complex. I like the framework. It's your choice. Keep in mind the .NETMF is totally open source!

Q: We're told that we program the Netduino with the C# programming language... so, why do we need the .Net Framework? Why isn't C# code enough?

C# is an object orientated programming language. Somewhere there must be objects that in the end talk with native code. The framework provides those objects.

Q: If the .Net Micro Framework is to stay, what do we do with it anyway?

Let me reverse this question. How would you want to use C# without any framework at all?

Q: It seems there is code already on Netduino when we buy it, and is there along side our programs. What is this code for?

There's firmware loaded on it. This is required to execute your own program on the Netduino. You can also choose to write/modify the firmware. It's open source! :)
"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs

#3 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 18 January 2012 - 12:50 PM

Stefan is always a good speaker! I'd add that when you're going to use native language (assembler, C, etc) often you must write your own functions. Since ages every programmer have added their functions (maybe shared) in libraries...so libraries, libraries, with millions of functions... Digging deeper, the "million of functions" were just "wheels reinvented over time", because there was no protocols, agreement, and guidelines among the programmers. That leads the "native coding" as a jungle, with a huge, messy, unruled world. Okay, I'm strongly against the C/C++ messy world... So, Java or .Net have "tried" to get order, creating a layer (of abstraction) over the native machine (thus hardware). Thus the millions of functions became thousands of "real" components, well structured, where *ANYONE* must adhere bearing in mind the concept of "order". If you don't like a well-structured, and well-defined context, then the C#/.Net/Java worlds aren't for you. I'd like to ask a question to Ryder: what's the problem in the (Micro) Framework?
Biggest fault of Netduino? It runs by electricity.

#4 Ryder

Ryder

    Member

  • Members
  • PipPip
  • 13 posts

Posted 19 January 2012 - 06:26 AM

I'd like to ask a question to Ryder: what's the problem in the (Micro) Framework?


Hi Mario,

Thank you! Well, as I mentioned as the first question, "what is this .NetMF anyway?" And honestly, I still don't know, so I can't answer your question well... I was hoping for perhaps a more thorough description of it for complete novices, but I think I am gleaning some useful things...

I see that NMF provides us "objects" that c# can use... and that somehow works as a replacement for libraries that will work with the Netduino.

This, however, seems to imply that .NMF was developed by Microsoft for the Netduino, which seems highly improbable... and from what I've read, it wasn't.

So this brings us to the big question... if .NMF wasn't designed to work with Netduino, then how can it possibly be used to do anything with the Netduino hardware?

The limited code experience I have comes from basic. Libraries? You simply started your code (at line 10 if it was a really old flavor of basic), and added code until your program worked. The language had the commands necessary to program the machine... read from a drive, change the video output, put a sound on the audio port, etc. The language knew the machine intimately.

This is why it is "odd" that C# doesn't have the commands to program Netduino in one sense... the language does not know the machine at all... but of course thinking about it for a second, one realizes that since they come from different places, how could it? (makes one wonder why Netduino doesn't have it's own custom language, all necessary functions built in)


But there is an implication here: What this means is that these old computers with BASIC actually had their own very customized BASIC, which had added to it commands to manipulate the hardware it lived in.

So then it makes since that there is a Netduino <-> [something] <-> C# oreo cookie... which might normally be some Netduino specific custom libraries... The libraries understand the Netduino hardware, and C# could call them.

However... suddenly we have this microsoft product, not a custom Netduino library, that can somehow be that creamy center... and in some magical way control the Netduino, even though it was not explicitly designed to...

That makes .NMF quite a mystery to me. How does it know *anything* about the Netduino such that calling it works at all? And doesn't this imply that a huge portion of .NMF is likely to be totally useless with respect to the Netduino? If so, how do programmers know which parts of .NMF are useful in the context of Netduino, and which parts are pointless and can be ignored?

All the best...

#5 Ryder

Ryder

    Member

  • Members
  • PipPip
  • 13 posts

Posted 19 January 2012 - 06:38 AM

Hi Ryder and welcome to the Netduino community!


Thanks!

It's a more compact version of the .NET Framework, with some additions specific for microcontrollers.


To me, that's like saying it is a smaller version of zero :) (since the .NET Framework is something I know even less about)

The Netduino has it's own framework built over the .NET Micro Framework (.NETMF)


Now this is an interesting thing, the oreo is getting more complicated...

If I understand correctly, we have Netduino <-> .NMF <-> Netduino Framework <-> c#.

c# works on the Netduino Framework (where did it come from??? does it have a name?), the Netduino Framework works on .NMF, and .NMF talks directly to the Neduino hardware...

Am I hearing this correctly?
You mention Netduino "native code". What is this?

Thank you!

#6 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 19 January 2012 - 07:48 AM

If I understand correctly, we have Netduino <-> .NMF <-> Netduino Framework <-> c#.

Something like that. Also showed on the downloads page:

development environment
Please install in the following order:
1 Microsoft Visual C# Express 2010
2 .NET Micro Framework SDK v4.1
3 Netduino SDK v4.1.0 (32-bit) or Netduino SDK v4.1.0 (64-bit)


c# works on the Netduino Framework (where did it come from??? does it have a name?), the Netduino Framework works on .NMF, and .NMF talks directly to the Neduino hardware...

It's called the Netduino SDK, like mentioned above :)

Am I hearing this correctly?
You mention Netduino "native code". What is this?

Your questions are deep sir ;)
C# is an object orientated language, but there must always be some code directly driving the hardware. The Netduino SDK does this and is written in C++ and a bit in C#. But I wouldn't try to figure -everything- out from the start. I advise you to figure out the start first ;)
"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs

#7 Arron Chapman

Arron Chapman

    Advanced Member

  • Members
  • PipPipPip
  • 289 posts
  • LocationOregon, USA

Posted 19 January 2012 - 08:09 AM

Now this is an interesting thing, the oreo is getting more complicated...


I'll take a turn at trying to clear this up. ;)
The .Net Framework is a framework developed by Microsoft. In the most simple terms it is a layer of abstraction between the developer (us) and the operating system (windows). The Win 32 API is best described as "800 pound monster covered with hair" and the .Net helps to make it a bit more sane. It takes what can be complex interactions or what might require large amounts of code at a lower level and makes them much simpler.


Then .Net Micro Framework ( or .NetMF as I prefer) is a slimmed down version of the .Net built specifically for "

resource-constrained devices" such as micro-controllers (like the Netduino) it makes things that are even harder on a platform like this just as easy as they are with the .Net. For example, to blink the onboard LED on the Netduino you need code something like.

OutputPort led = new OutputPort(Pins.ONBOARD_LED, false);//Create a new port with the initial state false (or off)
while (true)
{
    led.Write(!led.Read());//Change the state of the LED
    Thread.Sleep(250);//Wait 250ms before doing it again
}

While I can't provide a simple sample of the native version (maybe someone will do this for me ;) ) I have seen an example of it and if my memory serves more complicated.

The Netduino framework essentially a bunch of code written by Secret Labs which instructs the .Net what features are available on the hardware, where the specific hardware bits are, and how to use them.

I'm no expert so don't take all of this as gold, and if anyone finds any mistakes please correct them.

When you talk EE use small words, I'm just a Software Developer :)
My Blog/Site and Everything Else

If my post helped you please consider pressing the "Like This" button in the bottom right-hand corner.

 

Oh my. So many things, so little money!!

 


#8 Ryder

Ryder

    Member

  • Members
  • PipPip
  • 13 posts

Posted 19 January 2012 - 08:26 AM

OK, cool, I think... SO, the Netduino Framework is code written by people that know the Netduino hardware... this is the code that makes it possible for the .NetMF to successfully do anything with the netduino... the glue between .NetMF and the hardware... Yes? OK, SO, if someone were to have, say, a list of what functionality the Netduino Framework provides to .NetMF, then one should have a pretty good idea what .NetMF can do with netduino... yes? (because looking at .NetMF documentation won't tell you anything about using it with netduino, yes?) Did the Secret Labs people ever document the Netduino Framework? Of course I have it installed... but there doesn't seem to be any information about it following the install. Thank you!

#9 Arron Chapman

Arron Chapman

    Advanced Member

  • Members
  • PipPipPip
  • 289 posts
  • LocationOregon, USA

Posted 19 January 2012 - 08:35 AM

SO, the Netduino Framework is code written by people that know the Netduino hardware... this is the code that makes it possible for the .NetMF to successfully do anything with the netduino... the glue between .NetMF and the hardware... Yes?


Yes. (At least to my understanding)

OK, SO, if someone were to have, say, a list of what functionality the Netduino Framework provides to .NetMF, then one should have a pretty good idea what .NetMF can do with netduino... yes?


Yes and no, the .Net provides the bulk of the functionality and core classes (again, at least to my understanding). You can find documentation for the .Net at the MSDN.

Did the Secret Labs people ever document the Netduino Framework? Of course I have it installed... but there doesn't seem to be any information about it following the install.


See previous comment for this.

When you talk EE use small words, I'm just a Software Developer :)
My Blog/Site and Everything Else

If my post helped you please consider pressing the "Like This" button in the bottom right-hand corner.

 

Oh my. So many things, so little money!!

 


#10 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 19 January 2012 - 08:58 AM

For example, to blink the onboard LED on the Netduino you need code something like.[/size][/font]

OutputPort led = new OutputPort(Pins.ONBOARD_LED, false);//Create a new port with the initial state false (or off)
while (true)
{
    led.Write(!led.Read());//Change the state of the LED
    Thread.Sleep(250);//Wait 250ms before doing it again
}

While I can't provide a simple sample of the native version (maybe someone will do this for me ;) ) I have seen an example of it and if my memory serves more complicated.



This could be a version in native code:
int main(void) {
    
    // Reset ("de-initialise") GPIO port D.
    GPIO_DeInit(GPIOD);    
    // Initialise pin 0 of port D.
    GPIO_Init(GPIOD, GPIO_PIN_0, GPIO_MODE_OUT_PP_LOW_FAST);
    
    // Reset ("de-initialise") TIM3.
    TIM3_DeInit();
    // Set TIM3 to use a prescaler of 2048 and have a period of 999.
    TIM3_TimeBaseInit(TIM3_PRESCALER_2048, 999);
    // Enable TIM3.
    TIM3_Cmd(ENABLE);

    // Infinite loop.
    for(;;) {        
        if (TIM3_GetCounter() < 500) {        
            // Output a low on the LED pin to illuminate it.
            GPIO_WriteLow(GPIOD, GPIO_PIN_0);
        } else {
            // Output a high on the LED pin to switch it off.
            GPIO_WriteHigh(GPIOD, GPIO_PIN_0);
        }
    }
}

:D
"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs

#11 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 19 January 2012 - 10:11 AM

Well, I really love this thread. It should be cleaned a little, then placed in the Wiki section as "early steps guidance". Ryder, here is how to turn on-then-off a led using the assembler: lda #01 sta $23 lda #00 sta $23 Do you understand anything? Well, if you had any practice with the "ancient" 6502 CPU (e.g. Apple II), then you probably understand what the program does. The assembler is the mnemonic-way of the machine-code language, being actually interpreted by any CPU. But, stop!...I still own my Apple II, but someone else doesn't. So, here could be the same program for the x86 CPUs: mov al, 01h out 23h, al mov al, 00h out 23, al Quite different...notice that the HEX-notation uses different syntaxes as well. We're plenty of different CPUs, so...should we learn lot of assemblers? Moreover, would you imagine the huge effort to write a very complex task as a TCP/IP manager? Or even a whole application? Java and .Net goal is the same: wrapping all the hardware with the same dress, so that any programmer could see different machines as they were actually the same. It's much like when you choose a car: outside are pretty different, but to drive them is always the same thing. Cheers
Biggest fault of Netduino? It runs by electricity.

#12 VBNewcomer

VBNewcomer

    New Member

  • Members
  • Pip
  • 1 posts

Posted 19 January 2012 - 02:49 PM

I too need to understand regarding such microcontrollers and netduino boards. I'm totally new to world of embedded and electronics, nor new student, just started to search for RF switch for home and found such wonderful resources for making it on my own !!!. Can anyone please let me know, how i can proceed with my project to make RF switch for home automation ? I even don't know minimum requirements to be learned or minimum hardware or software requirement but as i know VB i thought netduino with VB or V# will be best to start with. I read books on making projects too, little bit understood too but after that one question in my mind is; how to make it possible to use it in real life with making PCB, is it cost effective to make own PCB and what process will be involved to make own project to real life ? Please pardon if questions is dumb... as i'm totally new in this field, just seeking information from starting to ending of this world.

#13 Arron Chapman

Arron Chapman

    Advanced Member

  • Members
  • PipPipPip
  • 289 posts
  • LocationOregon, USA

Posted 19 January 2012 - 08:09 PM

I too need to understand regarding such microcontrollers and netduino boards. I'm totally new to world of embedded and electronics, nor new student, just started to search for RF switch for home and found such wonderful resources for making it on my own !!!.

Can anyone please let me know, how i can proceed with my project to make RF switch for home automation ? I even don't know minimum requirements to be learned or minimum hardware or software requirement but as i know VB i thought netduino with VB or V# will be best to start with. I read books on making projects too, little bit understood too but after that one question in my mind is; how to make it possible to use it in real life with making PCB, is it cost effective to make own PCB and what process will be involved to make own project to real life ?

Please pardon if questions is dumb... as i'm totally new in this field, just seeking information from starting to ending of this world.


There are likely going to be a lot of questions (both from you and the community) before you'll get all of your answers, it might be a good idea to start a new thread.

When you talk EE use small words, I'm just a Software Developer :)
My Blog/Site and Everything Else

If my post helped you please consider pressing the "Like This" button in the bottom right-hand corner.

 

Oh my. So many things, so little money!!

 


#14 Ryder

Ryder

    Member

  • Members
  • PipPip
  • 13 posts

Posted 20 January 2012 - 02:24 AM

Yes. (At least to my understanding)


Yes and no, the .Net provides the bulk of the functionality and core classes (again, at least to my understanding). You can find documentation for the .Net at the MSDN.

See previous comment for this.


Hi... Arron, I'm sorry, I'm missing something. I went to the link in the previous comment, and that is a microsoft site.

Just to be sure we're on the same page... I'm looking for the documentation for the *Secret Labs* Netduino framework, not the microsoft .NetMF docs.

Secret Labs made it possible for the .NetMF to work on the 'duino hardware... so, I'm hoping there is reference material on precisely what they implemented.

All the best,

R

#15 Arron Chapman

Arron Chapman

    Advanced Member

  • Members
  • PipPipPip
  • 289 posts
  • LocationOregon, USA

Posted 20 January 2012 - 03:43 AM

Hi... Arron, I'm sorry, I'm missing something. I went to the link in the previous comment, and that is a microsoft site.

Just to be sure we're on the same page... I'm looking for the documentation for the *Secret Labs* Netduino framework, not the microsoft .NetMF docs.

Secret Labs made it possible for the .NetMF to work on the 'duino hardware... so, I'm hoping there is reference material on precisely what they implemented.

All the best,

R


As far as I know most of what they implemented is just hardware specific, the classes your going to be using are part of the .NetMF. If you want to see what it is that they have to do you can have a look at the .NetMF Porting Kit.

When you talk EE use small words, I'm just a Software Developer :)
My Blog/Site and Everything Else

If my post helped you please consider pressing the "Like This" button in the bottom right-hand corner.

 

Oh my. So many things, so little money!!

 


#16 Ryder

Ryder

    Member

  • Members
  • PipPip
  • 13 posts

Posted 20 January 2012 - 06:27 AM

As far as I know most of what they implemented is just hardware specific, the classes your going to be using are part of the .NetMF. If you want to see what it is that they have to do you can have a look at the .NetMF Porting Kit.



Thanks Arron,

Maybe I can take another tack... When you go to the .NetMF API and look through the command set (objects?)...

How do you know which ones apply to (will work with) Netduino?

Thanks again,

R




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

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.