AVR c compiler user manual

Discussion in 'Embedded Systems and Microcontrollers' started by mik3, Jun 5, 2009.

  1. mik3

    Thread Starter Senior Member

    Feb 4, 2008
    4,846
    63
    Hi guys,

    Does anyone knows where to find the user manual for the AVR compiler?

    I mean one like the CCS user manual for PICs.
     
  2. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    Mik3,

    It comes with the WINAVR download. You can download WINAVR at www.sourceforge.net.

    hgmjr
     
  3. mik3

    Thread Starter Senior Member

    Feb 4, 2008
    4,846
    63
    I downloaded WinAVR and found the user manual but it is not very good like the CCS manual.

    What is your suggestion about programming AVRs in C?
     
  4. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    Well, the WINAVR C is Kernighan & Ritchie compliant as far as I know.

    With what aspect of C language programming are you most in need of assistance?

    hgmjr
     
  5. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    Is the manual to which you are referring the file avr-libc-user-manual.pdf ?

    hgmjr
     
  6. mik3

    Thread Starter Senior Member

    Feb 4, 2008
    4,846
    63
    Yes it is.
     
  7. mik3

    Thread Starter Senior Member

    Feb 4, 2008
    4,846
    63
    I have never used AVRs and want to learn which software to use to program them with C.

    I made a research and found that programming in Basic might be better.

    What is your opinion?
     
  8. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    I have no experience with programming AVR with BASIC.

    What aspect of C are you looking for help with specifically?

    hgmjr
     
  9. mik3

    Thread Starter Senior Member

    Feb 4, 2008
    4,846
    63
    I am new to AVRs and I want to start playing with them.
     
  10. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    Have you programmed any other microcontrollers using C-language?

    hgmjr
     
  11. mik3

    Thread Starter Senior Member

    Feb 4, 2008
    4,846
    63
    Yes, I program PICs.
     
  12. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    That experience should translate fairly well over to AVR.

    Have you invested in an AVR prototype development board or are you planning to build your own? What AVR device have you selected as your first one to explore?

    hgmjr
     
  13. mik3

    Thread Starter Senior Member

    Feb 4, 2008
    4,846
    63
    No, I don't have a development board. I am planning to make one with a ZIF socket and terminal blocks as to be able to connect anything on it.

    I have bought some ATMEGA8-16PU uCs.
     
  14. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    That's a good way to get started. Have you sketched up a rough schematic of your design? Once you do I will be glad to provide you with any assistance you need in getting your first program up and running.

    What AVR device programming tool have have you selected for use to in-circuit program your AVR?

    hgmjr
     
  15. mik3

    Thread Starter Senior Member

    Feb 4, 2008
    4,846
    63
    I have a programmer which can program both PICs and AVRs and I will use it to program the AVR.

    The problem is not the programming but the code instructions. I don't find the libc user manual very helpful. If you compare it with the CCS manual you will see the difference (CCS is much better and neat).

    Do you think I shall go on with C or use Basic?
     
  16. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    I myself would go with C-language over BASIC simply because I like the power of C. I also like the FREE C-compiler that is WINAVR.

    I suspect that your uneasiness is based on the AVR hardware-specific aspects of C that you will have to become familiar with for the AVR. I can ease you concern somewhat by saying that your experience with PIC will serve you well since you know the general things that must be considered.

    hgmjr
     
  17. mik3

    Thread Starter Senior Member

    Feb 4, 2008
    4,846
    63
    I know the general things but I have to learn the functions how to setup the oscillator, ports, timers etc.

    I will continue my own research over the internet but if you know any useful links please post them here.

    Can you post the general structure of a C program for the AVRs and the basic setup functions?
     
  18. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    As you probably already know, the details of the registers and the meanings of the bits they contain for the various internal features like the timers, ADC, and PWM and others are contained in the datasheet for the AVR device you will be using.

    What would be really neat would be a utility that provided a user-friendly control panel for each of the internal functions. You could then go in and define the operating parameters for the timer and the utility would generate a C-language code script that you could then cut and paste into your source code.

    hgmjr
     
  19. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    Take a look at this program called AVRWIZ. You will need to download .NET 2.0 from www.microsoft.com to get it to work.

    I have just now downloaded it so I don't have any experience using it but it looks interesting.

    hgmjr
     
  20. eblc1388

    Senior Member

    Nov 28, 2008
    1,542
    102
    ATMEGA48/88/168 would be a much better choice.

    ATMEGA8 is old and doesn't has any debugging options available like JTAG or DEBUGWIRE which are available in more modern AVRs.

    Without any debugging facilities, build/testing a large C program could take a lot of time.
     
Loading...