pappu_sam
Member level 1
hi all,
am working on GLCD, JHD12864E, its a 128x64 GLCD.
am using pic18F4620 microcontroller.
please tell me how to connect to the contrast pin and Vee(-10V) pins.
i cant able to understand what is the problem with it.
am trying to intialize it,
what wl b the problem please rectify it.
my code is
#include<p18f4620.h>
void delay(char );
#define E PORTAbits.RA2
#define CS1 PORTAbits.RA3
#define CS2 PORTAbits.RA4
#define RS PORTAbits.RA0
#define RST PORTAbits.RA5
#define DATA PORTD
#define RW PORTAbits.RA1
void delay(char j)
{
int i,k;
for(k=0;k<=j;k++)
{
for(i=0;i<=1247;i++);
}
}
void main(void)
{
char read;
TRISD=0x00;
TRISA=0x00;
TRISB=0x00;
E=0;
CS1=0;
CS2=0;
RS=0;
RW=0;
RST=1;
DATA=0x00;
while(1)
{
PORTB=0xFF;
E=1;
RW=0;
CS1=1;
CS2=1;
RS=0;
DATA=0x3F;
delay(1);
E=0;
PORTB=0x00;
delay(80);
PORTB=0xFF;
E=1;
RW=0;
CS1=1;
CS2=1;
RS=0;
DATA=0xb8;
delay(1);
E=0;
PORTB=0x00;
delay(80);
PORTB=0xFF;
E=1;
RW=0;
CS1=1;
CS2=1;
RS=0;
DATA=0x40;
delay(1);
E=0;
PORTB=0x00;
delay(80);
PORTB=0xFF;
E=1;
RW=0;
CS1=1;
CS2=1;
RS=0;
DATA=0x80;
delay(1);
E=0;
PORTB=0x00;
delay(80);
PORTB=0xFF;
E=1;
RW=0;
CS1=1;
CS2=1;
RS=0;
DATA=0xc0;
delay(1);
E=0;
PORTB=0x00;
delay(80);
}
}
am working on GLCD, JHD12864E, its a 128x64 GLCD.
am using pic18F4620 microcontroller.
please tell me how to connect to the contrast pin and Vee(-10V) pins.
i cant able to understand what is the problem with it.
am trying to intialize it,
what wl b the problem please rectify it.
my code is
#include<p18f4620.h>
void delay(char );
#define E PORTAbits.RA2
#define CS1 PORTAbits.RA3
#define CS2 PORTAbits.RA4
#define RS PORTAbits.RA0
#define RST PORTAbits.RA5
#define DATA PORTD
#define RW PORTAbits.RA1
void delay(char j)
{
int i,k;
for(k=0;k<=j;k++)
{
for(i=0;i<=1247;i++);
}
}
void main(void)
{
char read;
TRISD=0x00;
TRISA=0x00;
TRISB=0x00;
E=0;
CS1=0;
CS2=0;
RS=0;
RW=0;
RST=1;
DATA=0x00;
while(1)
{
PORTB=0xFF;
E=1;
RW=0;
CS1=1;
CS2=1;
RS=0;
DATA=0x3F;
delay(1);
E=0;
PORTB=0x00;
delay(80);
PORTB=0xFF;
E=1;
RW=0;
CS1=1;
CS2=1;
RS=0;
DATA=0xb8;
delay(1);
E=0;
PORTB=0x00;
delay(80);
PORTB=0xFF;
E=1;
RW=0;
CS1=1;
CS2=1;
RS=0;
DATA=0x40;
delay(1);
E=0;
PORTB=0x00;
delay(80);
PORTB=0xFF;
E=1;
RW=0;
CS1=1;
CS2=1;
RS=0;
DATA=0x80;
delay(1);
E=0;
PORTB=0x00;
delay(80);
PORTB=0xFF;
E=1;
RW=0;
CS1=1;
CS2=1;
RS=0;
DATA=0xc0;
delay(1);
E=0;
PORTB=0x00;
delay(80);
}
}