attiny2313 ile 2x16 lcd sürme sorunu?

Başlatan forumsad, 15 Haziran 2011, 13:28:37

forumsad

arkadaşlar denemelerime devam ediyorum sırada 2x16 karakter lcd'yi attiny2313 ile sürmek var

öncelikle  devremi aşağıdaki şekilde hazırladım..

PB7--D14
PB6--D13
PB5--D12
PB4--D11
PB3--D4-RS
PB2--D5-R/W
PB1--D6-E

WEB'DEN bulduğum örnekleri bu bağlantı sekline göre ayarlayamadım.....
hale hazırda 4 bit lcd için portb için ayarlı bir lcd.c ve lcd.h dosyası verebilirmisiniz

saygılarımla

forumsad

aşağıdaki dosyalar uygun ama çalıştıramadım çeşitli değişiklikler yaptım olmadı...


lcd_4bit.c
/*
**	Project:	4-Bit LCD
**	Purpose:	Interface a Hitachi-compatible LCD screen to an 8-bit
**				microcontroller making use of 7 bits of any port.  Timer
**				delay functions are used as the ready flag polling
**				is not needed in some applications.
**
**	Author:		Steven Pickles
**	Date:		Friday, April 22, 2005
**
**	Notes:		(1)	The LCD pinout is as follows:
**
**					01 - Ground (Vss)
**					02 - 5V Power (Vcc)
**					03 - Contrast (Vo)
**					04 - Register Select (RS)
**					05 - Read/Write_L (R/W_L)
**					06 - Enable (E)
**					07 - Data 0 (DB0)
**					08 - Data 1 (DB1)
**					09 - Data 2 (DB2)
**					10 - Data 3 (DB3)
**					11 - Data 4 (DB4)
**					12 - Data 5 (DB5)
**					13 - Data 6 (DB6)
**					14 - Data 7 (DB7)
**					15 - Backlight 5V Power (use 10 ohm resistor)
**					16 - Ground (Vss)
**
**				(2)	The port pinout is considered to be the following:
**
**					P7 - No connect (NC)
**					P6 - Enable (E)
**					P5 - Read/Write_L (R/W_L)
**					P4 - Register Select (RS)
**					P3 - Data 7 (DB7)
**					P2 - Data 6 (DB6)
**					P1 - Data 5 (DB5)
**					P0 - Data 4 (DB4)
*/



/*
**	Compiler Include Directives
*/
#include "lcd_4bit.h"



/*
**	Global Variables
*/

volatile uint8_t position;



/*
**	Function Declarations
*/

/*
**	Function:		initializeLCD
**	Parameters:		<none>
**	Purpose:		Initializes the LCD into the following mode:
**					<some mode>
**	Returns:		<none>
*/
void initializeLCD(void)
{
	//	Initialize the delay50us timer for microseconds
	initializeDelayTimerMicrosecond();
	
	//	Set the position counter to 0
	position = 0;
	
	//	Set the proper data direction for output
	LCD_DDR = 0x7f;

	//	First, delay50us for at least 15ms after power on
	delay50us(300);
	
	//	Set for 4-bit LCD mode
	writeNibbleToLCD(COMMAND_REGISTER, 0x03);
	delay50us(100);
	writeNibbleToLCD(COMMAND_REGISTER, 0x03);
	delay50us(100);
	writeNibbleToLCD(COMMAND_REGISTER, 0x03);
	delay50us(100);
	writeNibbleToLCD(COMMAND_REGISTER, 0x02);
	delay50us(100);
	
	//	Function set
	writeByteToLCD(COMMAND_REGISTER, 0x28);
	delay50us(250);
	
	//	Turn display off
	writeByteToLCD(COMMAND_REGISTER, 0x08);
	delay50us(250);
	
	//	Clear LCD and return home
	writeByteToLCD(COMMAND_REGISTER, 0x01);
	delay50us(250);
	
	//	Turn on display, turn off cursor and blink
	//writeByteToLCD(COMMAND_REGISTER, 0x0c);
	writeByteToLCD(COMMAND_REGISTER, 0x0f);   // blinking cursor
	delay50us(250);
}


/*
**	Function:		waitForLCD
**	Parameters:		<none>
**	Purpose:		Polls the ready bit on the LCD to ensure that the
**					LCD is able to receive a new command or new data, or
**					delays for about 50 microseconds.
**	Returns:		<none>
*/
void waitForLCD(void)
{
	//	Poll the busy flag until it goes clear -- which means
	//	that new instructions may be given to the LCD screen
	//while((readByteFromLCD(COMMAND_REGISTER) & 0x80) == 0x80);
	
	//	Or.... delay 50us
	delay50us(1);
}


/*
**	Function:		writeNibbleToLCD
**	Parameters:		selectedRegister - either the command or data register
**									   that will be written to
**					nibble - the four bits to be written to the LCD
**	Purpose:		Writes a nibble to the LCD.
**	Returns:		<none>
*/
void writeNibbleToLCD(uint8_t selectedRegister, uint8_t nibble)
{
	//	Pull the enable line high
	LCD_OUT = BV(ENABLE);

	//	Output the nibble to the LCD
	LCD_OUT |= nibble;
	
	//	Determine if the register select bit needs to be set
	if(selectedRegister == DATA_REGISTER)
	{
		//	If so, then set it
		LCD_OUT |= BV(RS);
	}
	else
	{
		//	Otherwise, clear the register select bit
		LCD_OUT &= ~BV(RS);
	}
	
	//	Toggle the enable line to latch the nibble
	LCD_OUT &= ~BV(ENABLE);
}

/*
**	Function:		writeByteToLCD
**	Parameters:		selectedRegister - either the command or data register
**									   that will be written to
**					byte - the eight bits to be written to the LCD
**	Purpose:		Writes and 8-bit value to the LCD screen.
**	Returns:		<none>
*/
void writeByteToLCD(uint8_t selectedRegister, uint8_t byte)
{
	//	Generate the high and low part of the bytes that will be
	//	written to the LCD
	uint8_t upperNibble = byte >> 4;
	uint8_t lowerNibble = byte & 0x0f;
	
	//	Assuming a 4 line by 20 character display, ensure that
	//	everything goes where it is supposed to go:
	if(selectedRegister == DATA_REGISTER && position == 20)
	{
		writeByteToLCD(COMMAND_REGISTER, 0xC0);
		delay50us(25);
	}
	else if(selectedRegister == DATA_REGISTER && position == 40)
	{
		writeByteToLCD(COMMAND_REGISTER, 0x94);
		delay50us(25);
	}
	else if(selectedRegister == DATA_REGISTER && position == 60)
	{
		writeByteToLCD(COMMAND_REGISTER, 0xd4);
		delay50us(25);
	}
	
	//	Wait for the LCD to become ready
	waitForLCD();
	
	//	First, write the upper four bits to the LCD
	writeNibbleToLCD(selectedRegister, upperNibble);
	
	//	Finally, write the lower four bits to the LCD
	writeNibbleToLCD(selectedRegister, lowerNibble);
	
	//	Reset the position count if it is equal to 80
	if(selectedRegister == DATA_REGISTER && ++position == 80)
		position = 0;
}

/*
**	Function:		readNibbleFromLCD
**	Parameters:		selectedRegister - either the command or data register
**									   that will be read from
**	Purpose:		Read a nibble from the LCD screen.
**	Returns:		nibble - the nibble that is read from the LCD
*/
uint8_t readNibbleFromLCD(uint8_t selectedRegister)
{
	//	Create a variable for the nibble
	uint8_t nibble = 0x00;
	
	//	Set the data direction for the incoming data
	LCD_DDR = 0x70;
	
	//	Turn on the enable, set the read/write pin to read
	//	and clear the rest of the port
	LCD_OUT |= BV(ENABLE) | BV(RW);
	
	//	Determine if the register select bit needs to be set
	if(selectedRegister == DATA_REGISTER)
	{
		//	If so, then set it
		LCD_OUT |= BV(RS);
	}
	else
	{
		//	Otherwise, clear the register select bit
		LCD_OUT &= ~BV(RS);
	}
	
	//	Wait some number of clock cycles for the data to become
	//	steady on the 4-bit data bus
	asm volatile("nop\n\t"::);
	asm volatile("nop\n\t"::);	
	
	//	Read the data bus and mask only the lower four bits of the port
	nibble = LCD_IN & 0x0f;
	
	//	Clear the enable
	LCD_OUT &= ~BV(ENABLE);
	
	//	Clear the read/write strobe
	LCD_OUT &= ~BV(RW);
	
	//	Return the data direction to the original state
	LCD_DDR = 0x7f;
	
	//	Finally, return the nibble
	return nibble;
}

/*
**	Function:		readByteFromLCD
**	Parameters:		selectedRegister - either the command or data register
**									   that will be read from
**	Purpose:		Read a byte from the LCD screen.
**	Returns:		byte - the byte that is read from the LCD
*/
uint8_t readByteFromLCD(uint8_t selectedRegister)
{
	//	Create variables for the lower and upper nibbles as well as the
	//	entire byte (a combination of the upper/lower nibbles, of course)
	uint8_t byte = 0x00;
	uint8_t upperNibble = 0x00;
	uint8_t lowerNibble = 0x00;
	
	//	Read the upper nibble
	upperNibble = readNibbleFromLCD(selectedRegister);

	//	Read the lower nibble
	lowerNibble = readNibbleFromLCD(selectedRegister);
	
	//	Combine the upper and lower nibbles to produce the full 8-bit byte
	byte = (upperNibble << 4) | lowerNibble;
	
	//	Finally, return the byte
	return byte;
}

/*
**	Function:		writeStringToLCD
**	Parameters:		stringPointer - a pointer to the array of characters
**									that will be written to the LCD
**	Purpose:		Writes a series of bytes to the LCD data register so
**					that a character array may be given and displayed.
**	Returns:		<none>
*/
void writeStringToLCD(uint8_t* stringPointer)
{
	//	So long as the data that is pointed to by the string pointer
	//	is valid (ie, not the null pointer) then the data will be written
	//	to the LCD
	while (*stringPointer)
		writeByteToLCD(DATA_REGISTER, *stringPointer++);
}

/*
**	Function:		writeIntegerToLCD
**	Parameters:		integer - the integer that will be written to the LCD
**	Purpose:		Coverts a standard 16-bit int into the ASCII
**					representation of the number and writes that number
**					to the LCD.
**					*** Note:	The maximum value that can be written is
**								9999.  This is because there is no
**								ten thousands place support.
**	Returns		<none>
*/
void writeIntegerToLCD(uint16_t integer)
{
	//	Break down the original number into the thousands, hundreds, tens,
	//	and ones places and then immediately write that value to the LCD
	uint8_t thousands = integer / 1000;
	writeByteToLCD(DATA_REGISTER, thousands + 0x30);
	
	uint8_t hundreds = (integer - thousands*1000) / 100;
	writeByteToLCD(DATA_REGISTER, hundreds + 0x30);
	
	uint8_t tens = (integer - thousands*1000 - hundreds*100 ) / 10;
	writeByteToLCD(DATA_REGISTER, tens + 0x30);
	
	uint8_t ones = (integer - thousands*1000 - hundreds*100 - tens*10);
	writeByteToLCD(DATA_REGISTER, ones + 0x30);
}

/*
**	Function:		clearLCD
**	Parameters:		<none>
**	Purpose:		Writes the "clear and go home" command to the LCD.
**	Returns:		<none>
*/
void clearLCD(void)
{
	//	Send command to LCD (0x01)
	writeByteToLCD(COMMAND_REGISTER, 0x01);
	
	//	Set the current position to 0
	position = 0;
}

/*
**	Function:		moveToXY
**	Parameters:		row - the row to be moved to
**					column - the column to be moved to
**	Purpose:		Moves the cursor to the requested (row, column) position
**					on the LCD.  This function was originally written by
**					William Dubel (dubel@ufl.edu).
**	Returns:		<none>
*/
void moveToXY(uint8_t row, uint8_t column)
{
	//	Determine the new position
	position = (row * 20) + column;
	
	//	Send the correct commands to the command register of the LCD
	if(position < 20)
		writeByteToLCD(COMMAND_REGISTER, 0x80 | position);
	else if(position >= 20 && position < 40)
		writeByteToLCD(COMMAND_REGISTER, 0x80 | (position % 20 + 0x40));
	else if(position >= 41 && position < 60)
		writeByteToLCD(COMMAND_REGISTER, 0x80 | (position % 40 + 0x14));
	else if(position >= 20 && position < 40)
		writeByteToLCD(COMMAND_REGISTER, 0x80 | (position % 60 + 0x54));
}



lcd_4bit.h
/*
**	Project:	4-Bit LCD
**	Purpose:	Interface a Hitachi-compatible LCD screen to an 8-bit
**				microcontroller making use of 7 bits of any port.  Timer
**				delay functions are used as the ready flag polling
**				is not needed in some applications.
**
**	Author:		Steven Pickles
**	Date:		Friday, April 22, 2005
**
**	Notes:		(1)	The LCD pinout is as follows:
**
**					01 - Ground (Vss)
**					02 - 5V Power (Vcc)
**					03 - Contrast (Vo)
**					04 - Register Select (RS)
**					05 - Read/Write_L (R/W_L)
**					06 - Enable (E)
**					07 - Data 0 (DB0)
**					08 - Data 1 (DB1)
**					09 - Data 2 (DB2)
**					10 - Data 3 (DB3)
**					11 - Data 4 (DB4)
**					12 - Data 5 (DB5)
**					13 - Data 6 (DB6)
**					14 - Data 7 (DB7)
**					15 - Backlight 5V Power (use 10 ohm resistor)
**					16 - Ground (Vss)
**
**				(2)	The port pinout is considered to be the following:
**
**					P7 - No connect (NC)
**					P6 - Enable (E)
**					P5 - Read/Write_L (R/W_L)
**					P4 - Register Select (RS)
**					P3 - Data 7 (DB7)
**					P2 - Data 6 (DB6)
**					P1 - Data 5 (DB5)
**					P0 - Data 4 (DB4)
*/

/*
**	Header File Information
*/
#ifndef __lcd_4bit_h__
#define __lcd_4bit_h__

/*
**	Compiler Include Directives
*/
#include <avr/io.h>
#include "delay.h"



/*
**	Compiler Define Directives
*/

//	LCD Port Information (from microcontroller)
#define	LCD_OUT		PORTA
#define	LCD_IN		PINA
#define	LCD_DDR		DDRA
#define	ENABLE		6
#define	RW			5
#define	RS			4
#define	D7			3
#define	D6			2
#define	D5			1
#define	D4			0

//	Register Select Constants
#define	DATA_REGISTER		0
#define	COMMAND_REGISTER	1



/*
**	Function Declarations
*/

/*
**	Function:		initializeLCD
**	Parameters:		<none>
**	Purpose:		Initializes the LCD into the following mode:
**					<some mode>
**	Returns:		<none>
*/
void initializeLCD(void);

/*
**	Function:		waitForLCD
**	Parameters:		<none>
**	Purpose:		Polls the ready bit on the LCD to ensure that the
**					LCD is able to receive a new command or new data, or
**					delays for about 50 microseconds.
**	Returns:		<none>
*/
void waitForLCD(void);

/*
**	Function:		writeCharacterToLCD
**	Parameters:		character - unsigned character to be written to the LCD
**	Purpose:		Writes an 8-bit unsigned character to the LCD screen.
**	Returns:		<none>
*/
void writeCharacterToLCD(uint8_t character);

/*
**	Function:		writeNibbleToLCD
**	Parameters:		selectedRegister - either the command or data register
**									   that will be written to
**					nibble - the four bits to be written to the LCD
**	Purpose:		Writes a nibble to the LCD.
**	Returns:		<none>
*/
void writeNibbleToLCD(uint8_t selectedRegister, uint8_t nibble);

/*
**	Function:		writeByteToLCD
**	Parameters:		selectedRegister - either the command or data register
**									   that will be written to
**					byte - the eight bits to be written to the LCD
**	Purpose:		Writes and 8-bit value to the LCD screen.
**	Returns:		<none>
*/
void writeByteToLCD(uint8_t selectedRegister, uint8_t byte);

/*
**	Function:		readNibbleFromLCD
**	Parameters:		selectedRegister - either the command or data register
**									   that will be read from
**	Purpose:		Read a nibble from the LCD screen.
**	Returns:		nibble - the nibble that is read from the LCD
*/
uint8_t readNibbleFromLCD(uint8_t selectedRegister);

/*
**	Function:		readByteFromLCD
**	Parameters:		selectedRegister - either the command or data register
**									   that will be read from
**	Purpose:		Read a byte from the LCD screen.
**	Returns:		byte - the byte that is read from the LCD
*/
uint8_t readByteFromLCD(uint8_t selectedRegister);

/*
**	Function:		writeStringToLCD
**	Parameters:		stringPointer - a pointer to the array of characters
**									that will be written to the LCD
**	Purpose:		Writes a series of bytes to the LCD data register so
**					that a character array may be given and displayed.
**	Returns:		<none>
*/
void writeStringToLCD(uint8_t* stringPointer);

/*
**	Function:		writeIntegerToLCD
**	Parameters:		integer - the integer that will be written to the LCD
**	Purpose:		Coverts a standard 16-bit int into the ASCII
**					representation of the number and writes that number
**					to the LCD.
**					*** Note:	The maximum value that can be written is
**								9999.  This is because there is no
**								ten thousands place support.
**	Returns		<none>
*/
void writeIntegerToLCD(uint16_t integer);

/*
**	Function:		clearLCD
**	Parameters:		<none>
**	Purpose:		Writes the "clear and go home" command to the LCD.
**	Returns:		<none>
*/
void clearLCD(void);

/*
**	Function:		moveToXY
**	Parameters:		row - the row to be moved to
**					column - the column to be moved to
**	Purpose:		Moves the cursor to the requested (row, column) position
**					on the LCD
**	Returns:		<none>
*/
void moveToXY(uint8_t row, uint8_t column);

#endif

aykut54

https://320volt.com/atmel-programlama-dersleri-2-atmega8-lcd/
burdaki uygulamalar işini görürmü bir bak istersen. Kodlar uzun zaman önce yazıldı. Şuanda hatırımda değil. Belki senin istediğin gibidir. Olumlu olumsuz burda yazarsan yeni başlayanlar içinde iyi olur

forumsad

AYKUT HOCAM örneğinizi attiny2313 için uyarlamaya çalıştım
öncelikle winavr ile main.c dosyasını açtım

aşagıdaki gibi buraya hata verdiği için sadece
#include "lcd.C"      /*lcd kütüphanesi*/  satırını ekledim

main.c
/*--------------------------------------------------------------------------*
 *  Programın adı: Atmega8 lcd uygulaması	*
 *  Yazan        : Mehmet BEBEK	& Aykut YILMAZ		( M_B & aykut54 )*
 *  Islemci	 : Atmega8   															*
 *  Derleyici	 : WinAvr C	    														*
 *  XT	         : 1 MHz Kristal ( Dahili )	*
 *  Bildiri      : Her hakkı saklidir.          *
 *  Tarih        : Baslangic => 28.11.2010  	*
 *  Versiyon     : 1.0 ( main.c	)		*
 *  Aciklama     : 																		*
 *  Notlar		 : 											 							*
 *  Sonuc		 : 										   								*
 * ------------------------------------------------------------------------ */

#include <avr/io.h>		/*Atmega 8 I/O kütüphanesi*/
#include "lcd.h"		/*lcd kütüphanesi*/
#include "lcd.C"		/*lcd kütüphanesi*/
#include <util/delay.h> 	/*gecikme kütüphanesi*/

int main(void)
{

  lcd_init();			/* lcd ayarları yapılıyor*/		 
  while(1)
	  {	 
  lcd_setcursor( 2, 1 );	/*lcd 1.satır 2.sütünu*/
  lcd_string("ATmega8 LCD");	/* burdaki veriyi yaz*/
  lcd_setcursor( 3, 2 );	/*lcd 2.satır 3.sütüna*/
  lcd_string("dersleri 2");	/*burdaki veriyi yaz*/
  _delay_ms(1000);		/*1 sn gecikme yap*/

  lcd_clear();			/*lcd içeriğini komple temizle*/
  
   lcd_setcursor( 4, 1 );	/*lcd 1.satır 4.sütünu*/
  lcd_string("aykut54");	/* burdaki veriyi yaz*/
  lcd_setcursor( 5, 2 );	/*lcd 2.satır 5.sütüna*/
  lcd_string("M_B");		/*burdaki veriyi yaz*/
  _delay_ms(1000);		/*1 sn gecikme yap*/
  lcd_clear();			/*lcd içeriğini komple temizle*/  
	  }
 
  return 0;
}


sonra lcd.h dosyasını portb ye göre ayarlamaya çalıştım

lcd.h.
// Ansteuerung eines HD44780 kompatiblen LCD im 4-Bit-Interfacemodus
// http://www.mikrocontroller.net/articles/AVR-GCC-Tutorial/LCD-Ansteuerung
//
 
#ifndef LCD_ROUTINES_H
#define LCD_ROUTINES_H
 
 
//  LCD DB4-DB7 <-->  PORTD Bit PD0-PD3
#define LCD_PORT      PORTB
#define LCD_DDR       DDRB
#define LCD_DB        PB4
 
//  LCD RS      <-->  PORTD Bit PD4     (RS: 0=Data, 1=Command)
#define LCD_RS        PB3
 
//  LCD EN      <-->  PORTD Bit PD5     (EN: 1-Impuls für Daten)
#define LCD_EN        PB2
 
// LCD Ausführungszeiten (MS=Millisekunden, US=Mikrosekunden)
 
#define LCD_BOOTUP_MS           15
#define LCD_ENABLE_US           1
#define LCD_WRITEDATA_US        46
#define LCD_COMMAND_US          42
 
#define LCD_SOFT_RESET_MS1      5
#define LCD_SOFT_RESET_MS2      1
#define LCD_SOFT_RESET_MS3      1
#define LCD_SET_4BITMODE_MS     5
 
#define LCD_CLEAR_DISPLAY_MS    2
#define LCD_CURSOR_HOME_MS      2
 
////////////////////////////////////////////////////////////////////////////////
// Zeilendefinitionen des verwendeten LCD
// Die Einträge hier sollten für ein LCD mit einer Zeilenlänge von 16 Zeichen passen
// Bei anderen Zeilenlängen müssen diese Einträge angepasst werden
 
#define LCD_DDADR_LINE1         0x00
#define LCD_DDADR_LINE2         0x40
#define LCD_DDADR_LINE3         0x10
#define LCD_DDADR_LINE4         0x50
 
// Initialisierung: muss ganz am Anfang des Programms aufgerufen werden.
void lcd_init( void );
 
// LCD löschen
void lcd_clear( void );
 
// Cursor in die 1. Zeile, 0-te Spalte
void lcd_home( void );
 
// Cursor an eine beliebige Position 
void lcd_setcursor( uint8_t spalte, uint8_t zeile );
 
// Ausgabe eines einzelnen Zeichens an der aktuellen Cursorposition 
void lcd_data( uint8_t data );
 
// Ausgabe eines Strings an der aktuellen Cursorposition 
void lcd_string( const char *data );
 
// Definition eines benutzerdefinierten Sonderzeichens.
// data muss auf ein Array[5] mit den Spaltencodes des zu definierenden Zeichens
// zeigen
void lcd_generatechar( uint8_t code, const uint8_t *data );
 
// Ausgabe eines Kommandos an das LCD.
void lcd_command( uint8_t data );
 
// LCD Befehle und Argumente.
// Zur Verwendung in lcd_command
 
// Clear Display -------------- 0b00000001
#define LCD_CLEAR_DISPLAY       0x01
 
// Cursor Home ---------------- 0b0000001x
#define LCD_CURSOR_HOME         0x02
 
// Set Entry Mode ------------- 0b000001xx
#define LCD_SET_ENTRY           0x04
 
#define LCD_ENTRY_DECREASE      0x00
#define LCD_ENTRY_INCREASE      0x02
#define LCD_ENTRY_NOSHIFT       0x00
#define LCD_ENTRY_SHIFT         0x01
 
// Set Display ---------------- 0b00001xxx
#define LCD_SET_DISPLAY         0x08
 
#define LCD_DISPLAY_OFF         0x00
#define LCD_DISPLAY_ON          0x04
#define LCD_CURSOR_OFF          0x00
#define LCD_CURSOR_ON           0x02
#define LCD_BLINKING_OFF        0x00
#define LCD_BLINKING_ON         0x01
 
// Set Shift ------------------ 0b0001xxxx
#define LCD_SET_SHIFT           0x10
 
#define LCD_CURSOR_MOVE         0x00
#define LCD_DISPLAY_SHIFT       0x08
#define LCD_SHIFT_LEFT          0x00
#define LCD_SHIFT_RIGHT         0x04
 
// Set Function --------------- 0b001xxxxx
#define LCD_SET_FUNCTION        0x20
 
#define LCD_FUNCTION_4BIT       0x00
#define LCD_FUNCTION_8BIT       0x10
#define LCD_FUNCTION_1LINE      0x00
#define LCD_FUNCTION_2LINE      0x08
#define LCD_FUNCTION_5X7        0x00
#define LCD_FUNCTION_5X10       0x04
 
#define LCD_SOFT_RESET          0x30
 
// Set CG RAM Address --------- 0b01xxxxxx  (Character Generator RAM)
#define LCD_SET_CGADR           0x40
 
#define LCD_GC_CHAR0            0
#define LCD_GC_CHAR1            1
#define LCD_GC_CHAR2            2
#define LCD_GC_CHAR3            3
#define LCD_GC_CHAR4            4
#define LCD_GC_CHAR5            5
#define LCD_GC_CHAR6            6
#define LCD_GC_CHAR7            7
 
// Set DD RAM Address --------- 0b1xxxxxxx  (Display Data RAM)
#define LCD_SET_DDADR           0x80
 
#endif


lcd.c de bir değişiklik yapmadım


daha önceden kullandığım makefile 2313 için olan klasör içine attım

ve derledim hatasız derlendi...

isisi açıp denediğimde çalışmadığını gördüm aslında çalışıyor gibi ama ekranda görüntü yok sinyaller gidiyor yanıp sönüyor ama yazılar çıkmıyor
neyi eksik yapıyorum acaba??

[IMG]http://www.hizliupload.com/img/62143792496414748448.jpg[/img] Hizliupload.com