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 problem

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



Joined: 07 Jun 2010
Posts: 4
Location: malaysia

View user's profile Send private message Yahoo Messenger

glcd problem
PostPosted: Thu Jan 13, 2011 7:26 pm     Reply with quote

hye all,
I need help regarding to glcd please.
I use 18F452, 20MHz, glcd pin connection as below:
Code:

 GLCD Pin connections:                                            ////
//// (These can be changed as needed in the following defines).      ////
////  * 1: VSS is connected to GND                                   ////
////  * 2: VDD is connected to +5V                                   ////
////  * 3: V0 - LCD operating voltage is connected from a 20k Ohm POT////
////  * 4: D/I - Data or Instruction is connected to B2              ////
////  * 5: R/W - Read or Write is connected to B4                    ////
////  * 6: Enable is connected to B5                                 ////
////  *7-14: Data Bus 0 to 7 is connected to port d                  ////
////  *15: Chip Select 1 is connected to B0                          ////
////  *16: Chip Select 2 is connected to B1                          ////
////  *17: Reset is connected to C0                                  ////
////  *18: Negative voltage is also connected to the 20k Ohm POT     ////
////  *19: Positive voltage for LED backlight is connected to +5V    ////
////  *20: Negavtive voltage for LED backlight is connected to GND

My coding are as below:
#include <18F452.H>
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=20000000)
#include "GLCD.c"

void main()
{
   //int x2=0,y2=0;
   
   char text[30]="HELLO WORLD";   //
   glcd_init(ON);
   delay_ms(500);
   glcd_fillScreen(OFF);
   //while(1)
   //{
     
      glcd_text57(0,0,text,1,ON);   //
      //delay_ms(1000);
   //}
 }

What I got from simulation and hardware:
http://img714.imageshack.us/i/96204517.png
Your kind help about this matter are much appreciated.
Markdem



Joined: 24 Jun 2005
Posts: 206

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

PostPosted: Thu Jan 13, 2011 9:39 pm     Reply with quote

You did not say if you are using the standard CCS driver, so I will assume so.

The issue here is the driver is written for 4Mhz operation. You are running is at 20Mhz, so the timings are wrong.

Have a look at the driver and you will see some "delay_cycle(1)" lines. Change the delay to the smallest number that works for you. I would start at 10 and workdown.

Maybe there is a better way to fix this, but this has always worked for me.

Mark
takumi



Joined: 07 Mar 2009
Posts: 14

View user's profile Send private message

PostPosted: Wed Jan 19, 2011 1:56 am     Reply with quote

Tq Markdem, I've learned something from your answer. But how about a GLCD TGL12864E which didn't have any CS pins? Which driver of CCS is suitable?

1. vss
2. vdd
3. vo
4. rs
5. r/w
6. e
7. DB0
8. DB1
9. DB2
10. DB3
11. DB4
12. DB5
13. DB6
14. DB7
15. PSB
16. NC
17. /RST
18. NC
19. LEDK
20. LEDA
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