Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to interface Oriole GLCD with pic16f72 or any any other pic16f microcontroller.

Status
Not open for further replies.

pradipmagar001@gmail.com

Newbie level 4
Joined
Jul 25, 2012
Messages
6
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
India
Activity points
1,382
I facing problem in oriole glcd interfacing with pic16f72. No any interfacing example is provided by oriole India.Also display controller is not regular one.Please provide connection diagram and help in c-source code writing for it.
GLCD details are as follows:
OEL/PD/OGM 12864SLW/A
128*64
Controller IC datasheet –AVANT SBN0064G

link for controller ic datasheet
**broken link removed**
:-(
 

this is the code i have prepared for my glcd interfacing..but glcd giving blank display only..I am not getting whats the problem..i have checked all the hardware it is ok...please give some suggestions..this is the 1st time i am interfacing GLCD...GLCD details are given int my 1st post..]



/*program for GLCD interfacing with pic16f72*/

#include <htc.h>


__CONFIG(WDTE_OFF & FOSC_HS & CP_OFF & BOREN_ON & PWRTE_OFF);

#define _XTAL_FREQ 12000000

#define data PORTB
#define DI PORTCbits.RC4
#define RW PORTCbits.RC5
#define EN PORTCbits.RC6
#define CS1 PORTCbits.RC2
#define CS2 PORTCbits.RC3
#define RST PORTCbits.RC1
bit chip2=0;
/*----------variable defination------------ */
bit chip2=0;
unsigned int status,comm,dat;
unsigned int count,x_count=0xb8,y_count=0x40;



/*const int pro0[64]={0x7E,0x09,0x09,0x09,0x7E,0x00,0x00,0x00,
0x7F,0x49,0x49,0x49,0x36,0x00,0x00,0x00,
0x1C,0x22,0x41,0x41,0x41,0x00,0x00,0x00,
0x7F,0x41,0x41,0x22,0x1C,0x00,0x00,0x00,
0x7F,0x49,0x49,0x49,0x49,0x00,0x00,0x00,
0x7F,0x09,0x09,0x09,0x01,0x00,0x00,0x00,
0x1C,0x22,0x41,0x49,0x79,0x00,0x00,0x00,
0x7F,0x08,0x08,0x08,0x7F,0x00,0x00,0x00}; // //Test code

*/
const char image1[]=
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x7F, 0x09, 0x19, 0x29, 0x46, 0x00, 0x00,
0x00, 0x3E, 0x41, 0x41, 0x41, 0x3E, 0x00, 0x00,
0x00, 0x7F, 0x40, 0x40, 0x40, 0x40, 0x00, 0x00,
0x00, 0x7F, 0x40, 0x40, 0x40, 0x40, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x7F, 0x04, 0x08, 0x10, 0x7F, 0x00, 0x00,

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

0x00, 0x7F, 0x09, 0x19, 0x29, 0x46, 0x00, 0x00,
0x00, 0x7E, 0x11, 0x11, 0x11, 0x7E, 0x00, 0x00,
0x00, 0x7F, 0x02, 0x0C, 0x02, 0x7F, 0x00, 0x00,
0x00, 0x7E, 0x11, 0x11, 0x11, 0x7E, 0x00, 0x00,
0x00, 0x7F, 0x04, 0x08, 0x10, 0x7F, 0x00, 0x00,
0x00, 0x7E, 0x11, 0x11, 0x11, 0x7E, 0x00, 0x00,
0x00, 0x01, 0x01, 0x7F, 0x01, 0x01, 0x00, 0x00,
0x00, 0x7F, 0x08, 0x08, 0x08, 0x7F, 0x00, 0x00,

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x3E, 0x41, 0x49, 0x49, 0x3A, 0x00, 0x00,
0x00, 0x3E, 0x41, 0x41, 0x41, 0x3E, 0x00, 0x00,
0x00, 0x7F, 0x09, 0x09, 0x09, 0x06, 0x00, 0x00,
0x00, 0x7E, 0x11, 0x11, 0x11, 0x7E, 0x00, 0x00,
0x00, 0x7F, 0x40, 0x40, 0x40, 0x40, 0x00, 0x00,
0x00, 0x7E, 0x11, 0x11, 0x11, 0x7E, 0x00, 0x00,

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

0x00, 0x00, 0x42, 0x7F, 0x40, 0x00, 0x00, 0x00,
0x00, 0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00, 0x00,
0x00, 0x00, 0x36, 0x36, 0x00, 0x00, 0x00, 0x00,
0x00, 0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00, 0x00,
0x00, 0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00, 0x00,
0x00, 0x7E, 0x11, 0x11, 0x11, 0x7E, 0x00, 0x00,
0x00, 0x7F, 0x02, 0x0C, 0x02, 0x7F, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

0x00, 0x00, 0x42, 0x7F, 0x40, 0x00, 0x00, 0x00,
0x00, 0x36, 0x49, 0x49, 0x49, 0x36, 0x00, 0x00,
0x00, 0x20, 0x10, 0x08, 0x04, 0x02, 0x00, 0x00,
0x00, 0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00, 0x00,
0x00, 0x01, 0x71, 0x09, 0x05, 0x03, 0x00, 0x00,
0x00, 0x20, 0x10, 0x08, 0x04, 0x02, 0x00, 0x00,
0x00, 0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00, 0x00,
0x00, 0x06, 0x49, 0x49, 0x29, 0x1E, 0x00, 0x00,
};


const char image2[]=
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

0x00, 0x3E, 0x41, 0x41, 0x41, 0x3E, 0x00, 0x00,
0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00,
0x00, 0x00, 0x42, 0x7F, 0x40, 0x00, 0x00, 0x00,
0x00, 0x42, 0x61, 0x51, 0x49, 0x46, 0x00, 0x00,
0x00, 0x21, 0x41, 0x45, 0x4B, 0x31, 0x00, 0x00,
0x00, 0x18, 0x14, 0x12, 0x7F, 0x10, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

0x00, 0x7E, 0x11, 0x11, 0x11, 0x7E, 0x00, 0x00,
0x00, 0x7F, 0x04, 0x08, 0x10, 0x7F, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x7F, 0x09, 0x19, 0x29, 0x46, 0x00, 0x00,
0x00, 0x7E, 0x11, 0x11, 0x11, 0x7E, 0x00, 0x00,
0x00, 0x20, 0x40, 0x41, 0x3F, 0x01, 0x00, 0x00,
0x00, 0x20, 0x40, 0x41, 0x3F, 0x01, 0x00, 0x00,
0x00, 0x3F, 0x40, 0x40, 0x40, 0x3F, 0x00, 0x00,

0x00, 0x3E, 0x41, 0x41, 0x41, 0x22, 0x00, 0x00,
0x00, 0x7F, 0x08, 0x08, 0x08, 0x7F, 0x00, 0x00,
0x00, 0x7E, 0x11, 0x11, 0x11, 0x7E, 0x00, 0x00,
0x00, 0x7F, 0x09, 0x19, 0x29, 0x46, 0x00, 0x00,
0x00, 0x00, 0x41, 0x7F, 0x41, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x1F, 0x20, 0x40, 0x20, 0x1F, 0x00, 0x00,
0x00, 0x00, 0x41, 0x7F, 0x41, 0x00, 0x00, 0x00,
0x00, 0x00, 0x41, 0x7F, 0x41, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x7E, 0x11, 0x11, 0x11, 0x7E, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x7F, 0x09, 0x09, 0x09, 0x06, 0x00, 0x00,
0x00, 0x7F, 0x09, 0x19, 0x29, 0x46, 0x00, 0x00,
0x00, 0x7F, 0x49, 0x49, 0x49, 0x41, 0x00, 0x00,
0x00, 0x46, 0x49, 0x49, 0x49, 0x31, 0x00, 0x00,
0x00, 0x7F, 0x49, 0x49, 0x49, 0x41, 0x00, 0x00,
0x00, 0x7F, 0x04, 0x08, 0x10, 0x7F, 0x00, 0x00,
0x00, 0x01, 0x01, 0x7F, 0x01, 0x01, 0x00, 0x00,
};


/*----------function defination------------*/
void data_wr();
void command_wr();
void command_rd();
void check_sts();
void init_lcd();
void clr_disp();
//void delay_ms(unsigned int count);
void disp_data();


void main()
{


unsigned int i;


TRISC=0;
TRISB=0;

for(i=0;i<2;i++)
{
if(i==1)
chip2=1; //enabling chip2

init_lcd();
__delay_ms(1);

disp_data();
chip2=0; //disabling chip2
}

while(1);
}

/*-----------initiating the LCD-------------*/
void init_lcd()
{
RST=0;
__delay_ms(4);
RST=1;
__delay_ms(4);

EN=0;
DI=0; //selecting command
RW=0; //selecting write option. i.e.command write

CS1=0; //deselecting chip select1
CS2=0; //deselecting chip select2

__delay_ms(1);
/*-------initialising the LCD--------*/

comm=0x3f; //display on
check_sts();
command_wr();

comm=0xc0; //display start line 00
check_sts();
command_wr();
__delay_ms(1);

clr_disp();
__delay_ms(1);
}

/*-----------prototype for writing command------------------*/


void command_wr()
{
EN=0;
__delay_ms(1);

RW=0; //instruction write

if(!chip2)
{
CS1=1; //selecting chip select1
CS2=0; //deselecting chip select2
}
else
{
CS1=0; //deselecting chip select1
CS2=1; //selecting chip select2
}

DI=0;

data=comm;

EN=1;
__delay_ms(1);
EN=0;

}

/*------------prototype for writing data---------------------*/
void data_wr()
{
EN=0;
__delay_ms(1);

RW=0; //data write

if(!chip2)
{
CS1=1; //selecting chip select1
CS2=0; //deselecting chip select2
}
else
{
CS1=0; //deselecting chip select1
CS2=1; //selecting chip select2
}

DI=1;

__delay_ms(1);

data=dat;

EN=1;
__delay_ms(1);
EN=0;
__delay_ms(1);
}

/*-------------prototype for reading the command----------------*/
void command_rd()
{
EN=0;
__delay_ms(1);

RW=1; //instruction read

if(!chip2)
{
CS1=1; //selecting chip select1
CS2=0; //deselecting chip select2
}
else
{
CS1=0; //deselecting chip select1
CS2=1; //selecting chip select2
}

DI=0;

__delay_ms(1);

status=data;

EN=1;
__delay_ms(1);
EN=0;
__delay_ms(1);


RW=0;
__delay_ms(1);
EN=1;

}

/*---------------prototype for checking the status---------------*/
void check_sts()
{
__delay_ms(1);
TRISB=0xff; //making PORT0 as input
__delay_ms(1); //1ms delay

command_rd();

while((status & 0x80) != 0x80) //checking whether STA0 & STA1 are set or not
{
command_rd();
status=status & 0x80;
}
__delay_ms(1);
TRISB=0x00; //making PORT0 as output
//TRISC=0x00;
}


/*-----------prototype for delay generating function------------*/
/*void delay_ms(unsigned int count)
{
unsigned int i;
while(count--)
{
for(i=0;i<100;i++);
}
}
*/
/*------------prototype for clearing the display----------------*/
void clr_disp()
{
unsigned int j;

for(x_count=0xb8; x_count<0xc0; x_count++)
{
comm=x_count; //initially it is 0xb8
check_sts();
command_wr();

comm=y_count; //initially it is 0x40
check_sts();
command_wr();

for(j=0; j<64; j++,y_count++)
{
dat=0x00;
data_wr();
}

y_count=0x40;
}
}

/*--------------prototype for displaying data-----------------*/
void disp_data()
{
unsigned int k=0;

comm=0xb8; //setting starting x-address
check_sts();
command_wr();

comm=0x40; //setting starting y-address
check_sts();
command_wr();

for(x_count=0xb8;x_count<0xc0;)
{
for(count=0; count<64; k++,count++)
{
if(!chip2)
dat=image1[k];
else
dat=image2[k];
data_wr();
}

x_count++;
comm=x_count;
check_sts();
command_wr();
}

}
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top