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 support@ccsinfo.com

GLCD whit PIC18F8720

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
a.fava



Joined: 25 Jun 2004
Posts: 17
Location: Cremona (Italy)

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

GLCD whit PIC18F8720
PostPosted: Mon Jul 12, 2004 2:12 pm     Reply with quote

Embarassed
HELLO,

I have Had The charge to Modify An Equipment Equipped With A Microcontreller Card Based On the PIC18F8270 With Clock @ 20 MHz.
I Should add to it a graphics LCD Display.
I have effected some tests; the result has not been satisfactory.
The GLCD is of the Cristalfontz Mod. CFAG12864B-TMI-V.
Trying with program of example of the CCS-C compiler - EX_GLCD.
The graphic objects is visible, accompanied by pixel they ignite and they extingished in random mode.
The image is very bad.
Is someone able to give me help?
Escuse me my bad english.
konradb
Guest







I use this display OK
PostPosted: Wed Jul 14, 2004 2:35 pm     Reply with quote

I use the same display OK.
There are some timing problems with the CCS driver.
Add the delays below.


Code:

// Purpose:       Write a byte of data to the specified chip
// Inputs:        chipSelect - which chip to write the data to
//                data - the byte of data to write
glcd_writeByte(int8 chip, int8 data)
{

   if(chip == GLCD_CS1)       // Choose which chip to write to
      output_high(GLCD_CS1);
   else
      output_high(GLCD_CS2);

   output_low(GLCD_RW);       // Set for writing
   output_d(data);            // Put the data on the port
delay_us(2);
   output_high(GLCD_E);       // Pulse the enable pin
   delay_us(2);
   output_low(GLCD_E);
delay_us(2);
   output_low(GLCD_CS1);      // Reset the chip select lines
   output_low(GLCD_CS2);

}


// Purpose:       Reads a byte of data from the specified chip
// Ouputs:        A byte of data read from the chip
int8 glcd_readByte(int8 chip)
{
   int8 data;                 // Stores the data read from the LCD
   if(chip == GLCD_CS1)       // Choose which chip to read from
   {
      output_high(GLCD_CS1);
   }
   else
   {
      output_high(GLCD_CS2);
   }
   set_tris_d(0xFF);

   delay_us(2);  //added delay
   output_high(GLCD_RW);      // Set for reading
   delay_us(2);   //added delay
   output_high(GLCD_E);       // Pulse the enable pin
   delay_us(2);
   output_low(GLCD_E);
   delay_us(2);
   output_high(GLCD_E);       // Pulse the enable pin
   delay_us(6);
   data = input_d();          // Get the data from the display's output register
   output_low(GLCD_E);
   output_low(GLCD_CS1);      // Reset the chip select lines
   output_low(GLCD_CS2);

   set_tris_d(0x00);

   return data;               // Return the read data
}

a.fava



Joined: 25 Jun 2004
Posts: 17
Location: Cremona (Italy)

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

PostPosted: Mon Jul 19, 2004 1:25 pm     Reply with quote

Very Happy

Hi Konradb,
thank you for the informations you gave me.
They've been very usefulad i solved my problem.
I expected it was a matter of timing and i started some tests.
Your reply saved me a lot of precious time.
Thank you again.

Alessandro
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