128x64 GLCD and only half of screen working

General discussion on Visual GLCD Software.
Post Reply
Author
Message
niman
Posts: 24
Joined: 06 Dec 2016 00:06

128x64 GLCD and only half of screen working

#1 Post by niman » 25 May 2018 02:47

I bought GLCD 128x64 from Mikro. I tested this display with Easy PIC Pro V7 and It worked fine.Then I assigned Port E for the CS1, CS2,RS,R/W,E,RST pins and the GLCD now showing half of the part of the screen. I plugged into our PCB controller with the same code it also have the same issue. i attached the part of the code with this and please help me out for this.
IMG-9327.JPG
IMG-9327.JPG (1.58 MiB) Viewed 4893 times

Code: Select all

char GLCD_DataPort at PORTD;
sbit GLCD_CS1 at LATE0_bit;
sbit GLCD_CS2 at LATE1_bit;
sbit GLCD_RS at LATE2_bit;
sbit GLCD_RW at LATE3_bit;
sbit GLCD_EN at LATE4_bit;
sbit GLCD_RST at LATE5_bit;
sbit GLCD_CS1_Direction at TRISE0_bit;
sbit GLCD_CS2_Direction at TRISE1_bit;
sbit GLCD_RS_Direction at TRISE2_bit;
sbit GLCD_RW_Direction at TRISE3_bit;
sbit GLCD_EN_Direction at TRISE4_bit;
sbit GLCD_RST_Direction at TRISE5_bit;


void Init_MCU() {

  CON_bit = 0;  // disable comparator
}

void Start_TP() {
  Init_MCU();

  InitializeTouchPanel();

  InitializeObjects();
  DrawScreen(&Screen1);
}
above code is a part of the code. not the complete code. ALso i attached a photo of the GLCD display. Its showing only exact half of the screen.

Thank you

User avatar
filip.grujcic
Posts: 822
Joined: 14 May 2018 08:34

Re: 128x64 GLCD and only half of screen working

#2 Post by filip.grujcic » 25 May 2018 10:07

Hello,

Have you tried configuring PORTB for GLCD and not PORTE?
Here is an example code:

Code: Select all

char GLCD_DataPort at PORTD;

sbit GLCD_CS1 at LATB0_bit;
sbit GLCD_CS2 at LATB1_bit;
sbit GLCD_RS  at LATB2_bit;
sbit GLCD_RW  at LATB3_bit;
sbit GLCD_EN  at LATB4_bit;
sbit GLCD_RST at LATB5_bit;

sbit GLCD_CS1_Direction at TRISB0_bit;
sbit GLCD_CS2_Direction at TRISB1_bit;
sbit GLCD_RS_Direction  at TRISB2_bit;
sbit GLCD_RW_Direction  at TRISB3_bit;
sbit GLCD_EN_Direction  at TRISB4_bit;
sbit GLCD_RST_Direction at TRISB5_bit;


void main()
{
    ANCON0 = 0x00;                        // Configure PORTB pins as digital I/O
    ANCON1 = 0x00;                        // Configure PORTD pins as digital I/O
    ANCON2 = 0x00;

    ...
}
Since you didn't state which MCU you have, maybe that MCU is already using PORTE pins for something else.

Regards,
Filip Grujcic

niman
Posts: 24
Joined: 06 Dec 2016 00:06

Re: 128x64 GLCD and only half of screen working

#3 Post by niman » 27 May 2018 08:11

i am using PIC18F87k22 microcontroller . PORTB has been used for Interrupt signals. could you please tell me what has used PORTE ? I searched datasheet and couldn't find anything.

User avatar
filip.grujcic
Posts: 822
Joined: 14 May 2018 08:34

Re: 128x64 GLCD and only half of screen working

#4 Post by filip.grujcic » 28 May 2018 13:37

Hello,

Could you zip your whole project and attach it here, so we can try to reproduce the issue.

Regards,
Filip Grujcic

niman
Posts: 24
Joined: 06 Dec 2016 00:06

Re: 128x64 GLCD and only half of screen working

#5 Post by niman » 28 May 2018 23:04

Hi,
I attached the whole project with this. Please have a look and post me what have I done wrong.

Thank you.
Project.zip
(284.66 KiB) Downloaded 123 times
Regards,
Nimantha

User avatar
filip.grujcic
Posts: 822
Joined: 14 May 2018 08:34

Re: 128x64 GLCD and only half of screen working

#6 Post by filip.grujcic » 29 May 2018 11:57

Hello,

Can you just tell me what happened when you tested PORTB for GLCD connections?

Did it display objects on the entire screen or only half of the screen?

Regards,
Filip Grujcic

User avatar
filip.grujcic
Posts: 822
Joined: 14 May 2018 08:34

Re: 128x64 GLCD and only half of screen working

#7 Post by filip.grujcic » 29 May 2018 13:49

Hello,

I have tested your project and everything worked fine. Unfortunately, it would seem that the GLCD you have is faulty.

Regards,
Attachments
glcd_test.JPG
glcd_test.JPG (519.7 KiB) Viewed 4848 times
Filip Grujcic

niman
Posts: 24
Joined: 06 Dec 2016 00:06

Re: 128x64 GLCD and only half of screen working

#8 Post by niman » 29 May 2018 21:28

But I tested with another GLCD project it worked fine. But PORTB port is using for that project.

User avatar
filip.grujcic
Posts: 822
Joined: 14 May 2018 08:34

Re: 128x64 GLCD and only half of screen working

#9 Post by filip.grujcic » 30 May 2018 11:40

Hi niman,

Could you please test the GLCD using PORTB again and post a screenshot of it here?

Kind regards,
Filip Grujcic

niman
Posts: 24
Joined: 06 Dec 2016 00:06

Re: 128x64 GLCD and only half of screen working

#10 Post by niman » 30 May 2018 21:42

I tested with PORTB and GLCD is working fine. I want to use PORTE but when I use PORTE the GLCD Display is showing half of the screen.

Thank you.

User avatar
filip.grujcic
Posts: 822
Joined: 14 May 2018 08:34

Re: 128x64 GLCD and only half of screen working

#11 Post by filip.grujcic » 31 May 2018 14:39

Hi,

As I have showed you I tested your example with GLCD on EasyPIC PRO v7 with same MCU on PORTE and everything worked fine.
I'm afraid I can't help you when it comes to your custom board, perhaps there is some problem with it.

I apologize for the inconvenience.

Regards,
Filip Grujcic

oliverb
Posts: 570
Joined: 24 May 2007 15:09

Re: 128x64 GLCD and only half of screen working

#12 Post by oliverb » 03 Apr 2019 09:14

Have you checked to see if the CS1 and CS2 signals are actually reaching the display? I'd suggest probing from the solder joint on the display module, ideally with a scope or logic probe, but a resistor-LED combination can work if you test from VCC to the pin.

If you're using an EasyPIC then check that there isn't another module blocking that pin.

oliverb
Posts: 570
Joined: 24 May 2007 15:09

Re: 128x64 GLCD and only half of screen working

#13 Post by oliverb » 05 Apr 2019 08:47

I found another possible reason for a blank half, though in my case it was blank left hand side. I happen to want to use a 8MHz clock, because I want to use ECCP for frequency generation and at 32MHz I can't get the audio frequencies I want.

Anyway at some point VGLCD "helpfully" re-enabled the PLL so I had 32MHz but the code was compiled for 8MHz. This blanked half the display, presumably because there was insufficient time for the display to reset properly.

FWIW I'm considering using Timer 1 and an interrupt for tone generation instead.

Post Reply

Return to “Visual GLCD General”