8x1 programmable LCD, ADC example and LCD test code
This is the software for the tuxgraphics 8x1 LCD display module
See http://tuxgraphics.org/electronics/
Copyright of most software and all diagrams: Guido Socher
License for everything: BSD style (You can use the code
in commercial project without contributing any of your
code back to the code base. You are however very welcome
to voluntarily send any contributions back to me via
email guidosocher (at) fastmail.fm )
---------------------------------------------------------------------------
All parts needed to build this display can be ordered from
http://shop.tuxgraphics.org/
Compiling the software
Mac or Linux:
-------------
The makefile has a built-in help function. Type
make help
to read the help text.
To compile all programs under Linux or on a Mac:
make
Windows:
--------
Please use the provided Makefile !!!
It will also work under Windows.
Take a look at the supplied winmake.bat and winload.bat file. Edit the
bat file and make any necessary adjustments to the PATH variable. Point
it to your installation of the avr tool chain.
Just double click the winmake.bat script in the windows file manager
to run it.
Loading the .hex file into the atmega328p microcontroller
You can use any suitable AVR programmer to load the .hex file generated
during compilation. Follow the instructions of your programmer to
load the file.
The makefile contains some short-cuts to make it easy to load the hex
file if you have an avrusb500 programmer from tuxgraphics:
The makefile is prepared to allow you to load the software by just
typing:
make load_[the name of the program]
examples:
make load_main
make load_test_lcd
In order to use the above make command you have to first edit
the makefile and possibly adapt the serial port number. Open the makefile
in an editor and edit the section at the beginning of the file.
Edit the avrdude command definition:
# linux (plug in the avrusb500 and type dmesg to see which device it is):
LOADCMD=avrdude -P /dev/ttyUSB0
# mac (plug in the programmer and use ls /dev/tty.usbserial* to get the name):
LOADCMD=avrdude -P /dev/tty.usbserial-A9006MOb
# windows (check which com-port you get when you plug in the avrusb500):
LOADCMD=avrdude -P COM4
More information about Makefiles can be found at:
http://tuxgraphics.org/electronics/200912/makefiles.shtml
Note: windows users may use and modify the supplied winmake.bat to setup the
environment correctly.
The main.c program, demo on how to measure analog voltages
main.c is a very short and easy to understand example of how to
read the analog to digital converters (input pins ADC0 and ADC1) and
display the raw values (no conversion into volts). The display
will show 0 for 0 volts and 4092 for 1.1V at the ADC pins.
You can change the software and multiply or divide the plain
readings from the ADC.
It could be used to show e.g pressure sensor values in Pa or
voltage in Volt.
The test_lcd.c program, demo showin a text in the display
test_lcd.c is a very simple program that displays the words
"OK" and "great" in the display. You can load this to test
your hardware after assembly.
--------------------------------------------------------------------------
Revision history
2014-12-01: version 1.0 -- first version
# vim:sw=8:ts=8:si:et