jayanth.devarayanadurga
Banned
- Joined
- Dec 4, 2012
- Messages
- 4,280
- Helped
- 822
- Reputation
- 1,654
- Reaction score
- 791
- Trophy points
- 1,393
- Location
- Bangalore, India
- Activity points
- 0
Post project files + Proteus file zipped.
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
#include<pic.h>
#include<htc.h>
__CONFIG(FOSC_HS & WDTE_OFF & PWRTE_OFF & CP_OFF & BOREN_OFF & LVP_OFF & CPD_OFF & DEBUG_OFF);
#define _XTAL_FREQ 16000000
#define RS RE1
#define EN RE2
void lcd_init(void);
void lcd_command(unsigned int);
void lcd_data(unsigned int);
void lcd_print(unsigned char*);
void main()
{
lcd_init();
while(1)
{
lcd_print((unsigned char *)"HELLO");
//lcd_print('1');
__delay_ms(1000);
lcd_print((unsigned char *)"world");
//lcd_print('2');
__delay_ms(1000);
lcd_command(0x06);
}
}
void lcd_print(unsigned char array[])
{
unsigned char i;
for(i=0;array[i]!='\0';i++)
lcd_data(array[i]);
}
void lcd_init(void)
{
PORTD=0x00;
TRISD=0x00;
TRISE1=0;
TRISE2=0;
lcd_command(0x38);
lcd_command(0x0F);
lcd_command(0x01);
lcd_command(0x84);
}
void lcd_command(unsigned int command)
{
RS=0;
PORTD=command;
EN=1;
__delay_ms(1000);
EN=0;
__delay_ms(1000);
}
void lcd_data(unsigned int data)
{
RS=1;
PORTD=data;
EN=1;
__delay_ms(1000);
EN=0;
__delay_ms(1000);
}
Code C - [expand] 1 lcd_command(0x0C); // Turn of Cursor
Code C - [expand] 1 lcd_command()
Code C - [expand] 1 lcd_data()
Code C - [expand] 1 delay_ms(500)
you are going to write 2 chrs per second....
Code C - [expand] 1#define _XTAL_FREQ 12000000 //ex for 12Mhz