Probleme beim ansteuern eines LCD TC1602A-09 + ATMEGA8

Gast #1574850
Also, ich hab hier ein LCD 16*2 und einen ATMEGA 8.
Include verwende ich Peter Fleury's "lcd.h".
Und habe ich die nötigen Einstellungen laut: 
http://www.rn-wissen.de/index.php/LCD-Modul_am_AVR vorgenommen.
Das Ganze soll natürlich im 4-Bit Modus laufen. Bis jetzt bekomme ich 
aber nur 8 Punkte zu sehen. Verkabelt ist, dass ganze wie in dem 
angehängtem Bild. Port ist wirklich PORTC. Die freien Datenleitungen die 
sich im 4-Bit Modus ergeben habe ich nicht auf Masse liegen, oder ist 
das das Problem?
1
/** 
2
 *  @name  Definitions for MCU Clock Frequency
3
 *  Adapt the MCU clock frequency in Hz to your target. 
4
 */
5
#define XTAL 8000000              /**< clock frequency in Hz, used to calculate delay timer */
6

7

8
/**
9
 * @name  Definition for LCD controller type
10
 * Use 0 for HD44780 controller, change to 1 for displays with KS0073 controller.
11
 */
12
#define LCD_CONTROLLER_KS0073 0  /**< Use 0 for HD44780 controller, 1 for KS0073 controller */
13

14
/** 
15
 *  @name  Definitions for Display Size 
16
 *  Change these definitions to adapt setting to your display
17
 */
18
#define LCD_LINES          2    /**< number of visible lines of the display */
19
#define LCD_DISP_LENGTH    16     /**< visibles characters per line of the display */
20
#define LCD_LINE_LENGTH  0x40     /**< internal line length of the display    */
21
#define LCD_START_LINE1  0x00     /**< DDRAM address of first char of line 1 */
22
#define LCD_START_LINE2  0x40     /**< DDRAM address of first char of line 2 */
23
#define LCD_START_LINE3  0x14     /**< DDRAM address of first char of line 3 */
24
#define LCD_START_LINE4  0x54     /**< DDRAM address of first char of line 4 */
25
#define LCD_WRAP_LINES      0     /**< 0: no wrap, 1: wrap at end of visibile line */
26

27
#define LCD_IO_MODE      1         /**< 0: memory mapped mode, 1: IO port mode */
28
#if LCD_IO_MODE
29
/**
30
 *  @name Definitions for 4-bit IO mode
31
 *  Change LCD_PORT if you want to use a different port for the LCD pins.
32
 *
33
 *  The four LCD data lines and the three control lines RS, RW, E can be on the 
34
 *  same port or on different ports. 
35
 *  Change LCD_RS_PORT, LCD_RW_PORT, LCD_E_PORT if you want the control lines on
36
 *  different ports. 
37
 *
38
 *  Normally the four data lines should be mapped to bit 0..3 on one port, but it
39
 *  is possible to connect these data lines in different order or even on different
40
 *  ports by adapting the LCD_DATAx_PORT and LCD_DATAx_PIN definitions.
41
 *  
42
 */
43
#define LCD_PORT         PORTC        /**< port for the LCD lines   */
44
#define LCD_DATA0_PORT   LCD_PORT     /**< port for 4bit data bit 0 */
45
#define LCD_DATA1_PORT   LCD_PORT     /**< port for 4bit data bit 1 */
46
#define LCD_DATA2_PORT   LCD_PORT     /**< port for 4bit data bit 2 */
47
#define LCD_DATA3_PORT   LCD_PORT     /**< port for 4bit data bit 3 */
48
#define LCD_DATA0_PIN    4            /**< pin for 4bit data bit 0  */
49
#define LCD_DATA1_PIN    5            /**< pin for 4bit data bit 1  */
50
#define LCD_DATA2_PIN    6            /**< pin for 4bit data bit 2  */
51
#define LCD_DATA3_PIN    7            /**< pin for 4bit data bit 3  */
52
#define LCD_RS_PORT      LCD_PORT     /**< port for RS line         */
53
#define LCD_RS_PIN       3            /**< pin  for RS line         */
54
#define LCD_RW_PORT      LCD_PORT     /**< port for RW line         */
55
#define LCD_RW_PIN       2            /**< pin  for RW line         */
56
#define LCD_E_PORT       LCD_PORT     /**< port for Enable line     */
57
#define LCD_E_PIN        1            /**< pin  for Enable line     */
58
...


Hier sieht man mein "Programm"
1
#include <avr/io.h>
2
#include <stdint.h>
3
#include <lcd.h>
4

5
DDRC = 0xff;
6

7
int main(void)
8
{
9
   while(1) 
10
   {
11
    /* Initialisiere Display, Cursor aus */
12
    lcd_init(LCD_DISP_ON);
13

14
    /* loesche das LCD Display und Cursor auf 1 Zeile, 1 Spalte */
15
    lcd_clrscr();
16
        
17
    /* String auf Display anzeigen */
18
    lcd_puts("Hello world.");
19

20
   }   
21
}

Ich bekomme gar nichts (bis auf die 8 Blöcke). Es flakert nicht ein 
mal:(.
Kann mir wer weiter helfen?

MFG
Angehängte Dateien:
Gast #1580581
Andere Sache.

Ich arbeite ja mit der Fleury Include. Auf dem Display würde ich gern 
eine Float- Zahl (Gleitkomma) darstellen. Wie gehe ich das an?
Es gibt zwar die Funktion "lcd_puts()", aber die Funktion akzeptiert nur 
Strings.....
Gast #1580583
Das Display ist wahrscheinlich nicht defekt. Es ist entweder falsch 
initialisiert worden oder hat eine ungewöhnliche Anordnung im 
Display-RAM!

Gib einfach mal weiter Zeichen aus. Vielleicht erscheinen sie ja 
iregendwann in der Anzeige.

Antwort schreiben

Eine eigene Frage? Dieser Thread ist über 16 Jahre alt. Stell sie in einem eigenen Thread – dort lesen mehr Leute mit, und sie wird öfter und schneller beantwortet.

Neuen Thread starten

Eine Lösung, Ergänzung oder Rückmeldung zu diesem Thread? Dann antworte hier.

Formatierung
  • [c]C-Code[/c]
  • [code]Code in anderen Sprachen, ASCII-Zeichnungen[/code]
  • [math]Formel in LaTeX-Syntax[/math]
  • [[Titel]] – Link zu einem Artikel
  • Verweis auf einen anderen Beitrag: Rechtsklick auf dessen Beitrags-ID (#8078628), „Adresse kopieren“, in den Text einfügen

Mehr zur Formatierung

Längeren Sourcecode als Anhang, nicht in den Text. JPG nur für Fotos und Scans; Zeichnungen und Screenshots als PNG oder GIF. Siehe Bildformate.

Schon registriert? Anmelden

Wird nicht angezeigt. Wir schicken dir einen Link; sobald du damit bestätigst, erscheint dein Beitrag.

Mit dem Abschicken legst du einen kostenlosen Account an und erkennst die Nutzungsbedingungen und die Datenschutzerklärung an.