Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

Re: [AVR-Chat] C programming on AVR

2008-03-22 by Mike Harrison

On Sat, 22 Mar 2008 11:03:14 -0700, you wrote:

> I recently moved from assembly programming to C for the AVR for
> a project, teaching myself mostly.  It has been torturous, for me
> especially because I'm originally a hardware guy.  Programming
> in assembly over the last 5 years has been straightforward, and
> an easy understanding of the pins and resources of each micro.
> However, the incredibly klugey nature and structure of the C
> compilers and makefile systems to me was and still is horrendous.

I'd have to agree, but this is entirely down to the compiler producers - it doesn't need to be that
hard. 
In most cases, any particular chip will have a set of default settings that will be useable for the
majority of people, at least until they get the hang of things, and a good toolchain will make it
easy to start off a simple project with minimal fiddling. 
 
An example of how  easy this can be is Hi-Tech's PIC C compiler - just do #include <pic.h> and you
can compile & run a project in MPLAB pretty much straight away with no fiddling about. 

IAR's Embedded workbench C for the AVR isn't too bad, as the default linker options are sensible and
easily changed, although th ewhole porject/workspace thing, and default directory structure can be a
bit tedious where all you want is  asimple single source and object file  
Their ARM toolset is another story - I still need to refer to my 'to-do' list every time I start a
new project... I doubt anyone with no example projects to look at could ever get this working with
the JTAG debugger from the docs alone..

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.