Unicorn GLCD demo.

Status
Not open for further replies.
Dude for some reason i had to add
Code:
    GLCD_Write_Cmd(0x3f);    //display on

To the end of my PLOT code and it works now heh
 
I added the line as you suggest without success ... Lines are 8 pixels high .

Code:
    GLCD_Write_Cmd(0x3f);    //display on

Atomsoft, would you please post your GLCD.c and GLCD.h files, because i really don't know how to fix this problem .

Many thanks,
 
im on ARM my whole code is different now.
I fixed mines with a BUFFER of 1024 bytes and i edit the bytes then draw entire screen. Works nice now
 
I need to declare W as a unsigned ROM char

Code:
unsigned rom char W;

Code:
unsigned char GLCD_Read(void){
	b_GLCD_E=1;
	Delay();
	ww=GLCD_Data;
	b_GLCD_E=0;
	Delay();
	return W;
}

Now, lines are 1 pixel high.

But displaying a picture is not working properly ...
The pixels are sliding and moving ... i don't know why .
 
Last edited:
Try changing it to,
Code:
unsigned char GLCD_Read(void){
unsigned char dat;
	b_GLCD_E=1;
	Delay();
	dat=GLCD_Data;
	b_GLCD_E=0;
	Delay();
	return dat;
}
Mike.
 
well, it does not change anything ...

I'm still getting many plots everywhere on my GLCD screen when i call line, box, circle functions.

Only text messages from the font placed in ROM gets correct result.

I bought my GLCD on Ebay ( from China ) , maybe it is bad quality ?
Text is correctly displayed so i should normally get geometrical functions working as well ...
 
Hello

Can someone b kind to try my test code attached below,
i'm getting crazy to get geometrical and picture displaying functions working well...

The code compile without any error but when i run it, i only get text displayed properly.

Hlines, Vlines, logo, plot , rectangles get bad results. ( missing and moving pixels )

My code is set for 18F2620 ( 10 Mhz crystal ).
My GLCD CS pins are complemented.

Proteus simulator gives me exactly same results as hardware does.
See the capture result attached below.

Many thanks for your help, i'm stuck !
 

Attachments

  • Test GLCD C18.zip
    107.5 KB · Views: 358
  • Simulator from Proteus.zip
    24 KB · Views: 373
  • capture_result.jpg
    305.4 KB · Views: 424
Last edited:
yes, i agree with you.

But vline function looks to be properly written ... i don't know what is wrong.

Can someone post a fully tested code for me please ?
Then, i will try it on my design.

Many thanks,
 
Did someone try the code i posted ?

I really need your help : I'm suspecting my hardware working not correctly.
If my code works with other GLCD displays it means mine is faulty .

Many thanks for your help,
 
I cracked my GLCD supposed to get a nice new one by today in mail. I got to goto postal office. Ill take pictures after but i cant help until then
 
I don't have any hardware setup at the moment but I had a quick look at the code. Why have you removed the code to wait until the display is ready to accept new commands?

Code:
unsigned char GLCD_Read_Data(void){
	[COLOR="red"]//Wait_Not_Busy();[/COLOR]
	TRIS_Data=0xff;
	Delay();

	b_GLCD_RS=1;
	b_GLCD_RW=1;
	b_GLCD_E=1;
	Delay();

	b_GLCD_E=0;
	Delay();
	b_GLCD_E=1;
	Delay();
	dat=GLCD_Data;   [COLOR="red"] //move this line up before b_GLCD_E=1;[/COLOR]
	b_GLCD_RW=0;
	TRIS_Data=0x00;
	return dat;
}

Doing the above would explain the problem.

I see you have tried adding delays but why not do it the right way anyway?

Edit, and you've changed the order it does things. You read the data after the display is disabled!!!! Just switch back to my original code and it should work fine.

Mike.
 
Last edited:
I put it back has it should be ( here is attached the project with modifications )

-->
Code:
unsigned char GLCD_Read_Data(void){
	Wait_Not_Busy();
	TRIS_Data=0xff;
	b_GLCD_RS=1;
	b_GLCD_RW=1;
	b_GLCD_E=1;
	Delay();
//	dat=GLCD_Data^0xff;			// inverse display mode
	dat=GLCD_Data;				// regular display mode
	b_GLCD_E=0;
	TRIS_Data=0x00;
	return dat;
}

However, vertical lines problem remains ...


By the way, i tried to port Pommie's original code in order to use it with my Pic 18F2620 : compilation completes without error but simulation and hardware test get a blank display ( nothing displayed ) when running the program...

I also attach Pommie's code ported for 18F2620.zip


Many thanks for your help,
 

Attachments

  • my code for 18F2620.zip
    133.7 KB · Views: 387
  • my code capture.JPG
    295.2 KB · Views: 400
  • Pommie's code ported for 18F2620.zip
    92.9 KB · Views: 364
Edit, I looked at the wrong code earlier. Don't have time now to look again. Will have a look later.

Mike.
 
Last edited:
I've now looked through your code and can't see any reason that it doesn't work.

What happens if you just plot one pixel in the middle of the screen?

BTW, I can't try your code as I recently moved and the GLCD is still in a box somewhere. Should be unpacked by weekend.

edit, just noticed,
Code:
// A/D PORT Configuration
    ADCON1 = 0x00;			// all digital
    INTCON2bits.RBPU = 1;  // Disable internal PORTB pull-ups
This sets it to all analogue. ADCON1 should be 0x0f for all digital. Good news, this would explain your result.

Mike.
 
Last edited:
If i use my partial working code ( my code for 18F2620.zip )and try to lit 1 or many pixel with plot function it works fine.

hline is working well too.

However, in any cases i found that Isis simulator gets Warnings while program runs :
it reports logic contention for D0 to D7 pins. ( showing yellow flashes near pins names )

Regarding vline : it looks it display every pixel very very slowly one by one.

Maybe some more delays are required somewhere ?

---

I tried the same test with your original code ported for 18F2620, but nothing is displayed at all.

This is strange because your original code is working perfectly with 18F4550...


May i suggest you when you will have time to try my code below and port it for your PIC ( 18F4550 ) ?

Then, we will see if you get same issues.

Many thanks,
 

Attachments

  • my code for 18F2620.zip
    134.7 KB · Views: 346
Last edited:
Your latest code still shows it as zero!!

Code:
void main(void)
{

// A/D PORT Configuration
 [COLOR="red"]ADCON1 = 0x00[/COLOR];			// all digital
 INTCON2bits.RBPU = 1;  // Disable internal PORTB pull-ups

If this is how your code is, then it will cause this problem as analogue pins always read back as zero.

From my original code,
Code:
void main (void){
unsigned char i;
    OSCCON=0x70;
    [COLOR="red"]ADCON1=0x0f;[/COLOR]	// all digital

Mike.
 
Last edited:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…