Menu

Tree [1685c9] master /
 History

HTTPS access


File Date Author Commit
 include 2013-02-25 Michal Gawlik Michal Gawlik [198937] Use PROGMEM in new way (fix for avr-libc-1.8)
 lib 2008-03-25 mjg mjg [af99ef] initial commit with first public version
 src 2013-02-25 Michal Gawlik Michal Gawlik [1685c9] Remove unused variable
 .gitignore 2008-03-25 mjg mjg [af99ef] initial commit with first public version
 CHANGES 2009-03-13 mjg mjg [ec73a8] prepare readme, changes and licence for 0.0.3 r...
 LICENSE 2009-03-13 mjg mjg [ec73a8] prepare readme, changes and licence for 0.0.3 r...
 Makefile 2008-03-28 mjg mjg [30a4fa] libdeps feature works under Windows, thanks to ...
 README 2009-03-13 mjg mjg [ec73a8] prepare readme, changes and licence for 0.0.3 r...
 TODO 2008-03-28 mjg mjg [b13590] prepare CASEFILES for 0.0.2 preview release
 devices_config_template.h 2010-10-17 mjg mjg [2f61aa] some macros for ANSI terminal escape codes
 libdeps.sh 2009-03-13 mjg mjg [660f7a] fixed white-spaces handling in paths to library...

Read Me

#################### davrlibs preview release 0.0.3 README ####################

1. Overview

Davrlibs is set of libraries, written mainly in C language, for doing common
tasks in embedded systems development using Atmel AVR MCUs. It has been written
by Michal Gawlik <manveru@post.pl> and released under terms of the BSD license
(see LICENSE file).

Currently it consists of:
- 1-wire - Dallas-Maxim 1-Wire bus (currently, only DS18B20 digital
  thermometers are supported)
- bootloader-host and bootloader-target - AVR bootloader support, compatible
  with Butterfly bootloader (AVR109)
- common-func - common functions, like various optimized implementations of
  myitoa(), reset(), nop(), etc.
- dds - library for handling DDS (Direct Digital Synthesis) chips. Currently
  only Analog Devices AD9833 is supported.
- lcd-hd44780 - driver for character LCDs based on Hitachi HD44780
- lcd-t6963c - driver for graphic LCDs based on Toshiba T6963C
- spi - driver for Atmel SPI interface
- uart - driver for on-chip AVR UART

IMPORTANT:
This software should be considered as an alpha pre-release, provided "AS-IS".
Although existing API is quite stable and usable, it can be changed in near
future releases without earlier warnings.


2. Requirements

- avr-gcc 4.2 or 4.3 (might work with elder versions, but it is untested)
- avr-libc 1.6 (not tested with 1.4, but should work)
- avrdude (if you want using simple "make upload" command to flash device)
- some standard Unix tools like sed, grep, gawk, etc.
OR
- WinAVR toolchain (tested with version 20081205)


3. Instalation

Just download sources and unpack them into your projects directory. It should
look something like this:

avr-projects/davrlibs/include
avr-projects/davrlibs/lib
avr-projects/davrlibs/src
avr-projects/davrlibs-skel
avr-projects/your-project-1
avr-projects/your-project-2
avr-projects/your-project-3

Then go to davrlibs directory and issue "make depend" and "make" commands to
be sure if it compiles cleanly, without errors nor warnings.

If you like risk, perhaps you should consider using development SVN version.
But be warned, it could be VERY broken from time to time.


4. Using davrlibs

a) Idea
The idea behind directory organisation is to provide one library instance, in
source form, for several independent user projects. Library is recompiled when
needed, eg. when projects uses different hardware configurations or CPU clock
speed. Recompilation is done automagically by Makefiles, you don't even need to
think about it.

b) Creating new project
Copy directory "davrlibs-skel" and name it as you like, eg. "my project". Then
edit some files:

- davrlibs_devices_config.h - contains sample hardware configuration template.
  Should be customized to fit your project.
- Makefile - contains definitions of target MCU and it's clock speed, list of
  source files of your project, programmer settings, library paths, etc. Most
  of those variables are documented in comments. And, happily, in common dayily
  usage, you should not need to change many of them. Most needed settings are
  placed at the beginning of the Makefile.
- main.c - simple hello world app, provided as a simple example. Replace it
  with your own code.

c) Adding library to user project
Primo, include library header file (you will find them in include/davrlibs dir)
in your source file, eg. "#include <davrlibs/uart.h>". Secundo, edit Makefile
and add library to LIBS variable, eg. "-luart". Tertio, edit library hardware
configuration file and provide valid configuration, eg. uart baudrate, frame
format, etc (see template configuration file for examples). And thats all, now
you should be able to use library functions.

d) Adding new source file to your project
Create new file and add it's name to SRC variable in Makefile. When adding new
file, or changing "#include" directives, remember to use "make depend" command
to ensure that Makefile has good description of dependencies between files in
your project, and recompiles only what is really needed.

e) Compiling your project
Issue "make" command in your project directory. It checks if last library
compilation is valid for current project, and if not, it recompiles needed
libraries. Then it compiles your project, prepares programming files, etc.
If you use avrdude uploader and have defined needed programming settings in
Makefile, you could use "make upload" to build project and write it to flash
memory of target device (eeprom is programmed only if needed, of course).
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.