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.

HElp reg this prog on PIC I am a beginner

Status
Not open for further replies.

thecall

Junior Member level 2
Joined
Mar 4, 2007
Messages
22
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,448
i just started working on Microcontrollers...... i am using mikroC for compiling programs and then simulate it on proteus and PIC16F84A.

prob is when i compile this prog. error is
Undeclared identifier RA0
Undeclared identifier RA1
Undeclared identifier RB0
Undeclared identifier RB1

here is the program.this is PUSH BUTTON PROG
PLZ HELP why is this so



void main()

{

TRISA=0b00000;//output
TRISB=0x1111111;// i/p

for(;;)
{
RA0=0;
if(RB0==1)
{
RA0=1;
}

RA1=0;
if(RB1==1)
{
RA1=1;
}
}



}
 

You need to include the header file for the microcontroller you are using. So the compiler will know all the addresses on it.
 

You don't need to include the header file in MikroC but the pin is not RA0 in MikroC it is PORTA.F0 and RB0 is PORTB.F0 like that. Hope this helps.:D
so your program is

Code:
void main()

{

TRISA=0b00000;//output
TRISB=0x1111111;// i/p

for(;Wink
{
PORTA.F0=0;
if(PORTB.F0==1)
{
PORTA.0=1;
}

PORTA.F1=0;
if(PORTB.1==1)
{
PORTA.F1=1;
}
}



}







----------------------------------
Click on helped me
 

RESOLVED THANKS BUT

WHY IS THIS SO >>>>CAN U HELP..........whats the difference in MIKRO C and MPLAB IDE......
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top