Using Graphical LCD with PIC16F877A

Discussion about projects that used PIC Microcontroller, Hardware Interface, Programming Algorithm and etc......

Using Graphical LCD with PIC16F877A

Postby PICTRAIL » Mon Dec 27, 2010 3:46 pm

Hi, I bought Graphic LCD but i'm having problem using it with PIC16F877A. I tried to modify sample source program from PR21 Kit but it doesn't work.
I need someone to help me with a sample source code just to write "Cytron Technology" on the GLCD.

Thanks.
PICTRAIL
Apprentice
 
Posts: 40
Joined: Mon Dec 27, 2010 3:32 pm

Re: Using Graphical LCD with PIC16F877A

Postby hyng » Tue Dec 28, 2010 9:19 am

I'm not so sure. But i think the clue is at
CODE: SELECT_ALL_CODE
char test[] = {"testing0"};
char cali [] = {"  CALIBRATE...  "};
char mssg1[] = {"  LET IT FLAT "};
char mssg2[] = {" AND PRESS SW1 "};
char mssg3[] = {"FREESPACE      "};
char mssg4[] = {"FRICTION       "};


have you try to modify them?
User avatar
hyng
Moderator
 
Posts: 292
Joined: Thu Apr 16, 2009 11:35 am

Re: Using Graphical LCD with PIC16F877A

Postby ABSF » Tue Dec 28, 2010 10:49 am

Hi, I bought Graphic LCD but i'm having problem using it with PIC16F877A. I tried to modify sample source program from PR21 Kit but it doesn't work.
I need someone to help me with a sample source code just to write "Cytron Technology" on the GLCD.


You didn't give enough details of the GLCD that you've bought. Which controller chip was it based on: HD61202, KS0108, T6963C, SED1330 or ST7920? What is the size of your GLCD? What clock rate is your 16F877a running on?

The PR21 GLCD is based on ST7920 and the 18F452 is running at 10MHz. That means the instruction cycle is 400nS per instruction. If your 16F877A is running at 20MHz, it is twice faster than the PR21 MCU.

I have a GLCD based on KS0108B chip and the connections are different from that of the PR21's GLCD. On P18, P16 & P15 of my GLCD, I have VEE , CS2 & CS1 respectively. My GLCD came with a demo board with a 16F57 PIC on it, so I have no problem testing my LCD that it is working by just pluging in the USB plug to supply +5V it requires.

Allen
The next war will determine NOT who is right BUT what is left.
User avatar
ABSF
Professional
 
Posts: 810
Joined: Wed Nov 10, 2010 9:32 am
Location: E Malaysia

Re: Using Graphical LCD with PIC16F877A

Postby ABSF » Tue Dec 28, 2010 11:07 am

Hi,

Can someone confirm whether there is a character ROM built in the GLCD like the 16X2 LCD. Or do I have to load the whole ASCII charactet pattern into my program?

Allen
The next war will determine NOT who is right BUT what is left.
User avatar
ABSF
Professional
 
Posts: 810
Joined: Wed Nov 10, 2010 9:32 am
Location: E Malaysia

Re: Using Graphical LCD with PIC16F877A

Postby PICTRAIL » Tue Dec 28, 2010 1:21 pm

The GLCD is 128 x 64 same one with the PR21 Kit. Likewise my PIC16F877A is running on 20MHz.
I am very new to PIC microcontroller and i can't seem to get a way out to modify the other program.

I would appreciate a sample program just to write any message like (CYTRON TECHNOLOGY) placed at the centre of the screen and a sample image loading. With this i can make adjustment for it to suit my application.

Thanks for your support.


Ebby.
PICTRAIL
Apprentice
 
Posts: 40
Joined: Mon Dec 27, 2010 3:32 pm

Re: Using Graphical LCD with PIC16F877A

Postby hyng » Wed Dec 29, 2010 1:36 pm

PICTRAIL WROTE:The GLCD is 128 x 64 same one with the PR21 Kit. Likewise my PIC16F877A is running on 20MHz.
I am very new to PIC microcontroller and i can't seem to get a way out to modify the other program.

I would appreciate a sample program just to write any message like (CYTRON TECHNOLOGY) placed at the centre of the screen and a sample image loading. With this i can make adjustment for it to suit my application.

Thanks for your support.


Ebby.


Please try with what i suggested
User avatar
hyng
Moderator
 
Posts: 292
Joined: Thu Apr 16, 2009 11:35 am

Re: Using Graphical LCD with PIC16F877A

Postby PICTRAIL » Wed Dec 29, 2010 6:12 pm

Hi, i did try but yet it does'nt work...
PICTRAIL
Apprentice
 
Posts: 40
Joined: Mon Dec 27, 2010 3:32 pm

Re: Using Graphical LCD with PIC16F877A

Postby ABSF » Wed Dec 29, 2010 8:04 pm

You mean you're not getting anything on the LCD? How did you connect the Backlight? In PR21, the backlight goes to a transistor and is software controlled. The contrast should also be set to medium level.

The 3 arrays of 1024 bytes each are the "Cytron logo" and "GAME OVER" in graphic mode. I have not yet decode the 3rd one. The "icon" is a ball shaped graphic. To display text, it seems you just need the functions: init, delay, send_config, send_char, lcd_goto, lcd_clr, & send_string. To display graphic you need: lcd_xy, d_graphic, & clr_graphic.

But I still think that there is something wrong with your hardware setup.

Best regards,

Allen
The next war will determine NOT who is right BUT what is left.
User avatar
ABSF
Professional
 
Posts: 810
Joined: Wed Nov 10, 2010 9:32 am
Location: E Malaysia

Re: Using Graphical LCD with PIC16F877A

Postby PICTRAIL » Wed Dec 29, 2010 8:30 pm

Thank you so much for the suggestion... The backlight is ok because i'm controlling it manually using potentiometer.
I think the problem with PR21 sample is that it's using PIC18 while i am trying to use PIC16F877A i think there is difference in the protocol.
PICTRAIL
Apprentice
 
Posts: 40
Joined: Mon Dec 27, 2010 3:32 pm

Re: Using Graphical LCD with PIC16F877A

Postby shiyan » Sat Jan 01, 2011 10:45 am

PICTRAIL WROTE:Thank you so much for the suggestion... The backlight is ok because i'm controlling it manually using potentiometer.
I think the problem with PR21 sample is that it's using PIC18 while i am trying to use PIC16F877A i think there is difference in the protocol.


I don think you mean protocol. Protocol mean the method to communicate between 2 nodes or software layers.

Yes, definitely C18 and C compiler for PIC16F is different, but I don think is the protocol. Maybe we can study what is being done in those functions such as initialize, sending graphic to LCD.

Speed might also affect, do check the DIY project by Cytron, PIC18F can use PLL to multiplier the external oscillator to 4 times.
User avatar
shiyan
Amateur
 
Posts: 189
Joined: Wed Jun 09, 2010 10:59 am

Next

Return to PIC Microcontroller

Who is online

Users browsing this forum: No registered users and 2 guests

cron