Results 1 to 4 of 4

Thread: Need a foothold with atmega2561(cm-510)

  1. Need a foothold with atmega2561(cm-510)

    Well, I suppose I should start from the beginning. I am a senior in high school, aspiring to work in computer science, and about a year ago I had convinced the network/programming teacher at our school to purchase a robot. We quickly located the Bioloid Premium found a grant and voila! It was on our doorstep before you knew it. After a little frustration with the assembly manual I managed to piece together a working type A! SO many cool things it can do... for a day or two. Took it apart, blah blah blah, started working with R+ Task. Very simple, easy to use and worked.. well, kinda. R+ Task wasn't going to cut it, since I had a decent amount of knowledge with C++, I figured I could take on programming it with C no problem, right? Well no, I quickly found out how difficult it was to find even the correct libraries and compiler and gave up. The robot has been shelved up until about a month ago. I am a bit smarter now right? No problem. After a long frustrating night I FINALLY managed to get a hold of WinAVR and WinAVR Studio. Perfect! After reinstalling a few times and changing out of the dreaded (x86) directory it was all working. Even managed to compile the Robotis sample code. So the next day comes along and it is time for round two. After realized how much was involved in this once I downloaded the arbotiX zip with the includes and libraries I decided that the best way for me to get a firm grip on the concepts would be to write my own headers. My own functions, to help me understand what was REALLY going on rather than arbitrarily calling functions. I got a light to blink, all by myself! But now to control it with a button. I know this is getting long and old but here is the main deal. I cannot find enough good documentation to figure out how to set pins/ports to input/output. I have been up literally all night trying to figure it out and have seen at least three methods of doing so.
    DDRC = 0x7F;
    DDRC = 0b00000001;
    Almost every resource I come to assumes knowledge of programming on this platform, of which I do not possess. What I need is some help. A tutorial, or simple website with GOOD documentation. Something that will explain the register addresses and such. Explain simple I/O, I feel that once I can get a grip on the methods/functions used in AVR, such as what they are really doing, and WHY. I think once I have this I can finish. I have searched for a thread to help me, searched the almighty Google, and simply come up sleep deprived. If I have missed something I sincerely apologize. Thank you in advance, I am hellbent on this project.

    Thanks, The Newbie

  2. #2
    Join Date
    May 2008
    Rep Power

    Re: Need a foothold with atmega2561(cm-510)

    You might start with a look at a tutorial that I wrote a while back:

    That should discuss a bit of the AVR architecture, and does use ''how to set ports'' as an example.


  3. #3
    Join Date
    Jun 2009
    Rep Power

    Re: Need a foothold with atmega2561(cm-510)

    We do not really have enough info to go on to help you with your specific problem. What exactly is not working? What does your full code look like?

    Have you read the datasheets for the device? That is always the best place to start.

    Also worth looking through the avr-libc documentation.

  4. Re: Need a foothold with atmega2561(cm-510)

    The code I was using were two things that seemed self explanatory but weren't working properly. Once I return home I can post the full code. Tie particular part is ALWAYS returning true. I mainly need help with setting pins/ports for input/output and reading the values
    if(bit_is_clear(PIND, 0))

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts