Arduino assembly programming?

Hello there people!
I've been programming the z80 microprocessor for a while using the legendary uProfessor and now i'm looking for something less academic a and more useful to program. Arduino looks like "the way", but i'm in doubt: will i be able to program it in pure assembly?

yes you can mix C and asm together in the arduino environment, direct up asm you might have to make a script and get the appropriate tools from atmel, but in the end arduino is just uploading a hex file built however (c compiler, assembler etc) to the chip through the bootloader

Uhm... so there's a bootloader i can't overwrite, but asm programming barely means i'll have to upload an hex file... that will be written somewhere in the memory and executed, right ?

Sounds good. I think i'll get an arduino :slight_smile:
Which modell shall i look for ? I'd need a general-purpose one.

Thanks in advance,

rzl

This one is that standard for arduino newcomers. Referred to as the "Main Board", "2009", or "Duemilanove"

Arduino provides you an simple IDE for programming in wiring/c, that c code is read by the avr-gcc compiler that generates an hex file, but you can also see the disassembly code too if you want, but c code is a lot more powerful than asm, and you need to learn all about the atmel asm, but if you want, look this forum:
http://www.avrfreaks.net/
It's the official atmel forum and have a lot of good people.
In the end you can use the bootloader to program the avr in the arduino or you will need an isp programmer.

Uhm... so there's a bootloader i can't overwrite

yes if you want to use arduino functionality and keep serially uploading hex files (via converted rs232 or usb)

optionally you can get the boot loader san arduino stuff and use it like a mini avr dev platform

the bootloader typically uses 2k of program space, without it you gain 2k but you need a programmer to upload hex files (an uploader can be another arduino!) and this is how the bootloader gets onto the chip's storage

but asm programming barely means i'll have to upload an hex file... that will be written somewhere in the memory and executed, right ?

yes with a bootloader or a programmer, I suggest the arduino route as it is the most flexible for someone who is new, all wrapped up in a easy package with a killer support group

but c code is a lot more powerful than asm

thats really debatable on a system that is tight on speed and has 2k of ram

:wink:

So i see linux, windows and mac os x... are bsd systems supported?

The arduino software is java, and just picks a serial port. As long as you are on a system that can make the usb serial port looks like a serial port, I can't think of why it wouldn't work.

I have only been fiddling with mine for a few days, but I have already become a huge fan of the Duemilanove with the proto shield. It just breaks out all the headers from the board to a blank board above, perfect for putting a mini breadboard on and hitting the ground running.

You want to write assembly? You pervert!

The whole point of Arduino is to be able to rapidly develop stuff - if you want so much control, why not create your own AVR board?

You want to write assembly? You pervert!

The whole point of Arduino is to be able to rapidly develop stuff - if you want so much control, why not create your own AVR board?

When you use the Arduino environment you are relying on libraries that have been developed by experienced programmers.

Those programmers likely got their experience by programming (in Assembly, C, or some other language) on hardware called a 'development system'.

The Arduino hardware provides a very inexpensive basic development system and is ideal for learning assembly language or C programming.

Why create your own AVR hardware when all you will wind up with is essentially what is on the Arduino pc board - a microcontroller, crystal, power supply, and serial to USB interface. You don't need the latter if you are not using the bootloader so you can cut your cost in half by buying a 'duino' clone that doesn't have that interface.

Don

rzl: I would suggest a seeduino because it is more "general purpose" than the original Arduino. It can be switched to 3.3V and it can be used with standard headers. Unless you want to restrict yourself to prefabricated shields you will figure out soon why the Seeduino is a better choice. The only drawback is that Seeduino has the Chip soldered in place.

If you do not insist on the Arduino form factor you may also want to have a look at the teensy. It uploads way faster.

Udo

You want to write assembly? You pervert!

The whole point of Arduino is to be able to rapidly develop stuff - if you want so much control, why not create your own AVR board?

You haven't really coded until you've left blood on the toggle switches...

:wink:

Actually the whole point of Arduino is to enable people to do with it whatever they want. That's the definition of open. Free like in "free speech" not like "free beer". So if he wants to code assembler, then of course this is aligned with the Arduino idea. As I understand it the idea is to get people started and not to lock them into anything.

Udo

Although it is possible to program arduino in assembler, there are more suitable environments for doing this than the Arduino IDE.
avrfreaks is a good place for advice and discussions on assembly language programming and tools for the AVR chips.

open source and free are great!

While you can program with assembler using the arduino environment, sort of, the "gasm" assembler that you get is not very compatible with the assembler syntax and etc defined by Atmel and used in their examples, as well as most of the open source assembler code you can download from various places. There ARE open-source assemblers that match the Atmel format, but they aren't available from the Arduino IDE...

Reply #10

The Arduino hardware provides a very inexpensive basic development system and is ideal for learning assembly language or C programming.

Reply#14

Although it is possible to program arduino in assembler, there are more suitable environments for doing this than the Arduino IDE.

Reply #16

While you can program with assembler using the arduino environment, sort of....

I would like to make sure that everyone understands that the Arduino hardware and the Arduino IDE (or Arduino environment) are two different things. For an inexpensive (around $50 US) introduction to assembly language programming some Arduino-type hardware, AVR Studio 4, and a USB programmer that uses the ISP interface is a good choice.

Don

arduino has a lot of freedom to it; in terms of what you can do with it

For an inexpensive (around $50 US) introduction to assembly language programming some Arduino-type hardware, AVR Studio 4, and a USB programmer that uses the ISP interface is a good choice.

Agreed. It supports at least 5 different CPUs (mega48, mega8, mega88, mega168, mega328) and has all those neat "shield" capabilities, plus power supply and reset button...

It ought to be possible to use the Arduino bootloader to load assembler programs, skipping the need for an ISP programmer, too. The bootloader emulates one of the standard programmers, so it may or may not work with AVR Studio. (if it doesn't, you can still download and "avrdude" as the downloader...)