Dependency issue

Discussion Forums discussion Dependency issue

This topic contains 0 replies, has 1 voice, and was last updated by  rupak 1 month, 1 week ago.

Viewing 1 post (of 1 total)
Author Posts
Author Posts
June 14, 2014 at 12:44 pm #20175

rupak
Participant

All i m trying is to interface lcd using programmers notepad..
and the program runs well with atmel studio.Here i got encountered with problem building the code displaying the following information::

fatal error: opening dependency file .dep/main.o.d: No such file or directory

what should i do?plz help

code is herewith attached:

/*
* lcd_4bit_mode.c
*
* Created: 11/25/2013 7:44:21 PM
* Author: Ram Prasad
*/

/*
* interfacing_LCD_by_charachters.c
*
* Created: 11/17/2013 2:54:53 PM
* Author: Ram Prasad
*/
//program to display charachters on LCD – characters by characters
/* lcd is used in 8 bit mode
lcd_data =portb ; portb is used for datas
control =portd ; portb is used for control ie rs rw and e
rs = pd2
rw =pd4
e= pd5
*/

#include
#include

#define control PORTB
#define lcd_data PORTC
#define rs PB2
#define rw PB1
#define en PB0

void lcd_init (void);
void lcd_command(unsigned char cmd);
void lcd_write(unsigned char data);
void lcd_string(unsigned char *str);
void dis_cmd(char cmd_value);
void dis_write(unsigned char data);

int main()
{
while(1)
{
DDRB = 0xFF;
DDRC = 0xFF;
_delay_ms(150);
lcd_init();
_delay_ms(50);

lcd_str(“programming”);
_delay_ms(500);
dis_cmd(0xc0);
lcd_str(“is fun”);

}
return 0;
}

void lcd_init (void)
{
dis_cmd(0×02); //initialises lcd on 4 bits mode
_delay_ms(500);
dis_cmd(0×28); //initialises lcd to use 2 line and 5*7 matrix ie 16*2 lcd on 8 bits
_delay_ms(500);
dis_cmd(0×01);//clears lcd screen
_delay_ms(500);
dis_cmd(0x0E);//display ON cursor ON
_delay_ms(500);
dis_cmd(0×80);//cursor is set on the 1st line
_delay_ms(500);
return;

}

void lcd_command(unsigned char cmd)
{
lcd_data =cmd;
control = (0<<rs)| (0<<rw) | (1<<en); // setting rs to 0 is command mode when rw=0 write mode
_delay_ms(500);
control = (0<<rs)| (0<<rw) | (0<<en);
_delay_ms(500);

// 2ta control command is used for the high to low transition of enable as the code works on the falling
// edge of the enable en
return;
}

void lcd_write(unsigned char data)
{
lcd_data= data;
control = (1<<rs)| (0<<rw) | (1<<en); // setting rs to 0 is command mode when rw=0 write mode
_delay_ms(500);
control = (1<<rs)| (0<<rw) | (0<<en);
_delay_ms(500);
return;
}

void dis_write(unsigned char data)
{
char data1;

data1 = data & 0xF0; //mask lower nibble because PA4-PA7 pins are used.
lcd_write(data1);

data1 = ((data<<4) & 0xF0); //shift 4-bit and mask
lcd_write(data1);

return;
// send to LCD

}
void lcd_str(unsigned char *str)
{
int i = 0;
while(str[i] != '')
{
dis_write(str[i]);
i++;

}
return;

}
void dis_cmd(char cmd_value)
{
char cmd_value1;

cmd_value1 = cmd_value & 0xF0; //mask lower nibble because PA4-PA7 pins are used.
lcd_command(cmd_value1); // send to LCD

cmd_value1 = ((cmd_value<<4) & 0xF0); //shift 4-bit and mask
lcd_command(cmd_value1); // send to LCD
}

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.