• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

pic16f877a in Proteus 8

Status
Not open for further replies.

Mohamed_Othman

New Member
Dear Friend
kindly i hope you inform me about what mean that error in picture attached , i am beginner in Proteus 8 ,

how to connect pic16f877a in Proteus 8 , what is wrong ?
after i am build program and save it as hex file , and upload file to micro controller , when run simulations not work







file in attachment you see copy of picture and file of circuit from proteus 8

regards
 

Attachments

Mohamed_Othman

New Member
void main() {
trisb= 0b000000000; //portb is output , program port b is output
portb=0 ; // all leds is off
for ( ;; ) {
portb= 0b00101011 ;
delay_ms (10000) ;
portb = 0b11010100 ;
delay_ms(10000) ;
}
}
 

Ian Rogers

User Extraordinaire
Forum Supporter
Most Helpful Member
There is nothing wrong with that code...
The error window in Labcenter Proteus shows you have a pic location violation!!! MikroC is compiling the hex file wrong.

In MikroC make sure all the libraries in Library manager are unchecked... Also make sure the project is set for a pic16f877..
 

Mohamed_Othman

New Member
There is nothing wrong with that code...
The error window in Labcenter Proteus shows you have a pic location violation!!! MikroC is compiling the hex file wrong.

In MikroC make sure all the libraries in Library manager are unchecked... Also make sure the project is set for a pic16f877..
can you explain to me by screen shoot , hoe can i fix hex file from Micro C ?
 

Mohamed_Othman

New Member
whats wrong in this script

void main() {
char x;
trisb=0 ;
portb= 0;
for ( ; ; ) {
portb=0b0 ;
delay_ms(1000) ;
for (x=0 ; x<<8 ;x++ ) {
portb=portb<<1 ;
delay_ms(1000) ;
}
}
}
 

Pommie

Well-Known Member
Most Helpful Member
What is PIC168771 as you appear to be trying to compile for it. See line 9 of above image.

Mike.
 

Ian Rogers

User Extraordinaire
Forum Supporter
Most Helpful Member
What is PIC168771 as you appear to be trying to compile for it. See line 9 of above image.

Mike.
It's a Proteus thing... The correct part is modelled... That is the library part

I have now a copy of microC and compiled your code and run in Proteus... No problem at all
 
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top