11/11/2018 at 01:07 #3921
The PIC you used in mikroC project is PIC16F887, not PIC18F2220.
You have a lot of mistakes in your project. It always good to try and understand the code instead of copy and paste.
- First, you used PIC18F2220 in Proteus schematic but used PIC16F887 in mikroC.
- In mikroC you selected to use an external oscillator (HS) but in Proteus there is no oscillator. It won’t work.
- You enabled the MCLR pin in mikroC project, but unconnected in Proteus, the Project will keep on resetting.
- Why do you need ANSELC = 0; on PORTC while you are connecting nothing to it? Did you read the comments?
- Not all PIC have ANSEL register to disable analog functions on PIC. For this PIC, you can use ADCON1 register. See page 212 of PIC18F2220 datasheet.