• We recently switched our forum platform. If you experience any issues please email support@crystalfontz.com

Did I ruin my glcd?

hgboy

New member
I have a 12864F glcd with a toshiba controller. I have been unable to get the thing to work properly, and fear i may have damaged it somehow. I had it hooked up least week to a pic micro, and could only get it to display garbled text, and was trying to display lines, rectangles, etc. I decided to re-solder some wire to the connector, and attached those to single row headers to fit better into my breadboard.(the garbled text would chnge if i bumped the wires, and that prompted my decision to make sure the connections were decent) I don't think I got the glcd too hot when I did this, but I suppose anything is possible. Everything is hooked up correctly, and I even have a 10k pot connected between -V, +V and Vo for the contrast control, but nothing is being displayed. Could I have damaged the lcd? Is there any way to check if the lcd is damaged?
Looking for additional LCD resources? Check out our LCD blog for the latest developments in LCD technology.
 

Gualdim

New member
Thank for the support CF, you are unbelievable!

Is this because there is nothing to sell here that you do not answering the question?
 

CF Tech

Administrator
If you think the display is damaged, please write support@crystalfontz.com to arrange a replacement. Generally we are quite supportive if the customer is willing to take some blame for the blue smoke ;)

In most cases where the display will not work in a breadboard or hand wired connection, the wiring is the culprit. Breadboards are notorious for making poor or intermittent connections. In a prototype setting like this, it is also really easy to accidentally smoke the display. One half of a second with the power leads reversed can mean the end of the road for a display.
 

Gualdim

New member
Sorry, but you still do not give any answer to his question, who was pretty simple: how do we know if our display is out of order?
Let's assuming, as an example, that we did not ever see our LCD working fine; how do we know if the problem comes from the software or if it is the LCD display, maybe fried out? My LCD display, CFAG12864 (as you may know...), with my poor coding skills, shows just some chaotics stripes... so, as I spent 5 weeks on it, and found many many librairies about it, and it still doesn't work, I was just wondering if the LCD could be broken...

How can I know??
 

CF Tech

Administrator
how do we know if our display is out of order? . . . How can I know??
You have to put it into a known good working system.

This is very hard in your case, since we do not know if your hardware and software is all working correctly.

We can test it here, but shipping displays around quickly costs more than the display, which is why I suggested you contact support, since they have some leeway when handling issues like this.
 
The only way I can think of to "prove" that a display module is good is to have a hardware setup that is known to work with other display modules, and is known to have software that is compatible with your display's controller.

So there are three things needed for success:
1. A working display
2. Correct connections to a microprocessor
3. Software that produces the correct commands at the proper timing.

You would assume the display is good unless you can prove that #2 and #3 are good, but still no image on screen.

To prove #2 & 3, you will need test equipment, both hardware and software. The prime tool is an oscilloscope to view the data and control signals being sent by the software. A software debug method may be helpful to single-step through your code, line by line, while using a meter or scope to verify that each data and control signal is correct for that step of the code.

If you don't have access to these test tools, then you should buy a ready made development board that includes the same type of display, to use as your "known good" setup. For example, the CFA demo board http://www.crystalfontz.com/product/DMOG12864BWGHN.html is available for the "B" display, but I don't see one for the "F" display.
 

Gualdim

New member
Thank you for your quick and very helpful answer.

I will paste here this evening (I'm at my workplace right now) the hardware scheme, made with Eagle, so you will have a better view on what I have done until now. I will post my source code too... actually just some little part of it for wich I'm not very confident.

Talk to you later, and thank you again.
 
I think it looks like a standard hookup that should work. The part number for the LCD is not familiar to me, who is the manufacturer and which controller IC does the display use?
 

Gualdim

New member
Seems that my link to the scheme has disappear! I will fix it... this evening.

I'm happy that you had the time to have a look on it cosmicvoid.

The display is an CFAG12864 from Crystalfontz... with KS0107; actually, I'm a student group member, I'm not the one who made this scheme, my role is to test it, maybe my friend didn't use the right standard; I do not have the scheme with me right now so I can't say, but I have not noticed that...I will send him an e-mail to figure it out,l if you think there is a problem with it.

Here is the driver I'm sutck with:

driver.c:

Code:
// GDM12864H.c

/*

// External Crystal, 18.432MHz

CrystalFontz CFAG12864B series Graphics Display serial backpack.
Compatible with the Xiamen Ocular GDM12864H graphics display,
sold by Sparkfun Electronics.

For use with the GDM12864H display. CS1 & CS2 need to be interchanged
Move: solder bridge J7 --> J5
Move: solder bridge J6 --> J8
*/

/*************************************************************/
/*************************************************************/
#include <avr/io.h>
#include <stdio.h>

#include "Driver.h"
#include "ASCII.h"

// System Messages
const char BANNER_MSG_1[] = "XXXX";
const char BANNER_MSG_2[] = "XXXXXXXXXXXXXXXX";
const char BANNER_MSG_3[] = "XXXXXXXXXX";

// Global structure to control the graphics LCD display
// These variables are global to maintain the integrity of LCD_PutChar
// and also be able to provide controlled cursor movement
struct {
//      unsigned char Status;
//      unsigned char Cursor;
      unsigned char PageCount;
      unsigned char ColumnPointer;
      unsigned char ColumnData;
      unsigned char ChipSelect;
}LCD;

int LCD_SleepCounter;

/****************************************************************************/

/****************************************************************************/
void LCD_DrawLine (unsigned char x1, unsigned char x2, unsigned char y1, unsigned char y2) {
    char x, y;
    double m;

    x = x1;
    m = (double)(y2 - y1) / (x2 - x1);
    y = (char)((-m*x)+y2);

    while(x < x2) {
       y = (char)((-m*x)+y2);
      LCD_SetPixle (x++, y);
    }
}
/****************************************************************************/

/****************************************************************************/
void LCD_DrawBox (unsigned char x1, unsigned char x2,
               unsigned char y1, unsigned char y2) {
    char n;

    n = x1;
    do {
        LCD_SetPixle (n, y1);
    } while(++n <= x2);

    n = y1;
    do {
        LCD_SetPixle (x2, n);
    } while(++n <= y2);

    n = x2;
    do {
        LCD_SetPixle (n, y2);
    } while(--n >= x1);

    n = y2;
    do {
        LCD_SetPixle (x1, n);
    } while (--n >= y1);
}
/****************************************************************************/

/****************************************************************************/
void LCD_ClearPixle (unsigned char x, unsigned char y) {
    unsigned char d, q, p, n;

    q = y / 8;
    p = q * 8;
    n = y - p;

    d = LCD_GetColumn (x, q);
    LCD.ChipSelect = LCD_PutCursor (x, q);
    LCD_PutData (~(1<<n)&d, LCD.ChipSelect);
}
/****************************************************************************/

/****************************************************************************/
void LCD_SetPixle (unsigned char x, unsigned char y) {
    unsigned char d, q, p, n;

    q = y / 8;
    p = q * 8;
    n = y - p;

    d = LCD_GetColumn (x, q);
    LCD.ChipSelect = LCD_PutCursor (x, q);
    LCD_PutData ((1<<n)|d, LCD.ChipSelect);
}
/****************************************************************************/

/****************************************************************************/
unsigned char LCD_GetColumn (unsigned char x, unsigned char y) {

    LCD.ChipSelect = LCD_PutCursor (x, y);
    LCD_BusyWait(LCD.ChipSelect);
    LCD_DATA_DDR = 0x00; // Set LCD data port to inputs

    LCD_CONTROL_OUT |= (1<<LCD_RW);
    LCD_CONTROL_OUT &= ~(1<<LCD.ChipSelect);
    // There must be a design flaw in the controller so, do a dummy read
    LCD_CONTROL_OUT |= (1<<LCD_E);
    LCD_Delay(10);
    LCD.ColumnData = LCD_DATA_IN; // Dummy read
    LCD_CONTROL_OUT &= ~(1<<LCD_E);
    LCD_Delay(10);
    // Do the correct read of the column data
    LCD_CONTROL_OUT |= (1<<LCD_E);
    LCD_Delay(10);
    LCD.ColumnData = LCD_DATA_IN;
    LCD_CONTROL_OUT &= ~(1<<LCD_E);
    LCD_CONTROL_OUT |= (1<<LCD.ChipSelect);

    return (LCD.ColumnData);
}
/****************************************************************************/

/****************************************************************************/
void LCD_PutColumn (unsigned char character, unsigned char x, unsigned char y) {
    LCD.ChipSelect = LCD_PutCursor (x, y);
    LCD_PutData (character, LCD.ChipSelect);
}
/****************************************************************************/

/****************************************************************************/
unsigned char LCD_PutCursor (unsigned char x, unsigned char y) {
    unsigned char ChipSelect;

    LCD.PageCount = y;
    LCD.ColumnPointer = x;
    if (LCD.ColumnPointer < 64) {
       ChipSelect = LCD_CS1; // Set display left side
      // Set collunm address
      LCD_WrtCmd (COLUMN_ADDRESS | LCD.ColumnPointer, ChipSelect);
    }
    else {
         ChipSelect = LCD_CS2; // Set display right side
        // Set collunm address
        LCD_WrtCmd (COLUMN_ADDRESS | (LCD.ColumnPointer - 64), ChipSelect);
    }
    // Set page address
    LCD_WrtCmd (PAGE_ADDRESS | LCD.PageCount, ChipSelect);
    return (ChipSelect);
}
/****************************************************************************/

/****************************************************************************/
void LCD_PutString (const char *character, unsigned char x, unsigned char y) {
    unsigned char q = 0;

    LCD.ChipSelect = LCD_PutCursor (x, y);
    while (character[q] != NULL) {
          // Check that the next character fits on the current line
         LCD_PutChar (character[q++]);
    }
}
/****************************************************************************/

/****************************************************************************/
char LCD_PutChar (unsigned char character) {
   unsigned char ColumnCounter = 0;

   // Check that the next character fits on the current line
   if ((LCD.ColumnPointer + 6) > 127) {
      LCD.PageCount++;
      LCD.ColumnPointer = 0;
      LCD_CONTROL_OUT |= (1<<LCD_CS2); // Disable the Right side
      LCD_WrtCmd ((PAGE_ADDRESS + LCD.PageCount), LCD_CS1); // Set 'ColumnCounter' page address
      LCD_WrtCmd (COLUMN_ADDRESS, LCD_CS1); // Set 'Y' collunm address
   }

   // Put the next character out onto the display
   for (ColumnCounter = 0; (ColumnCounter < 6); ColumnCounter++) {
      // Check for the end of the current line
      if (LCD.ColumnPointer > 127) {
         LCD.PageCount++;
         LCD_CONTROL_OUT |= (1<<LCD_CS2); // Disable the Right side
         LCD_WrtCmd ((PAGE_ADDRESS + LCD.PageCount), LCD_CS1); // Set page address
         LCD_WrtCmd (COLUMN_ADDRESS, LCD_CS1); // Set 'Y' collunm address
         LCD.ColumnPointer = 0;
      }

      // Check for the last page
      if (LCD.PageCount > 7) {
         LCD_CONTROL_OUT |= (1<<LCD_CS2); // Disable the Right side
         LCD_WrtCmd (PAGE_ADDRESS, LCD_CS1); // Set page address
         LCD_WrtCmd (COLUMN_ADDRESS, LCD_CS1); // Set 'Y' collunm address
         LCD.PageCount = 0;
         LCD.ColumnPointer = 0;
      }

      // Check to see if the Left line is full, if so, select the Right line
      if (LCD.ColumnPointer == 64) {
         LCD_CONTROL_OUT |= (1<<LCD_CS1); // Disable the Left side
         LCD_WrtCmd ((PAGE_ADDRESS + LCD.PageCount), LCD_CS2); // Set page address
         LCD_WrtCmd (COLUMN_ADDRESS, LCD_CS2); // Set 'Y' collunm address
      }

      // Check if Left or Right side should be selected
      if (LCD.ColumnPointer > 63) LCD.ChipSelect = LCD_CS2;
      else LCD.ChipSelect = LCD_CS1;
      // Send the current column to the display
      LCD_PutData (Ascii[character][ColumnCounter], LCD.ChipSelect);
      LCD.ColumnPointer++;
   }
   return(-1);
}
/****************************************************************************/

/****************************************************************************/
void LCD_ClearScreen (void) {
    LCD_ClearPage (LCD_CS1);
    LCD_ClearPage (LCD_CS2);
}
/****************************************************************************/

/****************************************************************************/
void LCD_ClearPage (unsigned char chipselect) {
   unsigned char X, Y;

   X = PAGE_ADDRESS;
   LCD_BusyWait(chipselect);
   do {
         LCD_WrtCmd (X, chipselect); // Set 'X' page address
      LCD_WrtCmd (COLUMN_ADDRESS, chipselect); // Set 'Y' collunm address
         for (Y = 0; (Y < 64); Y++) {
         LCD_PutData (0x00, chipselect); // Set data
      }
   } while (++X < PAGE_ADDRESS + 8);
}
/****************************************************************************/

/****************************************************************************/
// Clock cycle = 67nS @ 14.7456MHz
// Delay resolution ~ 1uS @ 14.7456MHz
void LCD_Delay (unsigned int d) {
    while (d-- != 0);
}
/****************************************************************************/

/****************************************************************************/
void LCD_PutData (unsigned char character, unsigned char chipselect) {
   LCD_BusyWait(chipselect);
   LCD_CONTROL_OUT &= ~((1<<chipselect) | (1<<LCD_RW));

   LCD_CONTROL_OUT |= (1<<LCD_E);
   LCD_DATA_OUT = character;
   LCD_Delay(1);
   LCD_CONTROL_OUT &= ~(1<<LCD_E);

   LCD_CONTROL_OUT |= (1<<chipselect); // | (1<<LCD_RW);
}
/****************************************************************************/

/****************************************************************************/
void LCD_WrtCmd (unsigned char cmd, unsigned char chipselect) {
    LCD_BusyWait(chipselect);
   LCD_CONTROL_OUT &= ~((1<<chipselect) | (1<<LCD_RW) | (1<<LCD_DI));

   LCD_CONTROL_OUT |= (1<<LCD_E);
   LCD_DATA_OUT = cmd;
   LCD_Delay(1);
   LCD_CONTROL_OUT &= ~(1<<LCD_E);

   LCD_CONTROL_OUT |= (1<<chipselect) | (1<<LCD_DI); // | (1<<LCD_RW);
}
/****************************************************************************/

/****************************************************************************/
void LCD_BusyWait (unsigned char chipselect) {
    char s;
   LCD_DATA_DDR = 0x00; // Set LCD data port to inputs

   LCD_CONTROL_OUT &= ~((1<<LCD_DI) | (1<<chipselect));
   LCD_CONTROL_OUT |= (1<<LCD_RW);
   do {
      LCD_CONTROL_OUT |= (1<<LCD_E);
      LCD_Delay(1);
      s = LCD_DATA_IN;
      LCD_CONTROL_OUT &= ~(1<<LCD_E);
   } while (s & (1<<LCD_BUSY));
   LCD_CONTROL_OUT |= (1<<LCD_DI) | (1<<chipselect);
   LCD_DATA_DDR |= 0xFF; // Set LCD data port to outputs
}
/****************************************************************************/

/****************************************************************************/
void LCD_Init (void) {
   // Initialize the AVR controller I/O
   LCD_DATA_DDR = 0xFF; // Set LCD_DATA_DDR to all outputs
   LCD_DATA_OUT = 0x00; // Set LCD_DATA_OUT to logic low
   LCD_CONTROL_DDR = 0xFF; // Set LCD_CONTROL_DDR to all outputs
   LCD_CONTROL_OUT |= (1<<LCD_LED) | (1<<LCD_DI) | (1<<LCD_RES)
               | (1<<LCD_CS1) | (1<<LCD_CS2);
   LCD_WrtCmd (LCD_ON, LCD_CS1); // Power up the Left side controller of the display
   LCD_WrtCmd (LCD_ON, LCD_CS2); // Power up the Right side controller of the display
   LCD_Sleep(10); // Wait 1 milisecond for the display to stableize
   LCD_ClearScreen ();
}
/****************************************************************************/

/****************************************************************************/
// Debounce any I/O pin (singularly or individually) on any I/O Port
unsigned char SwitchPressed(unsigned char Port, unsigned char Bit) {
         static unsigned char LastKey; // Remember LastKey state, from call to call
         unsigned char DebounceCount = 0;

         do  {
             if (LastKey != (Port & Bit))
                DebounceCount = 10; // Can be as low as 10 counts @ 14.7456MHz

             LastKey = (Port & Bit);
         } while (DebounceCount-- != 0);

         return (~LastKey); // Negated for the STK500/STK600
}
/****************************************************************************/

/****************************************************************************/
// LCD delay timer
// Interrupt once every milisecond
// External Crystal, 18.432MHz
//TIMER1 initialize - prescale: 64
// WGM: 4) CTC, TOP = OCR1A
// Desired resolution: 1.000mS
// Actual resolution:  0.996528mS (0.3742% Error)
// Maximum delay: 65,535 milliseconds
void LCD_Sleep(unsigned int time) {
     LCD_SleepCounter = time;
     while(LCD_SleepCounter > 0);
}
/****************************************************************************/

/****************************************************************************/
// Timer 1 Intrrupt Service Routine
// Interrupt once every milisecond
// External Crystal, 18.432MHz
//TIMER1 initialize - prescale: 64
// WGM: 4) CTC, TOP = OCR1A
// Desired resolution: 1.000mS
// Actual resolution:  0.996528mS (0.3742% Error)
// Maximum delay: 65,535 milliseconds
#pragma interrupt_handler timer1:14
void timer1(void) {
    // Decrement the LCD_SleepCounter
    if (LCD_SleepCounter != 0) LCD_SleepCounter--;
}
/****************************************************************************/

/****************************************************************************/
// Timer 1 Intrrupt Service Routine
// Interrupt once every milisecond
// External Crystal, 18.432MHz
//TIMER1 initialize - prescale: 64
// WGM: 4) CTC, TOP = OCR1A
// Desired resolution: 1.000mS
// Actual resolution:  0.996528mS (0.3742% Error)
void timer1_init(void) {
    TCCR1B = 0x00;      // Stop Timer Counter 1
    TCNT1 = 0xff1B;   // Clear Timer Counter 1
    OCR1A = 0x011F;   // We want a 1.000 Milisecond delay resolution
    TCCR1A = 0x00;      // Generate automatic output
    TCCR1B = (1<<WGM12) | (1<<CS11) | (1<<CS10); // Start Timer OCR1A, CLK / 64
    }
/****************************************************************************/

/****************************************************************************/
// Call this routine to initialize all peripherals
void Init_Devices(void) {
   // Stop errant interrupts until set up
   asm("cli");


   timer1_init();
   MCUCR = 0x00;
   TIMSK |= (1<<OCIE1A);
   asm("sei");
   LCD_Init();
 // All peripherals are now initialized
//    LED_ON();
   LCD_PutString (BANNER_MSG_1, 30, LINE_2); // Send a message to the LCD display
   LCD_PutString (BANNER_MSG_2, 35, LINE_3); // Send a message to the LCD display
   LCD_PutString (BANNER_MSG_3, 1, LINE_5); // Send a message to the LCD display

   LCD_Sleep(5000); // Delay for the banner message to be visible
   //LCD_ClearScreen ();
   //LED_OFF();
}
/****************************************************************************/
driver.h :

Code:
/*
 * Driver.h
 *
 *  Created on: 2009-02-15
 *      Author: stephane
 */

#ifndef DRIVER_H_
#define DRIVER_H_

/*************************************************************/
/*************************************************************/

/*
   //// Display interface \\\\
      // Control I/O port
      PORTx:0 --> CS2
      PORTx:1 --> CS1
      PORTx:2 --> RES!
      PORTx:3 --> R/W
      PORTx:4 --> D/I
      PORTx:5 --> E
      PORTx:6 --> NOT USED
      PORTx:7 --> BACK LIGHT

      // Data I/O port
      PORTx:0 --> LCD:DB0
      PORTx:1 --> LCD:DB1
      PORTx:2 --> LCD:DB2
      PORTx:3 --> LCD:DB3
      PORTx:4 --> LCD:DB4
      PORTx:5 --> LCD:DB5
      PORTx:6 --> LCD:DB6
      PORTx:7 --> LCD:DB7
*/

/*************************************************************/
/*************************************************************/
// If you want to use a different I/O port for LCD control & data,
// do it here!!!

// Define active I/O ports controlling the LCD

// Control I/O port
#define LCD_CONTROL_OUT PORTC
#define LCD_CONTROL_IN PINC
#define LCD_CONTROL_DDR DDRC

// Data I/O port
#define LCD_DATA_OUT PORTB
#define LCD_DATA_IN PINB
#define LCD_DATA_DDR DDRB

// Define LCD control signals
#define LCD_CS1 0
#define LCD_CS2 1
#define LCD_RES 2
#define LCD_RW 3
#define LCD_DI 4
#define LCD_E 5
#define LCD_LED 7

/*************************************************************/
/*************************************************************/

#define LINE_1 0
#define LINE_2 1
#define LINE_3 2
#define LINE_4 3
#define LINE_5 4
#define LINE_6 5
#define LINE_7 6
#define LINE_8 7

// LCD busy status bit
#define LCD_BUSY 7

// Turn on power to the display, no cursor
#define   LCD_ON   0x3F
#define LCD_OFF 0x3E

#define PAGE_ADDRESS 0xB8
#define COLUMN_ADDRESS 0x40
#define Z_ADDRESS 0xC0

#define ACK 6

#define LED_ON() LCD_CONTROL_OUT |= (1<<LCD_LED)
#define LED_OFF() LCD_CONTROL_OUT &= ~(1<<LCD_LED)

void Init_Devices(void);
void LCD_Sleep(unsigned int time);
void LCD_Delay (unsigned int delay);
void LCD_PutData (unsigned char character, unsigned char chipselect);
void LCD_WrtCmd (unsigned char cmd, unsigned char chipselect);
void LCD_BusyWait (unsigned char chipselect);

void LCD_Init (void);
void LCD_ClearPage (unsigned char chipselect);
void LCD_ClearScreen (void);
char LCD_PutChar (unsigned char character);
unsigned char LCD_PutCursor (unsigned char x, unsigned char y);
void LCD_PutColumn (unsigned char character, unsigned char x, unsigned char y);
unsigned char LCD_GetColumn (unsigned char x, unsigned char y);
void LCD_PutString (const char *character, unsigned char x, unsigned char y);
void LCD_SetPixle (unsigned char x, unsigned char y);
void LCD_ClearPixle (unsigned char x, unsigned char y);
void LCD_DrawBox (unsigned char x1, unsigned char x2, unsigned char y1, unsigned char y2);
void LCD_DrawLine (unsigned char x1, unsigned char x2,  unsigned char y1, unsigned char y2);

unsigned char SwitchPressed(unsigned char Port, unsigned char Bit);


#endif /* DRIVER_H_ */
ASCII.h :

Code:
/*
 * ASCII.h
 *
 *  Created on: 2009-02-15
 *      Author: stephane
 */

#ifndef H_ASCII /* to stop multiple inclusions of this file */
#define H_ASCII

unsigned char Ascii[130][6] = {
{0x60,0x80,0x8D,0x90,0x60,0},         /* Illegal */
{0x60,0x80,0x8D,0x90,0x60,0},      /* Illegal */
{0x00,0x38,0x28,0x28,0x44,0x82},    /* HORNOFF_ICON0  */
{0xFE,0x00,0x00,0x00,0x00,0x00},    /* HORNOFF_ICON1  */
{0x00,0x38,0x38,0x38,0x7C,0xFE},    /* HORNON_ICON0   */
{0xFE,0x28,0x92,0x44,0x38,0x00},    /* HORNON_ICON1   */
{0x38,0x54,0x92,0x54,0x38,0x00},    /* GAIN_ICON */
{0x92,0x7C,0xC5,0xC5,0x7C,0x92},    /* TERM_ICON */
{0xFC,0x04,0x06,0x06,0x04,0xFC},    /* BAT_ICON0 */
{0xFF,0x00,0x00,0x00,0x00,0xFF},    /* BAT_ICON1 */
{0xFF,0x80,0x80,0x80,0x80,0xFF},    /* BAT_ICON2 */
{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},    /* BLACK_PIXELS */
{0x60,0x80,0x8D,0x90,0x60,0},      /* Illegal */
{0x60,0x80,0x8D,0x90,0x60,0},      /* Illegal */
{0x60,0x80,0x8D,0x90,0x60,0},      /* Illegal */
{0x60,0x80,0x8D,0x90,0x60,0},      /* Illegal */
{0x60,0x80,0x8D,0x90,0x60,0},      /* Illegal */
{0x60,0x80,0x8D,0x90,0x60,0},      /* Illegal */
{0x60,0x80,0x8D,0x90,0x60,0},      /* Illegal */
{0x60,0x80,0x8D,0x90,0x60,0},      /* Illegal */
{0x60,0x80,0x8D,0x90,0x60,0},      /* Illegal */
{0x60,0x80,0x8D,0x90,0x60,0},      /* Illegal */
{0x60,0x80,0x8D,0x90,0x60,0},      /* Illegal */
{0x60,0x80,0x8D,0x90,0x60,0},      /* Illegal */
{0x60,0x80,0x8D,0x90,0x60,0},      /* Illegal */
{0x60,0x80,0x8D,0x90,0x60,0},      /* Illegal */
{0x60,0x80,0x8D,0x90,0x60,0},      /* Illegal */
{0x60,0x80,0x8D,0x90,0x60,0},      /* Illegal */
{0x60,0x80,0x8D,0x90,0x60,0},      /* Illegal */
{0x60,0x80,0x8D,0x90,0x60,0},      /* Illegal */
{0x60,0x80,0x8D,0x90,0x60,0},      /* Illegal */
{0x60,0x80,0x8D,0x90,0x60,0},      /* Illegal */
{0x00,0x00,0x00,0x00,0x00,0},      /*   */
{0x00,0x00,0x9E,0x00,0x00,0},      /* ! */
{0x00,0x0E,0x00,0x0E,0x00,0},      /* " */
{0x28,0xFE,0x28,0xFE,0x28,0},      /* # */
{0x48,0x54,0xFE,0x54,0x24,0},      /* $ */
{0x46,0x26,0x10,0xC8,0xC4,0},      /* % */
{0x6C,0x92,0xAA,0x44,0xA0,0},      /* & */
{0x00,0x0A,0x06,0x00,0x00,0},      /* ' */
{0x00,0x38,0x44,0x82,0x00,0},      /* ( */
{0x00,0x82,0x44,0x38,0x00,0},      /* ) */
{0x24,0x18,0x7E,0x18,0x24,0},      /* * */
{0x10,0x10,0x7C,0x10,0x10,0},      /* + */
{0x00,0xA0,0x60,0x00,0x00,0},      /* , */
{0x10,0x10,0x10,0x10,0x10,0},      /* - */
{0x00,0xC0,0xC0,0x00,0x00,0},      /* . */
{0x40,0x20,0x10,0x08,0x04,0},      /* / */
{0x7C,0xA2,0x92,0x8A,0x7C,0},      /* 0 */
{0x00,0x84,0xFE,0x80,0x00,0},      /* 1 */
{0x84,0xC2,0xA2,0x92,0x8C,0},      /* 2 */
{0x42,0x82,0x8A,0x96,0x62,0},      /* 3 */
{0x30,0x28,0x24,0xFE,0x20,0},      /* 4 */
{0x4E,0x8A,0x8A,0x8A,0x72,0},      /* 5 */
{0x78,0x94,0x92,0x92,0x60,0},      /* 6 */
{0x02,0xE2,0x12,0x0A,0x06,0},      /* 7 */
{0x6C,0x92,0x92,0x92,0x6C,0},      /* 8 */
{0x0C,0x92,0x92,0x52,0x3C,0},      /* 9 */
{0x00,0x6C,0x6C,0x00,0x00,0},      /* : */
{0x00,0xAC,0x6C,0x00,0x00,0},      /* ; */
{0x10,0x28,0x44,0x82,0x00,0},      /* < */
{0x28,0x28,0x28,0x28,0x28,0},      /* = */
{0x00,0x82,0x44,0x28,0x10,0},      /* > */
{0x04,0x02,0xA2,0x12,0x0C,0},      /* ? */
{0x7C,0x82,0xba,0xa2,0xbc,0},      /* @ */
{0xF8,0x24,0x22,0x24,0xF8,0},      /* A */
{0xFE,0x92,0x92,0x92,0x6C,0},      /* B */
{0x7C,0x82,0x82,0x82,0x44,0},      /* C */
{0xFE,0x82,0x82,0x44,0x38,0},      /* D */
{0xFE,0x92,0x92,0x92,0x82,0},      /* E */
{0xFE,0x12,0x12,0x12,0x02,0},      /* F */
{0x7C,0x82,0x92,0x92,0xF4,0},      /* G */
{0xFE,0x10,0x10,0x10,0xFE,0},      /* H */
{0x00,0x82,0xFE,0x82,0x00,0},      /* I */
{0x40,0x80,0x82,0x7E,0x02,0},      /* J */
{0xFE,0x10,0x28,0x44,0x82,0},      /* K */
{0xFE,0x80,0x80,0x80,0x80,0},      /* L */
{0xFE,0x04,0x18,0x04,0xFE,0},      /* M */
{0xFE,0x08,0x10,0x20,0xFE,0},      /* N */
{0x7C,0x82,0x82,0x82,0x7C,0},      /* O */
{0xFE,0x12,0x12,0x12,0x0C,0},      /* P */
{0x7C,0x82,0xA2,0x42,0xBC,0},      /* Q */
{0xFE,0x12,0x32,0x52,0x8C,0},      /* R */
{0x4C,0x92,0x92,0x92,0x64,0},      /* S */
{0x02,0x02,0xFE,0x02,0x02,0},      /* T */
{0x7E,0x80,0x80,0x80,0x7E,0},      /* U */
{0x3E,0x40,0x80,0x40,0x3E,0},      /* V */
{0x7E,0x80,0x70,0x80,0x7E,0},      /* W */
{0xC6,0x28,0x10,0x28,0xC6,0},      /* X */
{0x0E,0x10,0xE0,0x10,0x0E,0},      /* Y */
{0xC2,0xA2,0x92,0x8A,0x86,0},      /* Z */
{0x00,0xFE,0x82,0x82,0x00,0},      /* [ */
{0x04,0x08,0x10,0x20,0x40,0},      /* \ */
{0x00,0x82,0x82,0xFE,0x00,0},      /* ] */
{0x08,0x04,0x02,0x04,0x08,0},      /* ^ */
{0x80,0x80,0x80,0x80,0x80,0},      /* _ */
{0x00,0x00,0x06,0x0A,0x00,0},      /* ` */
{0x48,0xA8,0xA8,0xF0,0x80,0},      /* a */
{0x00,0xFE,0x88,0x88,0x70,0},      /* b */
{0x00,0x70,0x88,0x88,0x88,0},      /* c */
{0x70,0x88,0x88,0xFE,0x00,0},      /* d */
{0x70,0xA8,0xA8,0xA8,0xB0,0},      /* e */
{0x00,0x08,0xFC,0x0A,0x0A,0},      /* f */
{0x10,0xA8,0xA8,0xA8,0x78,0},      /* g */
{0x00,0xFE,0x08,0x08,0xF0,0},      /* h */
{0x00,0x88,0xFA,0x80,0x00,0},      /* i */
{0x40,0x80,0x80,0x7A,0x00,0},      /* j */
{0x00,0xFE,0x20,0x50,0x88,0},      /* k */
{0x00,0x82,0xFE,0x80,0x00,0},      /* l */
{0xF8,0x08,0xF0,0x08,0xF0,0},      /* m */
{0x00,0xF8,0x08,0x08,0xF0,0},      /* n */
{0x70,0x88,0x88,0x88,0x70,0},      /* o */
{0xF8,0x28,0x28,0x28,0x10,0},      /* p */
{0x10,0x28,0x28,0x28,0xF8,0},      /* q */
{0x00,0xF8,0x10,0x08,0x08,0},      /* r */
{0x90,0xA8,0xA8,0xA8,0x48,0},      /* s */
{0x00,0x08,0x7E,0x88,0x80,0},      /* t */
{0x00,0x78,0x80,0x80,0xF8,0},      /* u */
{0x38,0x40,0x80,0x40,0x38,0},      /* v */
{0x78,0x80,0x60,0x80,0x78,0},      /* w */
{0x88,0x50,0x20,0x50,0x88,0},      /* x */
{0x18,0xA0,0xA0,0x78,0x00,0},      /* y */
{0x88,0xC8,0xA8,0x98,0x88,0},      /* z */
{0x00,0x10,0x6C,0x82,0x82,0},      /* { */
{0x00,0x00,0xEE,0x00,0x00,0},      /* | */
{0x82,0x82,0x6C,0x10,0x00,0},      /* } */
{0x04,0x02,0x04,0x08,0x04,0},      /* ~ */
{0x60,0x80,0x8D,0x90,0x60,0}       /* Illegal */
};

#endif
main.c:

Code:
/*
 * main.c
 *
 *  Created on: 2009-02-15
 *      Author: stephane
 */

#include <avr/io.h>
#include <stdio.h>

#include "Driver.h"


/****************************************************************************/

/****************************************************************************/
int main (void) {

    Init_Devices(); // Initialize the AVR hardware and GDM12864H graphic display
	//LCD_ClearScreen();
    while (1) {
    //	Init_Devices();
    //	LCD_Delay(100);
   }
}
I have some doubts in the way to use it; I guess I have to adapt some little things, since I use an external crystal at 16Mhz instead of 18,..Mhz used in this code, but I don't know exactly how to change it. There is probably some other little thing I miss.

Thank you for your help!
 
It looks like the "driver.c" and "driver.h" files are incomplete (much stuff is missing) in the post you made, but in the email notice I got for your post, it seems to have some of the missing parts. I wonder why it did not post correctly.

For example, LCD_BusyWait() and LCD_Init() are missing from your post, and the LCD_PutChar() is much different in the email than it is in your code box posting :confused: . Maybe it would be a better idea to attach the 4 files instead of putting the text in a code box. Now, I am not really sure if anything else is screwed up, and I don't want to spend time looking at your code if it has parts missing.
 

Gualdim

New member
I'm wondering what went wrong...

I attached a .zip to this post, hope it is complet this time!

Oh, and this is, again, my scheme, who disappeared above:



I really hope you will help me to figure out what goes wrong with my stuff; thank you for your interest.
 

Attachments

I have downloaded your code, and I have a CFAG12864B module, so when I get some free time in the next day or two, I will try your code on my development board (with minor changes to suit my Zilog cpu).
 
I have compiled your code, but I have a major problem :( . My development board has strangely died and I can't download to it. So, it will take a week for me to get a replacement board to continue. Sorry.
 

Gualdim

New member
Don't worry, I am not to one week or two. Sorry for your board! :(

However, can you tell me if you see any obvious error in the code that I could have miss?
 
I didn't see anything obviously wrong with the code. But if something like a signal is inverted, or a missing statement, I probably wouldn't notice it, until the display did not show the correct image.
 
Aha!

Well, I received my replacement cpu board today, and I tried out your code. There were some minor modifications necessary for my cpu (like the DDR polarity was opposite for input and output than yours, and re-assign I/O port pins to match my cable, etc.), and threw away the timer and keypress stuff that was not compatible with my cpu.

I must say... I was amazed that the code works with no debugging needed :). It may be that signal timing could be improved, but I did not even connect the oscilloscope, so I don't know. I could also give you some suggestions to make your code more compact, but the essence is that your display should work with this code.

So if your display doesn't work, then it is probably a wiring or other hardware problem (or your display is really dead).
 

Attachments

Gualdim

New member
Well thank you very much! :)

Knowing that the code is correct is an excellent news. Right now I am breadboarding, however the PCB is on soldering so I will be able to test it in about two days or so. I'm still wondering what's wrong with my stuff; I followed the scheme I posted here, same code... I'm pretty sure that I miss something with the STK500.

Anyway, thank you again cosmicvoid, you should hear some news from my stuff very soon. :)
 

Gualdim

New member
Hi,

as the code is correct, I decided to breadboarding the entire stuff, with ATMega32 also on the breadboard. To do so, I have to know Cosmicvoid if you followed the scheme I posted here to make everything work fine. You, or even someone else, can assure me that the scheme is correct?
The PCB soldering isn't going well at the moment, deadline is coming, so that's why I switched to breadboard.

Thank you
 
Top