CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

GLCD troubles

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
guest
Guest







GLCD troubles
PostPosted: Thu Sep 14, 2006 11:24 pm     Reply with quote

Hi everyone

I am try to interface a GLCD (128 x 64) with PIC16f877A. The GLCD is the one that came with Easypic3 board, i think its ' 'Xiamen Ocluar GDB12864B' but im not too sure. What i do know for sure is that it uses 'KS0108' controller. The GLCD is not working in the sense that only half of the GLCD pixels (essentially 64x64) are visible and even in that some pixel lines are missing. No text or circle or whatever is in the
program is being displayed.

Here are the connection:

PIC : GLCD
B0 CS1
B1 CS2
GND GND
+5v Vcc
Vo is connected from a 20k Ohm POT
B2 RS
B4 R/W
B5 E
D0-D7 Databus (8 bit)
C0 Rst
VEE is connected to Negative voltage for 20k Ohm POT
+5 and Gnd for Backlight

Below is the code:

Code:

#include <16F877A.h>
#device *=16
#include <stdlib.h>
#include <string.h>
#include <24512.c> //for the atmel eeprom
#include <math.h>
#USE DELAY (CLOCK=10000000)
#include <glcd.c>
#fuses  HS,NOWDT,NOLVP
#use rs232(baud=19200,xmit=pin_c4,rcv=pin_c5,parity=N,stream=pc)


void main()
{
  setup_adc( ADC_OFF );

  delay_ms(20);

  glcd_init(ON); //initialize the LCD

  delay_ms(1000);

  fprintf(pc,"\n\rgraphical 1");

  glcd_circle(30,30,5,NO,OFF);

}



Is there some need to pull up or pull down some pins or something like that. I have even tried interchanging the chipselect pins.

Please help!!!

Best Regards
Markdem



Joined: 24 Jun 2005
Posts: 206

View user's profile Send private message Send e-mail

PostPosted: Fri Sep 15, 2006 5:51 am     Reply with quote

Hello, I think that your problem mybe hardware related. If the LCD is only drawing half of the space, it sounds like the CS is not been pulled high. Check to see if the connection is OK. I would also check the rest of the pins to see if they are ok.

Also, when you use glcd_circle, you need to change it to:

Code:

glcd_circle(30,30,5,NO,ON);


Also, if you want to display text, you need to do smothing like this

Code:

sprintf(lcddata,"Light Bank 1");
glcd_text57(1,0,lcddata,1,on);


Have a look at EX_GLCD in the exampels folder for more info

Have Fun

Mark
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group