Hey all! I’ve gotten a Crystalfontz 128x64 Graphic LCD from Jim right before the break and I’ve been digging through code to make the silly thing talk. He suggested that i post for all to see.
The model number is CFAG12864S-TMI-VT
Here’s the manual for the driver: crystalfontz.com/products/document/2498/CFAG12864STMIVT.pdf
So far I’ve initialized the GLCD in 4-bit mode(baby steps :mrgreen: ) but i’m stuck on how to write things like characters and pixels to the display. I know Jim has said he’s worked with parallel displays before and the manual is greek to me for the most part(hey, i’m only 17 i’m still learning ) I need a little help deciphering this thing if you guys have any insight for me. I’m willing to put a lot of effort into this i just need a guiding hand.
Also I managed to use the basic arduino liquidCrystal library to upload the example hello world. Too bad the library code doesn’t explain how the print() function works.
Here’s my code so far:
byte data_pins[4];
byte rs_pin;
byte enable_pin;
void setup()
{
initDisplay(2, 3, 8, 9, 10, 11);
send(0x50, 1);
}
void write4bits(int value)
{
for(int i = 0; i < 4; i++)
{
pinMode(data_pins*, OUTPUT);
digitalWrite(data_pins*, (value >> i) & 0x01);
}
pulseEnable();
}
void send(int value, boolean mode)
{
digitalWrite(rs_pin, mode);
write4bits(value >> 4);
write4bits(value);
}
void initDisplay(byte RS, byte EN, byte D4, byte D5, byte D6, byte D7)
{
enable_pin = EN;
rs_pin = RS;
data_pins[0] = D4;
data_pins[1] = D5;
data_pins[2] = D6;
data_pins[3] = D7;
pinMode(rs_pin, OUTPUT);
pinMode(enable_pin, OUTPUT);
digitalWrite(rs_pin, LOW);
digitalWrite(enable_pin, LOW);
delayMicroseconds(50000);
send(0x02, 0);
delayMicroseconds(4500);
send(0x20, 0);
delayMicroseconds(150);
send(0x20, 0);
send(0x0F, 0);
send(0x01, 0);
send(0x02, 0);
}
void pulseEnable()
{
digitalWrite(enable_pin, LOW);
delayMicroseconds(1);
digitalWrite(enable_pin, HIGH);
delayMicroseconds(1);
digitalWrite(enable_pin, LOW);
delayMicroseconds(110);
}
void loop()
{
}
Let me know what you think or if you can lend me a hand! I’ll be continuing to work on it in the mean time!**