GLCD is not working ...

General discussion on mikroPascal.
Author
Message
vpapanik
Posts: 68
Joined: 31 May 2005 20:24

GLCD is not working ...

#1 Post by vpapanik » 10 Jul 2005 16:51

Unfortunately I cannot get a GLCD to work...

I use PORTC for control port and PORTD for data port with the following short code :

Code: Select all

program GLCD;

begin
    TRISC := 0; *
    TRISD := 0; *
    GLCD_Init(PORTC,0,1,2,3,4,5,PORTD);
    GLCD_Fill(0);
    GLCD_Write_Text('Hello',0,0,1);
end.
* I don't know if the first two commands are needed but it is still not working without them

I connect the following pins to the control port

RC0 -> CS1
RC1 -> CS2
RC2 -> RS
RC3 -> RW
RC4 -> RST
RC5 -> EN

and the data port as follows : RCx -> Dx (x = 0 to 7)

I have the GLCD data sheet but I cannot find a way to attach it here. Could you please help me ? Thanks in advance !

Charlie
Posts: 2744
Joined: 01 Dec 2004 22:29

#2 Post by Charlie » 10 Jul 2005 19:01

Hi ivpapanik,

What pic are you using and can you post all of the code?
Regards Charlie M.

LGR
Posts: 3204
Joined: 23 Sep 2004 20:07

#3 Post by LGR » 10 Jul 2005 21:21

If you can, try the example in the examples folder using the B and D ports, and then if that works, modify it for C and D. Also, make sure that your contrast is adjusted correctly.
If you know what you're doing, you're not learning anything.

vpapanik
Posts: 68
Joined: 31 May 2005 20:24

#4 Post by vpapanik » 10 Jul 2005 22:00

I used EASYPIC2 with the default 16F877A microcontroller.
I also tried to disconnect the 16x2 LCD but didn't work either.

I used the extension slots of PortC and PortD to connect the GLCD.

I have posted the whole code, it was that simple.

I have tried with PortB and PortD.
I have tried to use the default pinout for GLCD_Init

Nothing worked either !
Maybe it has to do with the GLCD manufacturer, I tried two identical ones but
nothing.

The GLCD data sheet is here :

http://www.tinsharp.com/product/MANNUL/TG12864B.pdf

LGR
Posts: 3204
Joined: 23 Sep 2004 20:07

#5 Post by LGR » 10 Jul 2005 22:10

1. They may have changed this, but the GLCD library used to only work with P18. If you have a PIC18F452, maybe you should try it. Are you using 3.0.0.4?

2. Your module looks very standard.

3. Were you able to adjust the contrast to get a black display?
If you know what you're doing, you're not learning anything.

vpapanik
Posts: 68
Joined: 31 May 2005 20:24

#6 Post by vpapanik » 11 Jul 2005 06:48

>1. They may have changed this, but the GLCD library used to only work >with P18. If you have a PIC18F452, maybe you should try it. Are you >using 3.0.0.4?

Yes, I am using the latest 3.0.0.4. They said that the GLCD is working with PIC16 family as well and they removed the above quote from the manual.

>2. Your module looks very standard.
Yes, it seems so.


>3. Were you able to adjust the contrast to get a black display?
Yes, I have placed two trimmers for adjusting contrast and backlight.

Still, the GLCD shows garbage...

Charlie
Posts: 2744
Joined: 01 Dec 2004 22:29

#7 Post by Charlie » 11 Jul 2005 10:33

Hi vpapanik,

I tried your code using easypic2,18F452 everything works Great.I tried it with the 16F877a and all I get is a "H" . Do You have a 452 you can try?
Regards Charlie M.

vpapanik
Posts: 68
Joined: 31 May 2005 20:24

#8 Post by vpapanik » 11 Jul 2005 12:10

Yes, I do have a 452. I will give it a try. Thanks very much !

vpapanik
Posts: 68
Joined: 31 May 2005 20:24

#9 Post by vpapanik » 11 Jul 2005 12:20

Microchip suggest using 18F4520 instead (for new designs). I have both, from samples, what do you suggest ?

Charlie
Posts: 2744
Joined: 01 Dec 2004 22:29

#10 Post by Charlie » 11 Jul 2005 18:09

Hi vpapanik,

If you have a 452 then I wold go for that.I know it works.:)
Regards Charlie M.

vpapanik
Posts: 68
Joined: 31 May 2005 20:24

#11 Post by vpapanik » 12 Jul 2005 09:07

Is there a need to change anything on EASYPIC2 (switches, jumpers) in order to connect the GLCD to the external ports C and D (the 10pin plug) ? I cannot get it to work even if I put a 18F452 controller :(

Charlie
Posts: 2744
Joined: 01 Dec 2004 22:29

#12 Post by Charlie » 12 Jul 2005 10:40

Hi vpapanik,

The only jumpers to be concerned with are the Program jumpers.(JP3,JP4) they select the pic you are programming.other than that thats it. Make sure in the compiler that you have HS selected for the osc. Go project/edit project and select the default button.then hit ok and compile. it should work.
Regards Charlie M.

vpapanik
Posts: 68
Joined: 31 May 2005 20:24

#13 Post by vpapanik » 12 Jul 2005 14:12

Actually I have a 18LF452. Will LF be a problem or it is the same to F ?

Charlie
Posts: 2744
Joined: 01 Dec 2004 22:29

#14 Post by Charlie » 12 Jul 2005 14:16

Hi vpapanik,
I don't think so.I would try it and see.MAke sure that the HS osc is set in the Program.
Regards Charlie M.

LGR
Posts: 3204
Joined: 23 Sep 2004 20:07

#15 Post by LGR » 12 Jul 2005 16:34

I've successfully used a GLCD with an easyPIC with a 4 mHZ 18F452 on ports B and D, and using the provided example. If yours isn't working, it is probably either:

1. Your wiring isn't totally functional. This is the most likely explaination, if you are getting garbage on the screen. Even it it all looks good, you really need to do a point-by-point continuity test, and then test adjacent pins for shorts.

2. The oscillator on the PIC isn't configured correctly.

I don't remember any specific precautions for the easyPIC board itself, I am able to run the GLCD with the LCD attached.
If you know what you're doing, you're not learning anything.

Post Reply

Return to “mikroPascal General”