NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.
Microcontroller Programming » Using assembly on ATmega168 with Linux
September 19, 2009 by tech20 |
I was wondering how you can use assembly with these microcontrollers in linux. I haven't use assembly before, but would like to learn with the microcontroller since it is more visual to see the results. Any help with tools/tutorials. I don't know how to even load up the assembly to the chip, so please, basics. |
---|---|
September 19, 2009 by mrobbins (NerdKits Staff) |
Hi tech20, We don't have any tutorials currently with assembly being used explicitly, but you will basically want to output a .hex file and use the same avrdude command line as we show how to do in The NerdKits Guide. I can recommend that you take a look at this page: Using assembly code in-line with C code. I suspect you'd also want the AVR instruction set documentation which shows you what each machine instruction does. In the past, I have used inline assembly on rare occasions when I need to specify exactly what I want the chip to do. That way, it's easier to link it into existing C code, and also can be compiled with avr-gcc. However, the program "avr-as" is the standalone assembler, and I think you'd have to run "avr-as" to convert your assembly code into machine object code (a .o file), and then would have to use "avr-objcopy" to make a .hex file, and then finally use avrdude for programming the chip. Also see this thread where some other NerdKits users are using assembly for various things -- they might be able to help you out even more. Hope that helps get you started! Mike |
Please log in to post a reply.
Did you know that negative numbers are represented in two's complement notation in binary? Learn more...
|