Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Unicorn GLCD demo.

Status
Not open for further replies.
Hi,
Where should one start debugging a GLCD?
I am using a pic18f4455, and I have basically copied the code from post #231, in that I have copied the 'library' .c and .h files into a project, and copied the inital part of the main.c into my project, and pretty much commented out the rest of it.
The problem I have, is that the LCD is labelled QY-12864BG, (and made in china), and nothing else. A google search shows only 1 result, and that page isn't helping much.
In the file glcd.h, I have changed GLCD_DATA to PORTD, and GLCD_TRIS_DATA to TRISD, as I want to use ICD, which is ports RB6 and 7 on the 18f4455
After the TRIS and LAT statements I have the following two lines:

glcd_Init();
glcd_PutMessage((rom char*) "\x16\x24\x08 Blueroom\x16\x20\x10 Electronics\n Title:\n Author:\n Date:\n Hardware:");

After those two lines, I have a routine which pulses RB1, which is attached to the LED backlight. This is how I know whether the two lines above have finished.
So, without any knowledge of which lines are inverted, I went through the defines, enabling and disabling them to the pattern below. There were only 3 which got as far as turning on the LED, but none of them resulted in data being displayed. Could someone give a hint as to where to look? I have un-wired and re-wired the circuit twice, using the silkscreen on the back of the LCD for directions, but I will shortly draw out a schematic from what I have wired and work backwards. I do not have Vout (-ve I think), connected, but the schematic I see doesn't have this connected. I have a pot between VDD and VSS of 4.7k, the center connected to V0.

I know it is a long-shot, but can anyone guess as to what I should look at now?
//00000

//00001

//00010
//00011

//00100 - finishes init. no screen
//00101
//00110 - finishes init. no screen
//00111

//01000
//01001
//01010
//01011
//01100
//01101
//01110
//01111

//10000
//10001
//10010
//10011
//10100
//10101 - init. no screen
//10110
//10111

//11000
//11001
//11010
//11011
//11100
//11101
//11110
//11111

// EN bit is complemented on the LCD side
//#define GLCD_CFG_EN_COMPLEMENTED

// DI bit is complemented on the LCD side
// By default, D is active high and I is active low
// Uncomment this line if your LCD has different pinout configuration
//#define GLCD_CFG_DI_COMPLEMENTED

// CSx bits are complemented on the LCD side
#define GLCD_CFG_CS_COMPLEMENTED

// RS bit is complemented on the LCD side
#define GLCD_CFG_RS_COMPLEMENTED

// RW bit is complemented on the LCD side
// By default, R is active high and W is active low
// Uncomment this line if your LCD has different pinout configuration
//#define GLCD_CFG_RW_COMPLEMENTED
 
Hmm, a***, have I just fried the LCD by putting +ve 5v onto the V0 line? The single pinout sheet I found lists +9V, however, it seems that other LCDs actually expect -Ve on V0
 
Well, what do you know? If you wire it up with a -ve voltage for V0, it works. In the end, I am defined as 00110, #define GLCD_CFG_CS_COMPLEMENTED and #define GLCD_CFG_RS_COMPLEMENTED
It looks like there may be a bug in the compiler.
x=40, r=-50, and the following does not perform any loops (from drawcircle)
for (i=x-r; i<=x+r; i++) {
....
}
stepping through with a debugger, sees i set to -10, but, it somehow must be more than x+r!!!
 
Hi, been watching thread 4 a while... I have some 128 x 128 GLCDs for sale...

Hi all, I have some 128 x 128 GLcds for sale... I hope it's OK to put that info here?

They are parallel drive, use KS0108 controllers, 8-bit data bus and the standard control signals plus a matrix signal for Chip Select (4 chips, 4 quadrants of 64 x 64).
I have written demo code for these.
They have EL- backlighting (external source required) and the standard -9 volt for contrast (again external source required)

The size is approx 61mm square display area.

I have several, and would be happy with $59 US a piece.

Anyone interested?
I'm in Australia... cheers:)

when i figure out how to attach a photo, i certainly will post one..
 
Can some one please tell the pin details of the GLCD.

i have one /RST pin, should this be pulled high using a resistor or should i directly apply 5V to it.

Also what to do about the pins Vo and Vee ? I have tried giving them both 5V and GND but still nothing shows up on the GLCD.

If i apply 5v to one and GND to the other, they short circuit the whole board.

Also i am unable to find the exact datasheet for my GLCD. On back its written AG1286411 (AGENA) OPCVO. I have tried searching google but in vain.
 
Can some one please tell the pin details of the GLCD.

i have one /RST pin, should this be pulled high using a resistor or should i directly apply 5V to it.

Also what to do about the pins Vo and Vee ? I have tried giving them both 5V and GND but still nothing shows up on the GLCD.

If i apply 5v to one and GND to the other, they short circuit the whole board.

Also i am unable to find the exact datasheet for my GLCD. On back its written AG1286411 (AGENA) OPCVO. I have tried searching google but in vain.

All of the microcontrollers I know render high voltage for logic-1 and low voltage for logic-0. You must use pull-up or pull-down resistors only when working with open collector and open emitter output devices respectively. Therefore, you don't have to connect a pull-up register. You shouldn't connect one.

Vo pin is so called "contrast adjustment" pin. You must apply some voltage between -5V to +5V to this pin. The contrast of the LCD screen changes according to the applied voltage to this pin. You can just connect this pin to GND to apply 0V (i.e.; normal contrast). But if you desire to make your screen contrast variable you have to use a potentiometer. Connect middle pin of the POT to this Vo pin of the LCD. Connect the other pins of the POT to Vcc (+5V) and Vee (-5V). But, what if you don't have -5V power port on your circuit?... Fortunately LCD manufacturers are benevolent people and the decided to render this -5V from the LCD itself! :) You can use "Vee" pint of the LCD to obtain this -5V votage to adjust your LCD contrast.

These are webpages of your GLCD:
**broken link removed**
**broken link removed**
There is no product called "AG1286411" though.
I just typed "agena lcd OR glcd" to the search box in Google... ;)
 
If you download the assembly instructions for the **broken link removed**, it contains a schematic showing the connections to the display.

Mike.
 
I have tried several things but my GLCD is not displaying anything. Blank screen. Its a new GLCD but i am not sure how to test if it works or not. The code works fine in proteus but not on actual hardware :(
 
I have tried several things but my GLCD is not displaying anything. Blank screen. Its a new GLCD but i am not sure how to test if it works or not. The code works fine in proteus but not on actual hardware :(

Can you tell us more about your circuit?
 
Sorry i was actually trying to compile the code.

Here is my Code:
Code:
#include <p18f4520.h>
#include <delays.h>
#include <stdlib.h>
#include <stdio.h>
#include "GLCD.h"					// GLCD Library

#pragma config WDT = OFF, LVP = OFF, OSC = INTIO67, XINST = OFF, DEBUG = OFF

void main(void)
{
	ADCON1 = 0x0E;
	OSCCON = 0x72;                  //8MHz clock
    while(!OSCCONbits.IOFS);        //wait for osc stable
	
	while(1)
	{
		Delay10KTCYx(70);
		Init_GLCD();
		PutMessage((rom char*)"\x16\x20\x8 \n Testing GLCD\n Second line");
		Delay10KTCYx(70);
	}
}

Configuration of GLCD Ports:
Code:
#define GLCD_Data   PORTD
#define b_GLCD_E    PORTEbits.RE0
#define b_GLCD_RW   PORTCbits.RC1
#define b_GLCD_RS   PORTEbits.RE1
#define b_GLCD_GCS2 PORTCbits.RC5
#define b_GLCD_GCS1 PORTCbits.RC4

#define TRIS_Data    TRISD
#define b_TRIS_E     TRISEbits.TRISE0 //E 
#define b_TRIS_RW    TRISCbits.TRISC1 //RW 
#define b_TRIS_RS    TRISEbits.TRISE1 //RS 
#define b_TRIS_GCS2  TRISCbits.TRISC5 //GCS2
#define b_TRIS_GCS1  TRISCbits.TRISC4 //GCS1

I have attached the ports of my PICF4520 As mentioned in the above code
 
Now sometimes half of the GLCD lights up into a black section. Also as soon as i connect my GLCD power, the 7805 regulator starts to heat up a lot. I have an LED, controller and GLCD on the circuit, should it take a lot of AMPS? the power supply i am using serves 12 volts and 800mA
 
Finally the GLCD is working but not as expected. I think the data sheet i am using is not for my GLCD :(

I am using the pin set

1 VSS 0V
2 VDD 5V
3 VO
4 D/I
5 R/W
6 E H
7~14 DB0~DB7
15 CS1
16 CS2
17 /RES
18 Vout
19 A
20 K

but as soon as i connect the 15 pin CS1 the GLCD gets stuck.
Also i had to leave the pin V0 disconnected. connecting it with GND or Vcc doesn't show up any display at all.

Attached is the display i am getting.
 

Attachments

  • 31032010523..jpg
    31032010523..jpg
    105.5 KB · Views: 331
It looks like the GLCD doesn't like where I turn on both displays at the same time, like in Cls. Are you able to split Cls code into two loops to clear the two halfs? Also try plotting pixels in each corner and see what happens.

Mike.
 
It writes the same data in both the sections of the GLCD. I have disconnected CS1, CS2, V0, Vee, RST wires (as from datasheet but not sure if it applies to my GLCD or not) and still the GLCD is working somehow.

The only connected pins are the 8 data pins, E, R/W, RS, 5V, GND
 
Last edited:
Pommie, the Left section of screen is continuously scrolling the text by default and the right section its fixed.

Also the left section gets stable too but after like a minute .

The code i have written is simple:

Code:
	while(1)
	{
		Delay10KTCYx(20);
		Init_GLCD();
		PutChar('.');
		SetPos(12,45);
		PutChar('S');
		//PutMessage((rom char*)"\x16\x20\x8 \n Testing GLCD\n Second line which is too long");
		PORTD ^= 0xFF;
		Delay10KTCYx(20);
	}

I have kept the Init and everything in a loop so that if anything fails the first time, it should reload again.
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top