Since the instruction set of AVR highly corresponds to the C Language,
I choose
AVR-GCC
, the GNU C Compiler for AVR, to compile my programs for its characteristic of free software
and high compiling efficiency. In addition, GCC also supports other structures such as ARM,
DSP, and X86; therefore, learning AVR-GCC lays the foundation for studying the usage of
other devices afterwards.
Because AVR-GCC is not released with any integrated
development environment (IDE), I pick a third-party IDE called
Win-AVR
to develop software.
Due to the property of my driver programs, the user code should
be written in a foreground-background processing structure; thus, an endless loop should
serves as the stem of the program – the background – while the interrupt routines – the
foreground – provide the data from hardware modules.
The driver provides standard C
Language functions to control hardware modules including I2C, USART, ADC, timer/counter (T/C)
, etc. as well as peripheral devices such as digital compass, DC motors, LCD, etc. It also
gives users the right to monitor all ADC ports after initializing hardware resources and
before running user code.