1. mik3

    Thread Starter Senior Member

    Feb 4, 2008
    4,846
    63
    Is that really the AVR C library (which tells us all the commands used in C to program AVR's) that i have in the attachment?
     
  2. RiJoRI

    Well-Known Member

    Aug 15, 2007
    536
    26
    Looks like it, except that it's 4 years old, according to the line at the bottom of the pages.

    --Rich
     
  3. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    Mik3,

    You have the right manual. I have the same manual at Release 1.6.0.

    You can go to www.sourceforge.net and get the latest version of WINAVR (FREE) and get a new manual along with it.

    hgmjr
     
  4. mik3

    Thread Starter Senior Member

    Feb 4, 2008
    4,846
    63
    Where did you find the manual hgmjr?
     
  5. mik3

    Thread Starter Senior Member

    Feb 4, 2008
    4,846
    63
    I found version 1.6 on the internet. Microchip has a much much better C reference manual compared to Atmel's. I asked an experienced electronic engineer which microcontrollers are the best and he told me that AVR's and PIC's are the most popular with more or less the same performance but AVR's are more 'friendly' to the user. Now i starting to doubt this because Microchip it seems better on the information side. What do you think guys? I am currently using PICs, should i go on with them or start using AVRs or both?
     
  6. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    I have no experience with PIC so I can only speak to the AVR devices. I have never found any shortcomings in the AVR's performance or the performance of the free tools available to develop programs.

    In the end, the only way to find out which one fits your applications best is to familiarize yourself with both and make the decision based on experience with both.

    hgmjr
     
  7. mik3

    Thread Starter Senior Member

    Feb 4, 2008
    4,846
    63
    Yes, sure but as a starting point i see that microchip is better on documentation than atmel. Compare their reference manual to see which one is better, in my opinion this is important because it makes your life easier. Maybe later i will change my mind!
     
  8. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    It sounds like you have had very good experience with PICs. If PIC is getting the job done for you then there is little reason to jump ship to anything else.

    Since you are not programming your PIC using Assembly Language, then I don't blame you for staying with the PIC. I program in C as well as Assembly and I have grown very comfortable with the low level programmability of the AVR family of microcontrollers.

    hgmjr
     
  9. AlexR

    Well-Known Member

    Jan 16, 2008
    735
    54
    The functions and instructions available in any implementation of C for microcontrollers are dependant on the C compiler rather than and the make of device that the compiler is aimed at.
    The PIC C reference manual you cite is produced by CCS software not Microchip. Its quite a good implementation of C but it is third party software and if you want to use it you will have to pay for it, it's not free! In fact that is one of the short comings of Microchip, their free C complier is somewhat limited and to get anything half decent you need to shell out bucks. AVR on the other hand comes with an open source C compiler that is 100% free. It may not have all the bells and whistles of commercial C compilers but it does everything that you need it to do.
     
  10. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    Good point, Alexr!

    hgmjr
     
  11. mik3

    Thread Starter Senior Member

    Feb 4, 2008
    4,846
    63
    Alex,
    I have all the necessary software I need to work with PIC's and I work with it but i am interested in learning AVR's too. If you know a good source where i can learn them in C language i would like you to tell me it.

    Hgmjr,
    I know C is easier than assembly but do you think that with assembly you can do more efficient designs?
     
  12. AlexR

    Well-Known Member

    Jan 16, 2008
    735
    54
    Basically if you can write C code for the PIC you can write it for the AVR. All you need to do is study the data sheets to get familiar with the different names they call the SFRs. Of course you will need familiarise yourself with the library functions and any quirks of your C compiler but as I said before that is a property of the compiler rather than the target device. Even different makes of C compilers for the PIC will have different library functions and slightly different ways of doing things.

    A good source of AVR information and tutorials is AVR Freaks. http://www.avrfreaks.net/
    Go to the "Articles" tab.

    You can get AVR Studio (which is the Amtel IDE much like Microchip's MPLAB) from:
    http://www.atmel.com/dyn/Products/tools_card.asp?tool_id=2725.

    A windows version of GCC compiler tailored for the AVR along with assorted other software tools can be had at:
    http://sourceforge.net/projects/winavr/.

    If you are after a commercial C compiler with features similar to the CCS PIC product and at a simalar price, take a look here:
    http://www.hpinfotech.ro/index.html
     
  13. mik3

    Thread Starter Senior Member

    Feb 4, 2008
    4,846
    63
    Thanks a lot Alex.
     
  14. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    As you probably suspect, the choice of programming language is dictated largely by the task being performed by the microcontroller.

    If the demands of the design is to squeeze as much code into the finite program memory as possible and sqeeze the maximum performance in terms of execution speed out of the microcontroller then Assembly Language is a good choice. The penalty to Assembly Language programming is the added complexity and need for careful bookkeeping regarding where program constants and variable are stored. This is eased somewhat in both the AVR and the PIC by the large number of registers that are available in each.

    I use assembly language mainly when I am designing with one of the very small AVR micros since program memory and ram are both limited in these smaller devices.

    One thing I have found is that by programming in Assembly, I have developed a better sense of the AVRs power. It has allowed me to look at compiled C code listings and diagnose problems in the way the C compiler has translated my C statement into its equivalent assembly language instructions. This can be a real handy skill to have.

    I have not been called upon to use the feature but you can embed Assembly Language inline with your C-code. Exploiting this feature is not for the faint of heart however. The PIC C compiler is capable of this also.

    hgmjr
     
  15. mik3

    Thread Starter Senior Member

    Feb 4, 2008
    4,846
    63
    Thanks for your time Hgmjr
     
Loading...