                  SPI LCD Demo Firmware For Use With LCDproc

-- INTRODUCTION --------------------------------------------------------------

This firmware package demonstrates how to use a LCD with SPI (Serial
Peripheral Interface). It it designed to work with a VLGEM1021-03 display
and additionally includes support for a rotary encoder.

It uses the following libraries and code:

* Peter Fleury's UART library
  (http://jump.to/fleury)
* Hubert Gschwandtner SPI LCD library
  (http://www.schorsch.at/en/technical/microcontroller/25-lcd-vlgem-1021-03.html)
* Peter Dannegger's rotary encoder solution
  (http://www.mikrocontroller.net/articles/Drehgeber) (German only)

-- HARDWARE ------------------------------------------------------------------

The software is designed to work with an ATmega8 used on the myAVR Board light
(shop.myavr.com) running at 3.6864 MHz.

Running the ATmega8 at a different speed should work as well. Edit the
Makefile and adjust -DF_CPU=3686400UL to match your crystal's speed.

Using an ATmega48/88/168/328 should work, too, as they are pin and feature
compatible. Adjust the Makefile accordingly. Running any other AVR will
likely require editing of the timer code in rotary.c.

The VLGEM1021-03 has to be connected like this:

LCD PIN | AVR PIN (x means not connected)
      1 = x
      2 = x
      3 = PB3 (MOSI)
      4 = x
      5 = PB5 (SCK)
      6 = GND
      7 = PB4 (MISO)
      8 = VCC (+5V)
      9 = PB2 (SS) or GND
     10 = V0 (contrast)

The rotary encoder code is designed to work with an Panasonic EVEQ encoder
(available e.g. from www.pollin.de). Connect the rotary encoder like this
(the common pins of the encoder are to be connected to ground):

Key     = PC0
Phase A = PC1
Phase B = PC2

You may change the ports and pins used by editing rotary.c. Depending on the
encoder used one of the other 'encode_readX' functions may have to be used.

-- COMPILING -----------------------------------------------------------------

Just change into the default/ sub-directory and run 'make' or 'gmake' (GNU
make is required).

-- USE WITH LCDPROC ----------------------------------------------------------

A sample configuration file (extras/LCDd.myLoS.conf) is provided that shows
the key configurations necessary. Edit this file to match your serial device!

A patch for LCDproc (extras/patch-menu-rotary.diff) is required to add a
'back' entry to each menu. Otherwise you can enter any menu, but never leave
it!

Applying the second patch (extras/patch-hd44780-serial.diff) adds escape
character suppport to the hd44780/serial connection type.

-- LICENSE -------------------------------------------------------------------

This software uses existing code with several different licenses:

myLoS.c     GPLv2 or later
uart.c      GPLv2 or later
lcd.c       None given, but I assume GPLv2 or later
rotary.c    CC-BY-SA

# EOF #
