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

Program in assembly language?


  • Please log in to reply
15 replies to this topic

#1 Budisha

Budisha

    New Member

  • Members
  • Pip
  • 9 posts

Posted 28 October 2012 - 03:59 PM

Hello. I want to learn assembly and I was wondering if it would be possible to program for the netduino in assembly. I searched on the forum and on the internet but couldn't find anything. Thanks

#2 Nevyn

Nevyn

    Advanced Member

  • Members
  • PipPipPip
  • 1072 posts
  • LocationNorth Yorkshire, UK

Posted 28 October 2012 - 04:19 PM

I want to learn assembly and I was wondering if it would be possible to program for the netduino in assembly.
I searched on the forum and on the internet but couldn't find anything.

I think the whole point of the Netduino is that you use a high level language such as C# or VB to give you the abstraction form the hardware in order to make prototyping and development a more rapid and smoother process. I think you will need to look at alternative platforms in order to use assembly language on a hardware platform.

Regards,
Mark

To be or not to be = 0xFF

 

Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life

Follow @nevynuk on Twitter


#3 Geancarlo2

Geancarlo2

    Advanced Member

  • Members
  • PipPipPip
  • 70 posts

Posted 28 October 2012 - 04:45 PM

Hi, you can erase the board and program it using ARM or Thumb instruction sets, but of course you have no access to NETMF. To be honest you should start with a simpler 8-bit microcontroller or use an emulator software for educational purposes...

#4 Budisha

Budisha

    New Member

  • Members
  • Pip
  • 9 posts

Posted 28 October 2012 - 04:46 PM

Thanks for your reply, Mark.
I know the whole point of the netduino is the ability to use higher level languages for a microcontroller, but I just wanted to try assembly and since I already had the netduino, I thought i might use it for that.
If its not possible, which cheap microcontroller would you recommend?


Hi, you can erase the board and program it using ARM or Thumb instruction sets, but of course you have no access to NETMF. To be honest you should start with a simpler 8-bit microcontroller or use an emulator software for educational purposes...


Thanks for the reply, but I was asking for which assembler to use and how to upload the code. Which 8bit microcontroller would you recommend?

#5 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 28 October 2012 - 04:57 PM

It is possible to program Netduino in C/C++ or assembly, you'd just need to use an ARM toolchain (such as Keil MDK, ARM RVDS, IAR EWARM, Rowley CrossWorks for ARM, Yagarto, Sourcery etc.), and flash the executable via Atmel SAM-BA. The existing Netduino/Plus/Mini boards do not have any debugging connector (JTAG), which makes development a little bit more challenging.

#6 Budisha

Budisha

    New Member

  • Members
  • Pip
  • 9 posts

Posted 28 October 2012 - 05:48 PM

It is possible to program Netduino in C/C++ or assembly, you'd just need to use an ARM toolchain (such as Keil MDK, ARM RVDS, IAR EWARM, Rowley CrossWorks for ARM, Yagarto, Sourcery etc.), and flash the executable via Atmel SAM-BA. The existing Netduino/Plus/Mini boards do not have any debugging connector (JTAG), which makes development a little bit more challenging.


Thanks, I will try that

#7 AlfredBr

AlfredBr

    Advanced Member

  • Members
  • PipPipPip
  • 138 posts
  • LocationConnecticut, USA

Posted 28 October 2012 - 06:03 PM

You might consider learning x86 assembly first. There are TONS of resources for learning x86 on the Internet (including free manuals from Intel).

#8 Nevyn

Nevyn

    Advanced Member

  • Members
  • PipPipPip
  • 1072 posts
  • LocationNorth Yorkshire, UK

Posted 28 October 2012 - 09:04 PM

If its not possible, which cheap microcontroller would you recommend?

If I was to be looking at assembler and hardware I'd be thinking seriously about the STM32 Discovery boards. They offer you the ability to have a go at ARM development and you can pick them up for a few pounds.

Bear in mind that there are people here with a lot more experience in this field than myself, but that's where I'd be looking.

Hope this helps,
Mark

To be or not to be = 0xFF

 

Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life

Follow @nevynuk on Twitter


#9 Budisha

Budisha

    New Member

  • Members
  • Pip
  • 9 posts

Posted 29 October 2012 - 02:59 PM

I've managed to assemble some code and upload it with sam-ba. Now only if I had some code to test it. Perhaps one of you guys could provide assembly code to blink the onboard led? Thanks

#10 JerseyTechGuy

JerseyTechGuy

    Advanced Member

  • Members
  • PipPipPip
  • 870 posts

Posted 29 October 2012 - 05:15 PM

I've managed to assemble some code and upload it with sam-ba. Now only if I had some code to test it. Perhaps one of you guys could provide assembly code to blink the onboard led?
Thanks


I've programmed in assembly way back when. Many controllers and other products. I'm not sure why anyone would use it with structured languages available for controllers.

Also, isn't part of learning trying to figure it out. Not asking someone to do it for you. Just saying... ;)

#11 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 29 October 2012 - 06:00 PM

Perhaps one of you guys could provide assembly code to blink the onboard led?

How about compiling a trivial C/C++ application (you can simply modify one of the getting-started projects from AT91SAM7X-EK Software Package) and inspect its assembly output? While the blinking itself is trivial (toggling a bit of a GPIO register), there is a few things that must be set up first - interrupt vector table, system clock configuration, GPIO mode settings etc., which require a little bit of work to get it right, especially on a board that does not support interactive debugging/code stepping Posted Image

#12 Budisha

Budisha

    New Member

  • Members
  • Pip
  • 9 posts

Posted 29 October 2012 - 08:17 PM

How about compiling a trivial C/C++ application (you can simply modify one of the getting-started projects from AT91SAM7X-EK Software Package) and inspect its assembly output? While the blinking itself is trivial (toggling a bit of a GPIO register), there is a few things that must be set up first - interrupt vector table, system clock configuration, GPIO mode settings etc., which require a little bit of work to get it right, especially on a board that does not support interactive debugging/code stepping Posted Image


Thanks for the link. That library is great.
I've managed to get the led blinking and will continue to port the header files for use with Netduino.
Thanks, everyone

#13 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 30 October 2012 - 12:07 AM

I think learning assembly language is extremely good for understanding how this stuff really works under the hood. Even today it will give you a much deeper and advantageous understanding than what you get from only working on a high level of abstraction. However, I strongly suggest starting off with something much simpler, maybe a PIC or something like that. For low level stuff, I prefer C (or C++) with a little inline assembly where necessary. The performance of C code can be comparable or equal to that of assembly.

#14 Bob W.

Bob W.

    New Member

  • Members
  • Pip
  • 2 posts

Posted 31 October 2012 - 08:23 AM

I am still trying to learn high level programming, ie. .Net and C#, I started programming in the days of Univac in 1970. All we ever did was machine level programming or assembly. (In Hex and Octal before Basic) Back in the 90's I started playing with the 80c51 line of micro controllers and if you have an eprom programmer can build a simple 3 chip micro controller on a bread board, I still have some wire-wrapped boards that are still running today. Times have changed and now 16 and 32 bit micro controllers now rule the world, the thing is that there is still thousands of things a simple 80c51,or Z80, can run and do, Heck it was 8 bit computers that put man on the Moon. I grant you that these aren't just plug in a USB cable and program remotely from your IPhone but can be very interesting to learn Assembly programming on. An 8 bits system is a lot easier to learn on and understand then a 64 bit system. We built several radio repeater controllers with touch tone and PL control and linking on a 80C51 based processor. You are limited on ports but the Stamp processors could be something to look into. One big thing with assembly is you really need to understand the architecture of the processor you are using. Have Fun.... Bob ne7ne.

#15 Mattster

Mattster

    Advanced Member

  • Members
  • PipPipPip
  • 46 posts
  • Locationusually South Florida

Posted 03 November 2012 - 12:53 PM

IMO, assembler is a good thing. Anyone who wants to be a great programmer needs to learn how to assemble. I find it hard to believe that the educational system turns out degreed software engineers that have never touched an assembler. It's fine that C# and Ruby and Python and others provide high productivity and protect programmers from doing stupid things in their code, but if you don't understand how it actually works, how can you fix it when it is really broken? Oh, I forgot, that's why there will always be job opportunities for consultants that know how to assemble.

#16 Budisha

Budisha

    New Member

  • Members
  • Pip
  • 9 posts

Posted 06 November 2012 - 08:33 PM

Thanks for the replies. I picked up the ATmega8 from the shop this morning so i can learn assembler on a 8bit microcontroller. I think I'll stick with that for a while.




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.