AVR-mUPI
v1.2
A unified application programming interface for megaAVR devices.
|
AVR-mUPI comes with a set of application examples that can be found in the doc/examples subdirectory of the <tarball_dir> directory (see How to install AVR-mUPI? for details on this subdirectory). They illustrate how to use the AVR-mUPI interfaces, from simple single-file programs to more elaborated examples involving the definition and use of a code library.
Here is the complete list of examples provided:
Each example is presented in a dedicated page, providing a short description, the list of applicable mcu devices, the necessary hardware platform configuration to execute it, the source files location and their contents.
AVR-mUPI is distributed with all the examples already precompiled and ready to be used, assuming a system clock of 8 MHz. If you wish to modify some of the examples or use another system clock frequency, this section describes the necessary steps to be executed in order to recompile them.
Execute the following actions using a Linux/Bash environment in order to recompile the examples:
$ cd <tarball_dir>/doc/examples/library
$ make all MCU=<mcu>The library file will be named libexample.a and will be located in the lib/$(MCU) subdirectory of the library folder. All intermediate compilation files will be located in the lib/$(MCU)/obj subdirectory. Repeat this step for all desired MCU values.
$ cd <tarball_dir>/doc/examples
$ make all EXAMPLE=<example> MCU=<mcu> F_CPU=<f_cpu>The executable file will be named firmware.hex and will be located in the bin/$(MCU) subdirectory of the example folder. All intermediate compilation files will be located in the bin/$(MCU)/obj subdirectory. Repeat this step for all desired combinations of EXAMPLE and MCU values.
The following lines show how to build example 2 for an ATmega8 clocked at 11.0592 MHz and example 3 for an ATmega8535 clocked at 16 MHz.
$ cd <tarball_dir>/doc/examples/library $ make all MCU=atmega8 $ make all MCU=atmega8535 $ cd <tarball_dir>/doc/examples $ make all EXAMPLE=2 MCU=atmega8 F_CPU=11059200 $ make all EXAMPLE=3 MCU=atmega8535 F_CPU=16000000
The files firmware.hex, generated in the previous example, can be found in the doc/examples/example_2/bin/atmega8 and doc/examples/example_3/bin/atmega8535 folders respectively.