Software for "3 digit LED display, mini DVM module".

Copyright: GPL V2
Author: Guido Socher

Hardware description of the digital voltmeter: 
http://www.tuxgraphics.org/electronics/200706/mini-digital-voltmeter.shtml
How to use this module for other applications:
http://www.tuxgraphics.org/electronics/200903/three-digit-display.shtml

The software is written for AVR GCC and atmega8.

Digital voltmeter
-----------------
Edit the file analog.c and change the VDIV at the beginning
of the file. This is the voltage divider factor (resistors
Rx and Ry). There is a Javascript calculator at the end
of http://www.tuxgraphics.org/electronics/200706/mini-digital-voltmeter.shtml
to calculate VDIV.

If you add an amplifer circuit then you can also measure smaller
signals than 2.56V.

Edit the file main.c and change DP_DIG according to your decimal
point settings. This just defines if leading zeros are stripped or
not. The real decimal point setting is done via jumpers on the board.

For the counter edit file counter.c 

The files custom_formula_example.c and custom_formula_example2.c
show how to implement a completely custom made formula. 
If you want to see how it works then open this file
in a text editor and read the long explanation before the start of the 
main function.

Other applications
------------------
This programmable 3 digit display is very versatile and can be used
for many things.

File counter.c: This is a digital counter
File timer.c:   This is a digital short term timer
File custom_formula_example.c: This shows how you can connect your own
                               analog sensor and implement your own formula
			       to display the values.
File custom_formula_example2.c: Same as above but with a different formula that
                                may produce also negative values
Sub-directory therm: A calibrated digital thermometer

Directory hw
------------
The directory hw contains circuit diagrams showing how to connect
sensors/buttons/... etc to the circuit.

Compile:
--------
A Makefile is included.

To compile use the command:
make 

This will compile all software except for the digital thermometer.
The digital thermometer is in the subdirectory therm and has its own
Makefile.

Change the fuse bytes to 8MHz internal clock:
make fuse 

 or run the command:
   avrdude -p m8 -c avrusb500 -u -v -U lfuse:w:0xe4:m

The fuses are then set as follows:
 lfuse reads as E4
 hfuse reads as D9

Finally load the file main.hex into the microcontroller:
make load

The above command loads the DVM (voltmeter) software.

The command
make load_counter

Would load the counter software.

The command
make load_timer

Would load the timer software.

The command 
make load_custom_formula_example

Would load the code with a custom formula.

It is important to change the fuses settings as shown above 
when you use the timer. To read the current fuse settings use:
make rdfuse

-------------------------------------------
History:
version 0.1: 2007-06-18, first Version
version 0.2: 2008-09-10, small correction by RWCooper divide voltage
                         by 10 if one digit behind decimal point is used.
                         Sorry for the long time it took to update this :-(.
version 0.3: 2009-01-13, Average results over two periods
                         Clean-up Makefile
version 0.4: 2009-03-02, Update display faster in case of big changes in value
                         Added counter software.
version 0.5: 2009-05-07, Added timer function.
version 0.6: 2009-05-16, Added photoelectric light barrier 
version 0.7: 2009-06-18, Added custom_formula_example
version 0.8: 2009-07-11, Added custom_formula_example2
version 0.9: 2009-08-03, Added ds18s20 thermometer, in subdirectory therm
-------------------------------------------
Written by guido socher <guido at tuxgraphics.org>
-------------------------------------------