Pages: [1]   Go Down
Author Topic: Assembly or GCC?  (Read 558 times)
0 Members and 1 Guest are viewing this topic.
United States, PA
Offline Offline
Jr. Member
**
Karma: 0
Posts: 55
Loading...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Phoenix, Arizona USA
Offline Offline
Faraday Member
**
Karma: 36
Posts: 5519
Where's the beer?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

 smiley
Logged

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

United States, PA
Offline Offline
Jr. Member
**
Karma: 0
Posts: 55
Loading...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

SE USA
Offline Offline
Faraday Member
**
Karma: 40
Posts: 3783
@ssh0le
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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


UK
Offline Offline
God Member
*****
Karma: 0
Posts: 710
Arduino is Genius
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 132
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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");
    }
}
Logged

U of A, Tucson, AZ
Offline Offline
Full Member
***
Karma: 0
Posts: 164
Hello World
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!
Logged

Cumming, GA
Offline Offline
Edison Member
*
Karma: 18
Posts: 1627
Ultimate DIY: Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Pages: [1]   Go Up
Jump to: