Notlar..

320volt / Mikrodenetleyici Projeleri/

Nokia 3510i lcd (S1D15G14) arayüz hitech pic16f628

Mikrodenetleyici Projeleri, blog arşivinde NOKIA 3510I LCD (S1D15G14) ARAYÜZ HITECH PIC16F628 konusu "3510 hitech* grafik lcd* hitech c* microchip pic projeleri* nokia 3510i lcd* PIC16F628* s1d15g14* " ile etiketlendi

Epson S1D15G14 entegresini kullanan Nokia 3510i grafik lcd kullanımı için hazırlanmış bir devre projenin yazılımı Hi-tech C ile hazırlanmış mikro denetleyici ise pic 16f628

Kaynak: 3510i-Epson S1D15G14-PIC16f628-interface-written- Hi-tech C Tüm projeler için Alternatif link: nokia-3510i-lcd-s1d15g14-arayuz-hitech-pic16f628.RAR alternatif link 2: nokia-3510i-lcd-s1d15g14-arayuz-hitech-pic16f628

nokia 3510i hitech pic16f628

colorlcd.c içeriği




//_______________________________________________________________________________________________________

//		PIC to Nokia color LCD (type Epson S1D15G14) driving routines written Hi-Tech C	

//		written by Ramandeep Singh ©2004                               				

//		www.spiralbrain.tk or  http://67.15.78.55/~spiral/    	    		

//		spiralbrain@yahoo.com							

//		Date: 21 Nov 2004							

//		main file.	

//											

//_______________________________________________________________________________________________________



#include "pic.h"		

#include "delay.h"		

#include "delay.c"



__CONFIG(0x3f10);				

 

void send(unsigned char data, unsigned char cd);

void cs(void);



#define SCLK	RB0

#define SDATA	RB1

#define CS		RB2

#define RESET	RB3



#define CMD		0

#define DATA	1

	

	unsigned char c;

void main(void)

	{

	unsigned int i;

	unsigned char  s,a;



	TRISB = 0x00;		// portB is output; (NOKIA LCD = portB)

	TRISA = 0x00;

	CMCON = 0b00000111;	// disable comparators

	PORTB = 0x00;		// all low

	PORTA = 0x00;



		DelayMs(250);

	

	// LCD Hardware Reset

	RESET=0;

	DelayMs(5);

	RESET=1;

	

	CS=1;

	SCLK=1;

	SDATA=1;

	

	send(0x01, CMD);		// LCD Software Reset

	cs();

	DelayMs(5);

	

	send(0xC6, CMD);		// Initial Escape

	cs();

	

	send(0xB9, CMD);		// Refresh set

	send(0x00, DATA);

	cs();

	

	send(0xB6, CMD);		// Display Control

	send(128, DATA);

	send(128, DATA);

	send(129, DATA);

	send(84, DATA);

	send(69, DATA);

	send(82, DATA);

	send(67, DATA);

	cs();

	

	send(0xB3, CMD);		// Gray Scale Position

	send(1, DATA);

	send(2, DATA);

	send(4, DATA);

	send(8, DATA);

	send(16, DATA);

	send(30, DATA);

	send(40, DATA);

	send(50, DATA);

	send(60, DATA);

	send(70, DATA);

	send(80, DATA);

	send(90, DATA);

	send(100, DATA);

	send(110, DATA);

	send(127, DATA);

	cs();

	

	send(0xB5, CMD);		// Gamma Curve Set

	send(1, DATA);

	cs();

	

	send(0xBE, CMD);		// Power Control

	send(4, DATA);

	cs();

	

	send(0x11, CMD);		// Sleep out

	cs();

	

	send(0xB7, CMD);		// Temperature gradient set

	for(i=0; i<14; i++) {

		send(0, DATA);

	}

	cs();

	

	send(0x03, CMD);		// Booster Voltage ON

	cs();

	

		DelayMs(40);



	

	send(0x20, CMD);		// Inversion control

	cs();

	

	send(0x25, CMD);		// Write contrast

	send(75, DATA);  //was 63

	cs();



	send(0x29, CMD);		// Display On

	cs();



	send(0x2C, CMD);		// Memory Write

	

for(a=0;a<4;a++)

{



	s=0;

	for(i=0; i<294; i++) {

		if(s == 0) send(15, DATA);			//	15

		else if(s == 1) send(240, DATA);	//  240

		else if(s == 2) send(255, DATA);	//	255

		

		if(++s == 3)

			s = 0;

	}

	



	s=0;

	for(i=0; i<294; i++) {

		if(s == 0) send(240, DATA);

		else if(s == 1) send(255, DATA);

		else if(s == 2) send(15, DATA);

		

		if(++s == 3)

			s = 0;

	}

	



	s=0;

	for(i=0; i<294; i++) {

		if(s == 0) send(255, DATA);

		else if(s == 1) send(15, DATA);

		else if(s == 2) send(240, DATA);

		if(++s == 3)

			s = 0;

	}

	



	s=0;

	for(i=0; i<294; i++) {

		if(s == 0) send(0, DATA);

		else if(s == 1) send(240, DATA);

		else if(s == 2) send(15, DATA);

		

		if(++s == 3)

			s = 0;

	}

	

				

	s=0;

	for(i=0; i<294; i++) {

		if(s == 0) send(15, DATA);  

		else if(s == 1) send(0, DATA);

		else if(s == 2) send(240, DATA);

		

		if(++s == 3)

			s = 0;

	}

	



	s=0;

	for(i=0; i<294; i++) {

		if(s == 0) send(240, DATA);

		else if(s == 1) send(15, DATA);

		else if(s == 2) send(0, DATA);

		

		if(++s == 3)

			s = 0;

	}

	



	for(i=0; i<294; i++) {

		send(0, DATA);

	}

	



	for(i=0; i<294; i++) {

		send(255, DATA);

	}

	cs();

	}

	send(0x29, CMD);		// Display On

	cs();

	

	while(1) {





	send(0x21, CMD);		// Initial Escape

	cs();



DelayMs(250);

DelayMs(250);

	send(0x20, CMD);		// Initial Escape

	cs();

DelayMs(250);

DelayMs(250);

}



		}

void send(unsigned char data, unsigned char cd) {

	

	CS=0;





	SCLK=0;

	if(cd == CMD)

		SDATA=0;

	else

		SDATA=1;

	SCLK=1;



	for (c=8;c>0;c--) {

		SCLK=0;

		if ((data&0x80)==0){

		SDATA=0;

		 							}

		else {

		SDATA=1;

				}

		SCLK=1;

		data=data<<1;

					}



}



void cs(void) {

	CS=1;	// CS = 1

}