pic controller becomes non usable when tris bits are set wrongly , after loading hex file controller shows verification of configuration bits failed , after this the mcu is not able to been erased or detected and nothing can be done , i dont know what mistake i am doing.
wrong code:
void main()
{
TRISA =0b00001011;
TRISC =0b00000000;
CMCON =0x07;
ADCON1 =0X50;
ANSEL =0b00000001;
PORTA =0x00;
PORTC =0x00;
}
working code:
{
TRISA=0b00101000;
TRISC=0b00000100;
CMCON = 0x07;
ADCON1 = 0X50;
ANSEL = 0x01;
PORTA=0x00;
PORTC=0x00;
}
just by setting rc2 bit as input ic becomes non usable i have used rc2 as output too in my previous project i dont know what mistake i am doing hear can anyone guide me. I faced this issue in pic16f886 too by mistakenly setting mclr to high while programming ( instead of porta=0x00, i have types porta =0xff) wrongly that caused same issue .
pic controller becomes unusable and verification of configuration bits becomes failed.
- stefan.filipovic
- mikroElektronika team
- Posts: 1135
- Joined: 18 Dec 2018 10:30
Re: pic controller becomes unusable and verification of configuration bits becomes failed.
Hi,
Welcome to the MikroE forum.
Could you tell me which MCU you were using with these codes?
Kind regards,
Welcome to the MikroE forum.
Could you tell me which MCU you were using with these codes?
As I see, you have set RC2 as input in a "working code".just by setting rc2 bit as input ic becomes non usable i have used rc2 as output too in my previous project i dont know what mistake i am doing hear can anyone guide me.
Kind regards,
Stefan Filipović
Re: pic controller becomes unusable and verification of configuration bits becomes failed.
yes but we can set RC2 as both input and output right , why the controller becomes like dead if i use the code in top ( wrong code) , can you explain me what mistake i am doing
- stefan.filipovic
- mikroElektronika team
- Posts: 1135
- Joined: 18 Dec 2018 10:30
Re: pic controller becomes unusable and verification of configuration bits becomes failed.
Hi,
Could you tell me which development board/programmer you are using?
I've tested both codes on EasyPIC v7 with PIC16F676 and haven't reproduced the same issue.
Please attach the hex file you have programmed the PIC16F676 with.
Kind regards,
Could you tell me which development board/programmer you are using?
I've tested both codes on EasyPIC v7 with PIC16F676 and haven't reproduced the same issue.
Please attach the hex file you have programmed the PIC16F676 with.
Kind regards,
Stefan Filipović