This is an old revision of the document!


Alphanumerisches LCD Display

Das LCD wird eingesetzt um dem Nutzer Informationen anzuzeigen. Das Home-Lab ist mit einem standard 2×16 alphanumerischen HD44780-gesteuerten LCD (datasheet) ausgestattet. Die folgenden Beispiele betreiben das LCD im 4-Bit Modus. Die Data Bits des LCD sind an PORT-A angeschlossen. Das LCD kann direkt an das Study Board angeschlossen werden (ab Version 3) oder mithilfe eines Verbindungskabels (alle Versionen).

2×16 LCD mit Hintergrundbeleuchtung verbunden mit dem Study Board v.3.1:

1×16 LCD ohne Hintergrundbeleuchtung verbunden mit dem Study Board v.2.2 via Verbindungskabel:

Studyboard v2.2

Beide Verbindungsarten sind identisch mit dem AVR verbunden. Both connection types have electrically identical connection to AVR.

lcd_schema.jpg

Example code here uses Peter Fleury LCD driver (see the external link below).

Header files

Example

#include <stdlib.h>
#include <avr/io.h>
#include <avr/pgmspace.h>
 
#include "lcd.h"
 
/*PS for Distance Lab use:
#include <util/lcd.h>
#include <util/lcd.c>
*/
 
int main(void)
{
	// Initialize display, cursor off
	lcd_init(LCD_DISP_ON);
 
	// Clear display and home cursor
	lcd_clrscr();
 
	// Put string to display (line 1) with linefeed
	lcd_puts("LCD Test Line 1\n");
}

Graphical displays

It is also possible to use low cost graphical LCD with AVR. Cheap way is to use old mobile phone LCD which can be found almost in every home.

Following example uses Nokia 3310/5110 Graphical 84×84 LCD. The initial driver is written by Tony Myatt, 2007.

de/examples/digi/lcd.1240842901.txt.gz · Last modified: 2020/07/20 09:00 (external edit)
CC Attribution-Share Alike 4.0 International
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0