Assembly or GCC?

Hey guys im trying to start programming some attiny13a's and im pretty well experienced with the arduino C language and was wondering which language would be easier for me to hop into assembly or gcc? And does anybody have any good tutorials that worked good for them cause ive tried a few assembly ones and they seem to detailed for a first timer.
some projects ive done with the arduino are
alarm clock (with lcd)
wii nunchuck rc car controller
nes controller reader

gcc is a compiler, not a language; avr-gcc is (IIRC) the compiler instance of gcc that is called by the Arduino IDE to compile the code (AVR C) into the binary that is uploaded to the Arduino board (via avrdude).

So, in effect, you already know the programming language, which is AVR C.

If you want a challenge, though, I would expect AVR assembler to be one (from my experience with 80x86 assembler - though that has its own quirks, especially with memory handling in 16 bit mode). But if you are just wanting to get something done and not learn an entirely new language, stick with what you know (AVR C).

:slight_smile:

haha woops just goes to show how much i know about the topic. thanks for the help. so can i use avr studio to write these codes or would i have to use something else to program it with.

the arduino ide passes everything to the gcc compiler as it is, so you can write in both avr c, arduino or a mix

If you are interested in taking control of the build and upload process try this little exercise.

Try to find the parts to build an Arduino sketch from the command line, i.e. run avr-gcc from the command line.

The best place to start is with the C++ (.cpp) file that is built by the Arduino IDE. If the sketch is called foo.pde, the cpp file is called foo.cpp.

Once you figure that out, keep working through until you can upload with avrdude.

With that lot understood, you'll have a clearer view about how Arduino IDE, and AVR Studio, as well as the raw command line tools fit together, and can work. You'll be able to tackle projects like ATtiny's more easily.

It will take a bit of digging around, so do it as a lower priority activity.

HTH
GB

you can even write assembly in Arduino/GCC:

for example a very tiny delay that will NOT be optimized away:

void verysmalldelay(unsigned char loop)
{
for(unsigned char i=0;i<loop;i++)
{
asm("nop");
}
}

I made the jump from Arduino to the Tiny13 / 2313 without too much headache. I found this page which sent me off on a lot of research:

http://www.evilmadscientist.com/article.php/avrstuff

I got a USBtinyISP from Adafruit and was able to get the CrossPack Mac environment up and running pretty easily.

For the Tiny13 specifically, I found this site was really helpful at deciphering the datasheet:

http://avrbasiccode.wikispaces.com

I went the C route, and didn't jump into assembly for this, and was able to get a lot of the basics figured out.

Give it a shot!

I would recommend what you have done to anyone that wants to go the next step into embedded control. Good Work.