Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

having error in Burning Hex file to PIC16F877a

Status
Not open for further replies.
Iam using Pic kit 2 burner
on my pic board there is a 8 Mhz crystal oscilator
iam using Mikro C for devloping code and i have selected 8Mhz frequency at the starting of new project
previously i was selecting 20Mhz for the code( i got to know that i was wrong)

i did select edit project from the project tool and in the oscillator section i have selected XT( coz someone had told me that if we use crystal of below 8 Mhz we have to select Xt and above that Hs is selected)

before that i was using default Hs for 8 Mhz and now when

i did the same i was instructed and when i burned it into the MCU using Pic Kit 2 what i see that it says device error after once it had
burned the hex file into it( and same with the another controller) and the device not found error on PIC kit 2

iam confused please somebody correct me
 
Hi,

The cross over point between HS and XT is 4 Mhz but I doubt specifying XT or HS would result in a Device error during programming.

Assume you are programming with the Pk2 V2.61 ?

Can you post a screenshot of the error message as its unusual to get that message after its programmed.

Also how long are the leads from the Pk2 output connector to your circuit board, more than 150mm and you can have problems.

Is you chip in a breadboard ?

Also post your code, partic the config code details.
 
The cross over point between HS and XT is 4 Mhz but I doubt specifying XT or HS would result in a Device error during programming.

Actually the 'cross over' point isn't really ever specified, and seems to make VERY little difference, I've run 4MHz crystals set to HS and 20MHz set to XT, both work perfectly - but generally for 4MHz I would use XT, and for 20MHz I would use HS - for 10MHz it's difficult to decide :D

But as you say, it' nothing to do with his 'problem', which might be that he's setting the protection fuse - hence your request for config settings.
 
Actually the 'cross over' point isn't really ever specified, and seems to make VERY little difference, I've run 4MHz crystals set to HS and 20MHz set to XT, both work perfectly - but generally for 4MHz I would use XT, and for 20MHz I would use HS - for 10MHz it's difficult to decide :D

But as you say, it' nothing to do with his 'problem', which might be that he's setting the protection fuse - hence your request for config settings.


Hi,

Agree it seems to make little difference in practice but of a beginner suppose we can only suggest the way to go is to follow the Datasheet table 14.2 Crystal Oscillator Selection.
 
Hi,

The cross over point between HS and XT is 4 Mhz but I doubt specifying XT or HS would result in a Device error during programming.

Assume you are programming with the Pk2 V2.61 ?

Can you post a screenshot of the error message as its unusual to get that message after its programmed.

Also how long are the leads from the Pk2 output connector to your circuit board, more than 150mm and you can have problems.

Is you chip in a breadboard ?

Also post your code, partic the config code details.

previously when i program my PIC16f877a on the board(not breadboard.. its a developing kit PCB) using pickit2 it was working fine.. but now when i selected XT from project editor as i am using 8Mhz crystal on the board.... since then every thing is working in the wrong way.. my 2 Micro controller gets damaged.

the code is simple for a seven segment showing0 - 9 using Mikro C software
----------------------------------------------------------------------------------------------------------------
//using common anode seven segment
void main()
{
unsigned int i,a;
unsigned int ar[]={~0x3f,~0x06,~0x5B,~0x4F,~0x66,~0x6D,~0x7D,~0x07,~0x7F,~0x6F};
TRISB=0;
TRISC=0;
PORTC.F0=1;
while(1)
{
for(a=0;a<10;a++)
{
PORTB=ar[a];
Delay_ms(500);
}
}
}
 
I use MikroC but for the pic32's.... If you show me your project, Ill see if anything is amiss..
Hi,

Agree it seems to make little difference in practice but of a beginner suppose we can only suggest the way to go is to follow the Datasheet table 14.2 Crystal Oscillator Selection.
Actually the 'cross over' point isn't really ever specified, and seems to make VERY little difference, I've run 4MHz crystals set to HS and 20MHz set to XT, both work perfectly - but generally for 4MHz I would use XT, and for 20MHz I would use HS - for 10MHz it's difficult to decide :D

But as you say, it' nothing to do with his 'problem', which might be that he's setting the protection fuse - hence your request for config settings.
Hi,

The cross over point between HS and XT is 4 Mhz but I doubt specifying XT or HS would result in a Device error during programming.

Assume you are programming with the Pk2 V2.61 ?

Can you post a screenshot of the error message as its unusual to get that message after its programmed.

Also how long are the leads from the Pk2 output connector to your circuit board, more than 150mm and you can have problems.

Is you chip in a breadboard ?

Also post your code, partic the config code details.
Hi,

The cross over point between HS and XT is 4 Mhz but I doubt specifying XT or HS would result in a Device error during programming.

Assume you are programming with the Pk2 V2.61 ?

Can you post a screenshot of the error message as its unusual to get that message after its programmed.

Also how long are the leads from the Pk2 output connector to your circuit board, more than 150mm and you can have problems.

Is you chip in a breadboard ?

Also post your code, partic the config code details.




ok i did read the data sheet now and i got to know that have to use HS as i use previously but this time when i use Hs still iam having a device error even with a new controller..i think i damaged this one also..
i lost three microcontroller now.. and its hard to afford another ic some body please tell me whats wrong??

i had successfully burned and run the code previously with 20mhz and 8Mhz
 
If your micro's are being destroyed it has nothing to do with the programming parameters... Maybe you have the code and data protect on in the config bit and as such have made the micro's into OTP devices...

The thing about using pickit 2 and MikroC is you are transferring a hex file from the IDE to the programmer... When you do this its up to you to check the config bits... BEFORE you program another chip, after you load the hex file look at the config bits.... The correct setting for a pic16f877a is 0x3F72... If its 0x1872 then the code and flash protect are on...
 
If your micro's are being destroyed it has nothing to do with the programming parameters... Maybe you have the code and data protect on in the config bit and as such have made the micro's into OTP devices...

It doesn't make them OTP, you can still erase and program over them just as normal.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top