Go Down

Topic: Arduino assembly programming? (Read 20522 times) previous topic - next topic

rzl

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?

Osgeld

#1
Mar 25, 2010, 01:56 am Last Edit: Mar 25, 2010, 01:56 am by Osgeld Reason: 1
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
http://arduino.cc/forum/index.php?action=unread;boards=2,3,4,5,67,6,7,8,9,10,11,66,12,13,15,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,86,87,89,1;ALL

rzl

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 :-)
Which modell shall i look for ? I'd need a general-purpose one.

Thanks in advance,
--
rzl

jezuz

http://www.sparkfun.com/commerce/product_info.php?products_id=666

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

Senso

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.

Osgeld

#5
Mar 25, 2010, 02:17 am Last Edit: Mar 25, 2010, 02:18 am by Osgeld Reason: 1
Quote
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

Quote

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

http://arduino.cc/forum/index.php?action=unread;boards=2,3,4,5,67,6,7,8,9,10,11,66,12,13,15,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,86,87,89,1;ALL

Osgeld

Quote
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

;)
http://arduino.cc/forum/index.php?action=unread;boards=2,3,4,5,67,6,7,8,9,10,11,66,12,13,15,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,86,87,89,1;ALL

rzl

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

thecarp

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.

Emyr

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?

floresta

Quote
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

Udo Klein

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
Check out my experiments http://blog.blinkenlight.net

cr0sh

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

;)
I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

Udo Klein

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
Check out my experiments http://blog.blinkenlight.net

mem

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.

Go Up