I am programming the CFAG160160 Graphic LCD... I tested it by just displaying simple ABC in the 1st line. All i get is just black strobing in the screen... i have the correct hardware... the pin1 and pin 2 are grounded right? I connected the FGND in the ground as stated in the other thread...
i used zilog encore in programming this... here is the sample of my program... what am i doing wrong?
PCOUT = 0x84 and PCOUT = 0x80 configuration is like this
PC7 - Enable
PC6 - Reset
PC5 - CS
PC4 - X (don't care)
PC3 - R/W
PC2 - RS
PC1 - X
PC0 - X
since i have to access the instruction reg first, R/W is 1 therefore 0x84
then when instructing the mode reg. R/W is 0 => 0x80
please help.. what am i doing wrong? nobody in my school has ever used graphic LCD display. I don't have anyone to ask for help for this.
i used zilog encore in programming this... here is the sample of my program... what am i doing wrong?
Code:
#include <stdio.h>
#include <eZ8.h>
/***************************************************************************************************/
/* GPIO Initialization */
/***************************************************************************************************/
void GPIOinit(void)
{
PGAF = 0x00; // Port G, alternate function not used
PGDD = 0x00; // Data Direction, Output
PFAF = 0x00; // Port F, alternate function not used
PFDD = 0x00; // Data Direction, Output
/*
LCD GPIO
LCD input RW RS DB7:0
Zilog output PC3 PC2 PE7:0
LCD input enable reset chipenable
Zilog output PC7 PC6 PC5
'1' '0' '0'
from SMSpic RB3 RB2 RB1 RB0
to Zilog input PD7 PD5 PD3 PD1
*/
PDAF = 0x00; // Port C, alternate function not used
PDDD = 0xFF; // Data Direction, Input
PCAF = 0x00; // Port C, alternate function not used
PCDD = 0x00; // Data Direction, Output
PEAF = 0x00; // Port E, alternate function not used
PEDD = 0x00; // Data Direction, Output
}
/*-------------------------------------------------------------------------------------------------*/
main()
{
GPIOinit();
PCOUT = 0X84; PEOUT = 0x01;
PCOUT = 0x80; PEOUT = 0X87;
PCOUT = 0X84; PEOUT = 0x02;
PCOUT = 0x80; PEOUT = 0x13;
PCOUT = 0X84; PEOUT = 0x03;
PCOUT = 0x80; PEOUT = 0XA0;
PCOUT = 0X84; PEOUT = 0x04;
PCOUT = 0x80; PEOUT = 0x07;
PCOUT = 0X84; PEOUT = 0x0A;
PCOUT = 0x80; PEOUT = 0X00;
PCOUT = 0X84; PEOUT = 0x0B;
PCOUT = 0x80; PEOUT = 0x00;
PCOUT = 0X84; PEOUT = 0x0C;
PCOUT = 0x80; PEOUT = 0x41;
PCOUT = 0X84; PEOUT = 0x0C;
PCOUT = 0x80; PEOUT = 0X42;
PCOUT = 0X84; PEOUT = 0x0C;
PCOUT = 0x80; PEOUT = 0x43;
}
PC7 - Enable
PC6 - Reset
PC5 - CS
PC4 - X (don't care)
PC3 - R/W
PC2 - RS
PC1 - X
PC0 - X
since i have to access the instruction reg first, R/W is 1 therefore 0x84
then when instructing the mode reg. R/W is 0 => 0x80
please help.. what am i doing wrong? nobody in my school has ever used graphic LCD display. I don't have anyone to ask for help for this.
Looking for additional LCD resources? Check out our LCD blog for the latest developments in LCD technology.