Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

PIC16f877a compile error

Status
Not open for further replies.

Shekhar Tandon

Newbie level 1
Newbie level 1
Joined
Jun 20, 2013
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Visit site
Activity points
11
Hi everyone,
I am new to microcontroller using the following code for pic16f877a. I am using mplab 8.91 and hi-tech compiler 9.83 to compile the code but it is giving error on _Config statement at line no 2. Pl help



#include<pic.h>
__CONFIG(WDTDIS & XT & UNPROTECT);
char name1[32]={" Hello World "};

void delay(int x)
{
int d,l;
for(l=0;l<x;l++)
{
for(d=0;d<3000;d++);
}
}

void instwrt(void)
{

RC0=0;
RC1=0;
RC2=1;
delay(1);
RC2=0;
delay(1);
}

void datawrt(void)
{
RC0=1;
RC1=0;
RC2=1;
delay(1);
RC2=0;
delay(1);
}
void lcdin()
{
PORTD=0x38;
instwrt();
PORTD=0x0c;
instwrt();
PORTD=0x01;
instwrt();
PORTD=0x06;
instwrt();
PORTD=0x80;
instwrt();
}
void main(void)
{
int a;
TRISD=0x00;
TRISC=0X00;
TRISB=0x00;
lcdin();
for(a=0;a<32;a++)
{
PORTD=name1[a];
datawrt();
}
while(1)
{
PORTD=0x18;
instwrt();
PORTB=0x0aa;
delay(10);
PORTB=0x55;
delay(10);
}
}
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top