Qaisar Azeemi
Full Member level 5
- Joined
- Feb 11, 2011
- Messages
- 315
- Helped
- 16
- Reputation
- 32
- Reaction score
- 15
- Trophy points
- 1,298
- Location
- Peshawar, Pakistan, Pakistan
- Activity points
- 3,829
Hi!
i am using mikoC PRO for PIC v5.6.1 and programming a 16x2 LCD display using PIC16F877A. wana display data on lcd but getting errors.
since i am in learning process so using engineers garage code.
i received the following errors:
array deceleration syntax is seem to be ok. but still there is error. any help will be much appritiated.
regards
i am using mikoC PRO for PIC v5.6.1 and programming a 16x2 LCD display using PIC16F877A. wana display data on lcd but getting errors.
since i am in learning process so using engineers garage code.
Code:
#define RS PORTD.F4 //RD4
#define EN PORTD.F5 //RD5
#define Lcdport PORTC //lcd data pins
void lcd_ini();
void dis_cmd(unsigned char);
void dis_data(unsigned char);
void lcdcmd(unsigned char);
void lcddata(unsigned char);
void main()
{
TRISD.f4 = 0;
TRISD.f5 = 0;
TRISB.f2 = 0x00;
TRISB.f3 = 0x00;
// TRISC.f0 =0xff;
// TRISC.f1 =0xff;
TRISC=0x00; //portC output
unsigned char data0[]="Shenztech PvtLtd";
unsigned int i=0;
lcd_ini();
while(1)
{
for (i=0; i!='\0'; i++)
{
dis_data(data0[i]);
Delay_ms(200);
}
}
}
//..............................;;;;;;;.........................................
void lcd_ini()
{
dis_cmd(0x02); // 4 bit mode select
dis_cmd(0x28); //2 line; 5x7 display; 4bit mode
dis_cmd(0x0c);
dis_cmd(0x06);
dis_cmd(0x80); //start from line 1 character 0
}
//..............................;;;;;;;........................................
void dis_cmd(unsigned char cmd_value)
{
unsigned char cmd_value1;
cmd_value1=(cmd_value & 0xf0); // mask the lower nibble
lcdcmd(cmd_value1); //send to lcd
cmd_value1=((cmd_value1<<4) & 0xf0);
lcdcmd(cmd_value1);
}
//................................;;;;;.........................................
void lcdcmd(unsigned char cmdout)
{
Lcdport=cmdout;
RS=0;
EN=1;
Delay_ms(10);
EN=0;
}
//.............................;;;;;;.........................................
void lcddata(unsigned char dataout)
{
Lcdport=dataout;
RS=1;
EN=1;
Delay_ms(10);
EN=0;
}
i received the following errors:
array deceleration syntax is seem to be ok. but still there is error. any help will be much appritiated.
regards