Graphic LCD, 128*64, verwischt

hallo leute

versuche jetzt seit etwa 2 tagen mein schönes Graphic LCD, 128*64 zum laufen zu bringen.

verbungen habe ich das lcd sicher schon 10 mal !! Arduino 168 <--> pinout B
wie es hier beschrieben ist : Arduino Playground - GLCDks0108

auf dem lcd kann ich zahlen erkennen, bekomme aber kein klares bild.

meine config :

board: arduino uno
lcd : http://microvga.com/PG12864K

///////////////////////////////////
config files
file : test code
//////////////////////////////////

#include <ArduinoIcon.h>
//#include <Arial14.h>
#include <ks0108.h>
#include <ks0108_Arduino.h>
#include <SystemFont5x7.h>

unsigned long startMillis;
unsigned int iter = 0;

void setup(){

  GLCD.Init(NON_INVERTED);   // initialise the library
  GLCD.ClearScreen();  
  GLCD.DrawBitmap(ArduinoIcon, 32,0, BLACK); //draw the bitmap at the given x,y position
  delay(4000);
  GLCD.ClearScreen();
  GLCD.SelectFont(System5x7);       // select fixed width system font 

}

void loop(){ // run over and over again

  startMillis = millis();
  while( millis() - startMillis < 1000){ // loop for one second
    GLCD.DrawRect(0, 0, 64, 61, BLACK); // rectangle in left side of screen
    GLCD.DrawRoundRect(68, 0, 58, 61, 5, BLACK);  // rounded rectangle around text area   
    for(int i=0; i < 62; i += 4)
      GLCD.DrawLine(1,1,63,i, BLACK);  // draw lines from upper left down right side of rectangle  
    GLCD.DrawCircle(32,31,30,BLACK);   // draw circle centered in the left side of screen  
    GLCD.FillRect(92,40,16,16, WHITE); // clear previous spinner position  
    GLCD.CursorTo(5,5);               // locate curser for printing text
    GLCD.PrintNumber(++iter);         // print current iteration at the current cursor position 
  } 
  // display number of iterations in one second
  GLCD.ClearScreen();               // clear the screen  
  GLCD.CursorTo(13,2);              // positon cursor  
  GLCD.Puts("FPS= ");               // print a text string  
  GLCD.PrintNumber(iter);           // print a number 
}

///////////////////////////
lib file
file : ks0108_Arduino.h
//////////////////////////

/*
  ks0108_Arduino.h - Arduino library support for ks0108 and compatable graphic LCDs
  Copyright (c)2008 Michael Margolis All right reserved

  This is the configuration file for mapping Arduino (ATmega168) pins to the ks0108 Graphics LCD library

*/

#ifndef      KS0108_CONFIG_H
#define KS0108_CONFIG_H

/*********************************************************/
/*  Configuration for assigning LCD bits to Arduino Pins */
/*********************************************************/
/* Arduino pins used for Commands
 * default assignment uses the first five analog pins
 */

#define CSEL1                        14            // CS1 Bit   // swap pin assignments with CSEL2 if left/right image is reversed
#define CSEL2                        15            // CS2 Bit

#define R_W                              16            // R/W Bit
#define D_I                              17            // D/I Bit 
#define EN                              18            // EN Bit
//#define RES                         19            // Reset Bit  // uncomment this to contol LCD reset on this pin

/* option: uncomment the next line if all command pins are on the same port for slight speed & code size improvement */
#define LCD_CMD_PORT            PORTB            // Command Output Register for pins 14-19

/* Arduino pins used for LCD Data 
 * un-comment ONE of the following pin options that corresponds to the wiring of data bits 0-3 
 */
#define dataPins8to11   // bits 0-3 assigned to arduino pins 8-11, bits 4-7 assigned to arduino pins 4-7
//#define dataPins14to17 //bits 0-3 assigned to arduino pins 14-17, bits 4-7 assigned to arduino pins 4-7. (note command pins must be changed)
//#define dataPins0to3  // bits 0-3 assigned to arduino pins 0-3 , bits 4-7 assigned to arduino pins 4-7, this is marginally  the fastest option but  its only available on runtime board without hardware rs232.

/* NOTE: all above options assume LCD data bits 4-7 are connected to arduino pins 4-7 */

/*******************************************************/
/*     end of Arduino configuration                    */
/*******************************************************/

#ifndef dataPins0to3                     // this is the only option on standard arduino where all data bits are on same port 
#define LCD_DATA_NIBBLES                // if this is defined then data i/o is split into two operations
#endif 

// these macros  map pins to ports using the defines above
// the following should not be changed unless you really know what your doing 
#ifdef dataPins0to3
#define LCD_DATA_LOW_NBL   D   // port for low nibble: D=pins 0-3  
#endif
#ifdef dataPins14to17 
#define LCD_DATA_LOW_NBL   C   // port for low nibble: C=pins 14-17 (using this requires reasignment of command pins) 
#endif
#ifdef dataPins8to11            // the following is the defualt setting
#define LCD_DATA_LOW_NBL   B   // port for low nibble, B=pins 8-11
#endif

#define LCD_DATA_HIGH_NBL  D   // port for high nibble: D=pins 4-7, B & C not available on std arduino  

// macros to fast write data to pins known at compile time, this is over 30 times faster than digitalWrite
#define fastWriteHigh(_pin_) ( _pin_ < 8 ?  PORTD |= 1 << (_pin_ & 0x07) : ( _pin_ < 14 ?  PORTB |= 1 << ((_pin_ -8) & 0x07) : PORTC |= 1 << ((_pin_ -14) & 0x07)  ) ) 
#define fastWriteLow(_pin_) ( _pin_ < 8 ?   PORTD &= ~(1 << (_pin_  & 0x07)) : ( _pin_ < 14 ?  PORTB &= ~(1 << ((_pin_ -8) & 0x07) )  :  PORTC &= ~(1 << ((_pin_ -14) & 0x07) )  ) )


#endif

//////////////////////////////////////
lib file
file : ks0108_Panel.h
/////////////////////////////////////

/*
  ks0108_Panel.h - Arduino library support for ks0108 and compatable graphic LCDs
  Copyright (c)2008 Michael Margolis All right reserved

  This is the configuration file for LCD panel specific configuration

*/

#ifndef      KS0108_PANEL_H
#define KS0108_PANEL_H

/*********************************************************/
/*  Configuration for LCD panel specific configuration   */
/*********************************************************/
#define DISPLAY_WIDTH 128
#define DISPLAY_HEIGHT 64

// panel controller chips
#define CHIP_WIDTH     64  // pixels per chip 

// you can swap around the elements below if your display is reversed
#ifdef ksSOURCE

#if (DISPLAY_WIDTH / CHIP_WIDTH  == 2) 
   byte chipSelect[] = {1,2};        // this is for 128 pixel displays
#elif (DISPLAY_WIDTH / CHIP_WIDTH  == 3)
   //byte chipSelect[] = {0, 1, 2};  // this is for 192 pixel displays
   byte chipSelect[] = {0, 2, 1};  // this is for 192 pixel displays on sanguino only
#endif

#if (DISPLAY_WIDTH / CHIP_WIDTH  == 2) 
#define DisableController(chip)    fastWriteLow(CSEL1);   fastWriteLow(CSEL2);   // disable for 128 pixel panels
#else
#define DisableController(chip)    fastWriteHigh(CSEL1);   fastWriteHigh(CSEL2); // disable for 192 pixel panels
#endif

#define EN_DELAY_VALUE 6 // this is the delay value that may need to be hand tuned for slow panels

#endif // ksSource defined to expose chipSelect only to cpp file

#endif

vielen dank :slight_smile:

Das scheint mir ein Speicher-Fehler des Drivers des Displays zu sein.
Einen Komunikationsfehler wegen vertauschter oder unterbrochener Datenleitungen schließe ich aus da dadurch die initialisation nicht funktionieren würde.
Was ist nach der Initialisation bzw nach einem Clear zu sehen?
Grüße Uwe

vielen dank !!

habe einen anderen arduino UNO genommen und jetzt gehts alles super !!!
vieleicht mal bootloader neu aufspielen.

danke :wink: :wink:

Hätte nicht beim Arduino den Fehler gesucht.
Die Übertragung der Daten erfolgt mit einem bestimmten Timing. Wenn die Wartezeiten leicht zu kurz für das Modul sind können hie und da Übertragungsfehler auftreten.
Hat der Arduino einen Ausgang kaput?
Gratulation und Viele Grüße Uwe