Problem programming PIC16F887

General discussion on mikroC.
Post Reply
Author
Message
alinpion
Posts: 10
Joined: 09 Apr 2012 10:14

Problem programming PIC16F887

#1 Post by alinpion » 09 Apr 2012 10:19

Hello!

I've just started to work with PIC16F887 and I have some problems. For programming I use (Genius) G540 programmer with the following configuration: FOSC0=0 ; FOSC1=1 ; FOSC2=0 ; WDTEN=1 ; PWRTE=0 ; MCLRE=0 ; CP=0 ; CP0=0 ; BODEN0=1 ; BODEN1=1 ; IESO=1 ; PCMEN=1 ; LVP=1 ; DEBUG=0 ; BOR4V=1 ; WRT0=0 ; WRT1=0.

The problem is that when I program the microcontroler the circuit will not respond properly; let's say I write the following sequence:
void main(){
ANSEL=0;
ANSELH=0;
PORTB=0b11111111;
TRISB=0;
}
For oscilator I use a 8Mhz Cristal with 22pF capacitors.

After programming the output of PORTB is something like: 00101111 and could change after another programming with the same program. Also I have to mention that the first time when I program the PIC all the FOSC0.....MCLRE....WRT1 pins where 1.

What do you think is the problem??

User avatar
janko.kaljevic
Posts: 3565
Joined: 16 Jun 2011 13:48

Re: Problem programming PIC16F887

#2 Post by janko.kaljevic » 10 Apr 2012 15:23

Hello,

Please try to disable Low Voltage Programming and test it again.

Best regards.

Post Reply

Return to “mikroC General”