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.
ok finally the GLCD is working but i still get some glitches init. It seems that when ever i plug out power, then plug it back again after like 20 sec, the GLCD doesn't show anything, however, continuously pressing and releasing the reset button sometimes shows the display. Can this be a timing issue? I am using 4MHz external crystal
 
Dear hkBattousai: for some reasons, I am not able to download your zip file. Do you mind sending me a copy. Thanks!
 
Last edited:
The picture says it all:

**broken link removed**

Code ported to HI-TECH C with no issues whatsoever. Will post it once it is tidied up, but really it is mostly identical. Also works with hardware absolutely fine.

Could shave a fair chunk off the font by making the format:

Code:
WIDTH,byte1,byte2,byte3...

But that would require extra code to scan the array from the start each time, therefore would be slower. Will have to try it and see how well it works.

Next step, images! Then perhaps some simple "GUI" components, such as a progress bar using the vline/hline routines.
 
All right, I finally make it working. Thanks guys, for all of your posts, which guide me through this.
 

Attachments

  • P1010037.JPG
    P1010037.JPG
    1.5 MB · Views: 360
Hi to all
I'm new in this forum.
I'm now using the pommie library wich is very good. I want to know if anyone has make a big font function?
I try to make a big font function like PutBIGChar but with no sucess. The caracter apears to be all crazy. Can anyone help?
If we do some brainstroming here maybe we can find a function to do that, and then the library of pommie will be much more complete.
I think this function will be helpful to everybody.
 
Hmm, I will think about this. It would be easy multiplying font size by integer coefficients (x2, x3 or x4), is that OK with you? You don't mean increasing font size by 20%, do you?
 
Hi hkBattousai
I don't realy mather the size of it, I just want a bigger font LOL.
I was thinking in a font about 13x18, It's a very big font. I creat it but I cannot use the font.
I try to change de putchar function with no success at all.
 
I don't realy mather the size of it, I just want a bigger font LOL.
I was thinking in a font about 13x18, It's a very big font. I creat it but I cannot use the font.
I try to change de putchar function with no success at all.

Post the code you have tried to modify. That way we can help you see where it might be wrong.

Changing the function to accomodate a bigger font should not be hard. If you want to adapt the existing function then you will notice it always uses a height of 8, this is due to the way the column write works on the GLCD controller. You could modify it to have any height you liked, but unless it is a multiple of 8 (or you don't care about overwriting pixels) a read-modify-write would be required.
 
Hi edeca
I don't have a version of the putBIGchar. I change ony the values.
For testing purposes I was trying to make a 16x16 font wich is multiple of 8, i try many times to chage the putchar function so I don't have the codee cause I will erase it because anything works. LOL
Now I was looking again to the putchar function but no success.
 
Hi.
I make my own bold fonts. It looks OK, but when I arrange some chars I will post the const table and the PutBOLDchar function, basicaly is the pommie function but I only change the name of the font for the bold font.

**broken link removed**
 
Hi
Has anyone make this functions work on a PIC with a crystal greather than 10Mhz?? I using 10mhz, and it wokrs fine, but when I use 4xPLL, or 40Mhz I only see crazy stuff on the LCD, it seems to me like a timming problem so I try to make longer de delay() but no sucess. I put 20 NOP in the delay function and do not work.
Can anyone help me?
EDIT: Solved
 
Last edited:
I just tried it and had to set the config to,
Code:
#pragma config WDT = OFF, FOSC = HSPLL_HS, LVP = OFF , DEBUG = ON, CPUDIV = OSC1_PLL2, PLLDIV = 5
This clocks the CPU at 48MHz (with a 20MHz crystal) and so I had to put a delay after each write to b_GLCD_E=1 . I.E.
Code:
void delay(){
    _asm nop _endasm
    _asm nop _endasm
    _asm nop _endasm
    _asm nop _endasm
}

unsigned char GLCD_Read(void){
unsigned char W;
    b_GLCD_E=1;
    delay();
    W=GLCD_Data;
    b_GLCD_E=0;
    return W;
}

Have fun.

Edit, missed your edit.

Mike.
 
Last edited:
Hello,

I experiencing problem with the GLCD library when i try to display any geometrical drawing :

I'm able to properly display any text with Putmessage but any other function that uses plot are getting outstanding results.

In fact, i found that a simple line is always 8 pixels high instead of 1 pixel high.

Please see below the screen capture showing the result i get.


This is my plot function : ( i also attach my GLDC.c file )

Code:
// CS_pins_active_low ( complemented pins )
#define ENABLED 0
#define DISABLED 1


void plot(unsigned char x,unsigned char y){
unsigned char d;

	if(x>63){
		b_GLCD_GCS1= DISABLED;
		b_GLCD_GCS2= ENABLED;
		x-=64;
	}
	else
	{
		b_GLCD_GCS1= ENABLED;
		b_GLCD_GCS2= DISABLED;
	}
	GLCD_Write_Cmd(0x40+x);					// write column address
	GLCD_Write_Cmd(0xb8+(y>>3));				// write row address
	d=GLCD_Read_Data();					// dummy read
	d=GLCD_Read_Data();
	GLCD_Write_Cmd(0x40+x);					// write column address again
  	d=d|(1<<(y&7));							
	GLCD_Write_Data(d);
}

Can someone help me to solve that problem please ?
I can't find the solution .
 

Attachments

  • Display capture.jpg
    Display capture.jpg
    153 KB · Views: 333
  • Design GLCD HY12864Z.pdf
    28.2 KB · Views: 505
  • GLCD.c
    19.1 KB · Views: 307
Last edited:
The reason it is messing up is because it is always reading zero from the display. Check that the R/W line is connected properly and define correctly.

Mike.
 
hey make sure you set i as a char like

Code:
void hline(unsigned char x1,unsigned char x2,unsigned char y){
[B]unsigned char i = 0;[/B]
	for(i=x1;i<x2;i++)
		plot(i,y);
}

void vline(unsigned char x,unsigned char y1,unsigned char y2){
[B]unsigned char i = 0;[/B]
	for(i=y1;i<y2;i++)
		plot(x,i);
}
 
Hey Pommie my PLOT is acting funny heh. I can write text and stuff and i know the plot works because i see it after i reprogram the device.

Like i press play then it runs through code but i cant see it on GLCD. Then i press stop and play again and it shows it ? Weird right?
 
I checked all the pins defined and they are all ok.


But i forgot to say that i had to comment out return W line in GLCD_Read function because this line freezes the program and it gets stuck.

Code:
unsigned char GLCD_Read(void){
	b_GLCD_E=1;
	Delay();
	W=GLCD_Data;
	b_GLCD_E=0;
	Delay();
	//[COLOR="Red"]return W[/COLOR];
}


When i comment out return W, then i'm getting the results i described in my last post.

Maybe removing return W from the function should explain why i get hlines with 8 pixels high .

But I really do not understand why returning W from GLCD_Read freezes the program. :confused:
( i'm not using W variable anywhere else in my program )

W is also returned from GLCD_Read_Data function but there it does not get any bad impact ...



I tried to initialize "i" as suggested by AtomSoft in hline and Vlinewith unsigned char i = 0; but i do not get any changes.

Many thanks for your help,
 
Last edited:
Change the W to a w, lower case and it will work. I believe it is a reserved word when in the Upper Case
 
Status
Not open for further replies.

Latest threads

Back
Top