KS0108 Atmega16/32 - nur streifen

Gast #2435733
Lesenswert?

Hallo Forum,

ich versuche momentan ein KS0108 (GDM12864HLCM) zum laufen zu bekommen.
Leider bekomme ich nur streifen auf dem Display.


Ich habe mir die Bibliotheken von Fabian Maximilian Thiele herunter 
geladen
und diesen Testcode auf den uC gebrannt.

Die Taktfrequenz beträgt 8Mhz. Die Übertragungsleitungen sind <1m.
An was kann es liegen dass ich kein Bild, bzw. den entsprechenden Text 
bekommen.

Das Header File habe ich ensprechend angepasst. Die Kommandos kommen bei 
mir über PORTA die Daten über PORTC.
1
/*
2
 * Copyright:      Fabian Maximilian Thiele  mailto:me@apetech.de
3
 * Author:         Fabian Maximilian Thiele
4
 * Remarks:        this Copyright must be included
5
 * known Problems: none
6
 * Version:        1.1
7
 * Description:    KS0108 Library Demo Program 
8
 * 
9
 */
10

11
#include <inttypes.h>
12
#include <avr/io.h>
13
#include <avr/pgmspace.h>
14

15
#include "ks0108.h"
16
#include "arial_bold_14.h"
17
#include "SC.h"
18
#include "Bitmap.h"
19

20

21
int main(void) {
22
  
23
  // Wait a little while the display starts up
24
  for(volatile uint16_t i=0; i<15000; i++);
25
  
26
  // Initialize the LCD
27
  ks0108Init(0);
28
  
29
  // Select a font
30
  //ks0108SelectFont(Arial_Bold_14, ks0108ReadFontData, BLACK);
31
  // Set a position
32
  //ks0108GotoXY(15,10);
33
  // Print some text
34
  //ks0108Puts_P(PSTR("test"));
35
  // a nice little round rect
36
  //ks0108DrawRoundRect(5, 5, 117, 20, 8, BLACK);
37

38
  // Once again :)
39
  // Select a font
40
  //ks0108SelectFont(SC, ks0108ReadFontData, BLACK);
41
  // Set a position
42
  //ks0108GotoXY(5,30);
43
  // Print some text
44
  //ks0108Puts("test");
45
        // ks0108DrawLine(0, 0, 100, 50, BLACK);
46
  //ks0108DrawCircle(50, 40, 20, BLACK);
47
  ks0108ClearScreen();
48
  LoadBitmap(IMAGE);
49
  while(1);
50
}
1
//************************************************************************
2
// Bitmap.C
3
//************************************************************************
4
#include <avr/pgmspace.h>
5
#include "Bitmap.h"
6
#include "ks0108.h"
7
//##########################################################
8
void LoadBitmap(unsigned char *bitmap)
9
{
10
uint16_t i, j,by;
11
for(i=0; i<64; i+=8)
12

13
    for(j=0; j<128; j++)
14
    {
15
      by=pgm_read_byte(bitmap++);
16
      ks0108GotoXY(j, i);
17
      ks0108WriteData(by);
18
    }
19

20
}
http://www.mikrocontroller.net/articles/KS0108_Library

Kann mir jemand weiter helfen oder einen Tipp geben?

Vielen Dank
Grüße
Gast #2435750
Lesenswert?

"<1m" Leitungen zwischen µC und LCD ist schon heftig. Ist bei so langen 
Leitungen ein fliegender Aufbau im Spiel? Kann es sein, dass Leitungen 
Kontakt verloren haben?

>  // Wait a little while the display starts up
>  for(volatile uint16_t i=0; i<15000; i++);

Vergiss Sourcecode oder Tutorials in denen das noch verwendet wird, um 
Warteschleifen zu machen. Schau dir die Artikelsammlung an.

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren