pic controller becomes unusable and verification of configuration bits becomes failed.

General discussion on mikroC PRO for PIC.
Post Reply
Author
Message
Naveen11
Posts: 6
Joined: 22 Mar 2020 08:02

pic controller becomes unusable and verification of configuration bits becomes failed.

#1 Post by Naveen11 » 22 Mar 2020 10:41

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 .

User avatar
stefan.filipovic
mikroElektronika team
Posts: 1135
Joined: 18 Dec 2018 10:30

Re: pic controller becomes unusable and verification of configuration bits becomes failed.

#2 Post by stefan.filipovic » 23 Mar 2020 12:23

Hi,

Welcome to the MikroE forum.

Could you tell me which MCU you were using with these codes?
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.
As I see, you have set RC2 as input in a "working code".

Kind regards,
Stefan Filipović


Naveen11
Posts: 6
Joined: 22 Mar 2020 08:02

Re: pic controller becomes unusable and verification of configuration bits becomes failed.

#4 Post by Naveen11 » 24 Mar 2020 06:55

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

User avatar
stefan.filipovic
mikroElektronika team
Posts: 1135
Joined: 18 Dec 2018 10:30

Re: pic controller becomes unusable and verification of configuration bits becomes failed.

#5 Post by stefan.filipovic » 27 Mar 2020 10:27

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,
Stefan Filipović

Post Reply

Return to “mikroC PRO for PIC General”