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??
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??