Joined: 25 Jun 2004 Posts: 17 Location: Cremona (Italy)
GLCD whit PIC18F8720
Posted: Mon Jul 12, 2004 2:12 pm
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
Posted: Wed Jul 14, 2004 2:35 pm
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)
Posted: Mon Jul 19, 2004 1:25 pm
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.
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