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 Pommie:

Pretty much played with everything, changing oscillators, using internal vs external. Attached is a pic of your project running on Proteus with the defines changed to make it compatible with the EP4 development board. As you can see it works fine on Proteus but just won't work on a breadboard or the EP4.

Second pic is what is displayed when the pic is first programmed, as you can see there is problems in the display. Turning off/on the board's power and then nothing will display.

I know the display is fine because I can get it to work on a breadboard or EP4 with Richard.C assembler code for the KS0108

Have tried debugging with my PK2 and still can not get anything to display, or see where the problem is. Perhaps I am missing a config setting by using the 18f4520 instead of 18f4550.

My define's

#include <p18f4520.h>

#define GLCD_Data PORTD
#define b_GLCD_GCS1 LATBbits.LATB1
#define b_GLCD_GCS2 LATBbits.LATB0
#define b_GLCD_RS LATBbits.LATB2
#define b_GLCD_RW LATBbits.LATB3
#define b_GLCD_E LATBbits.LATB4
#define b_GLCD_ON LATBbits.LATB5
#define b_GLCD_BL LATBbits.LATB6

#define TRIS_Data TRISD
#define b_TRIS_GCS1 TRISBbits.TRISB1 //GCS1
#define b_TRIS_GCS2 TRISBbits.TRISB0 //GCS2
#define b_TRIS_RS TRISBbits.TRISB2 //RS
#define b_TRIS_RW TRISBbits.TRISB3 //RW
#define b_TRIS_E TRISBbits.TRISB4 //E
#define b_TRIS_ON TRISBbits.TRISB5 //RST
#define b_TRIS_BL TRISBbits.TRISB6 //backlight
 

Attachments

  • Pommie_GLCD_EP4.JPG
    Pommie_GLCD_EP4.JPG
    70.4 KB · Views: 660
  • Picture.jpg
    Picture.jpg
    99 KB · Views: 699
That picture looks like it is a timing problem. My guess is that you are running at a much higher clock rate than I was. Try repeating the asm line in delay.

I.E.
Code:
void Delay(void){
	_asm	NOP	_endasm
	_asm	NOP	_endasm
	_asm	NOP	_endasm
	_asm	NOP	_endasm
}

Mike.
 
I've found this pair in my archives. Not sure if they're the latest though.
 

Attachments

  • 18F452 GLCD Oscilloscope DR1r1 - no bootloader.c
    11 KB · Views: 685
  • GLCD - modified.c
    9.8 KB · Views: 737
Hey i know this thread is kinda old just wanted to say thanks for the code and i modded it slighty to fit a PIC18F448 @ 20 Mhz and here is the code if anyone needs it. (doesnt show that logo and stuff tho.)

I aslo found it does say you need to read the data twice ...
Yes, I tried the oscilloscope and it looks good.

One thing I forgot to mention earlier which may cause people problems is that the data sheet you link to (topway) doesn't mention the fact that, when reading from the display data, you need to do a dummy read before you get valid data. If you look at the plot routine you'll see what I mean. Don't you just hate it when data sheets are wrong.

Mike.
Im not sure if it was meant for that but i would have assumed it was.

Here is my code(your code) , my image and my finding in the datasheet.
 

Attachments

  • GLCD.png
    GLCD.png
    16.8 KB · Views: 737
  • twice.png
    twice.png
    103.3 KB · Views: 638
  • GLCDAS.zip
    67.7 KB · Views: 766
Hey i know this thread is kinda old just wanted to say thanks for the code and i modded it slighty to fit a PIC18F448 @ 20 Mhz and here is the code if anyone needs it. (doesnt show that logo and stuff tho.)

I aslo found it does say you need to read the data twice ...
Im not sure if it was meant for that but i would have assumed it was.

Here is my code(your code) , my image and my finding in the datasheet.


Here is a picture of it in action:
 

Attachments

  • GEDC0129.JPG
    GEDC0129.JPG
    2.3 MB · Views: 686
thanks (AtomSoft)
i using of GLCD.zip file for interfacing with GLCD and when i send a data or pic and other
to GLCD that appear white and null pixel are black how i inverse the state of all pixel on GLCD
i try to change the "ClearScreen" function on GLCD.c too:

void ClearScreen(void){
unsigned char i,j;
b_GLCD_GCS1=1;
b_GLCD_GCS2=1;
for(i=0;i<8;i++){
GLCD_Write_Cmd(0x40); //y=0
GLCD_Write_Cmd(0xb8+i); //x=0
for(j=0;j<0x40;j++)
GLCD_Write_Data(0xff);
}
SetPos(0,0);
}
i change the line "GLCD_Write_Data(0xff);" to "GLCD_Write_Data(0x00);"
for clear lcd with zero but it was same with 0xff.
 
In the function, add change the following

-=Bryan=-



Code:
void PutChar(unsigned char data){
unsigned char i,d;
    if(data<32){
        switch(data){
            case 13:
                XPos=0;
            case 10:
                XPos=0;
                YPos+=8;
                YPos=YPos&63;
        }
        WritePosition();
    }
    else{
        for(i=0;i<7;i++){
            d=Font[data-32][i];
            if(d!=0x55){
                d=~d;                             //ADD
                GLCD_Write_Data(d);
                MoveRight();
            }
        }
        //GLCD_Write_Data(0xff);
       GLCD_Write_Data(0x00);             //CHANGE
        MoveRight();
    }
}
 
thanks bryan i test your change and it work nice:eek:.
i need problem with logo:(, how i change my favorite picture to code that compatible with GLCD.c (putlogo function):confused:
and how work the "putlogo" function?
anyone have software or converter to convert this codes.
 
I have a VB program that I wrote to convert the original logo. It's really badly written and not suitable for general use but I am happy to use it to convert your logo. If you want it converting then just attach it to a post.

Mike.
 
thanks of bryan and Pommie for reply
thanks Pommie, but i don't need to convert one or two logo.
i need urgent a software for convert logo.
can you give me your software.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top