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.

in circuit progrsmming problems !

Status
Not open for further replies.

tama182

New Member
When ever i try and program the 16f628a in mplab, i get this error

Programming Target...
...Validating configuration fields
ICDWarn0033: MPLAB ICD 2 does not support programming this device if both the internal oscillator and internal MCLR are selected. You may continue programming, but you are encouraged to cancel, reconfigure your device, and try again.
...Erasing Part
...Programming Program Memory (0x0 - 0x9F)
Verifying...
...Program Memory
ICD0161: Verify failed (MemType = Program, Address = 0x0, Expected Val = 0x3007, Val Read = 0x3FFF)
ICD0275: Programming failed.
MPLAB ICD 2 Ready

and im following the circuit form the icd 2 guide,

ive got 5 wires coming from the icd 2, pgd,pgd,vpp,+ and ground, and their all connected the the correct legs on the pic, and ive also got the wires connecting the chip + and ground to a 5volt supply, because the icd is set so that pic has its own power, and ive a resister pulling the vpp pin high.

does any anyone else program this way, and have any advice?
 

Attachments

  • pic_159.jpg
    pic_159.jpg
    32.1 KB · Views: 401
Simple fact - you can't enter programming mode on a PIC if the clock oscillator is running. So for ISCP you need to stop the clock first - as the 16F628 has an internal clock oscillator you can get the same problem with that, even without ICSP - as the oscillator starts shortly after power is applied.

To stop the clock you can take MCLR low, this resets the PIC and holds it reset, with the clock stopped. If you then switch MCLR to 13V fast enough (it's not that critical) you can attain programming mode before the clock starts, the actual time it takes is given in the datasheets.

So it depends on your hardware, an ICSP programmer, and a target circuit designed for it, should allow the MCLR pin to be set to ground, 5V, and 13V - does your's?.
 
all im trying to do is do without the picdem plus 2, and just linked the wires like they are on the icd 2 manual, im not actually programming the pi within a circuit, ive just simply got it linked up on a breadboard, just the fives wires and just the 628a.........nothing else.

cant i do that?
 
Nigel Goodwin said:
the oscillator starts shortly after power is applied.

sorry to go off topic but does that mean if you start pressing inputs and stuff as soon as u power it, the buttons wont do anything because the oscillator hasnt started yet?
 
GST_Nem said:
Nigel Goodwin said:
the oscillator starts shortly after power is applied.

sorry to go off topic but does that mean if you start pressing inputs and stuff as soon as u power it, the buttons wont do anything because the oscillator hasnt started yet?

No, I'm only talking milliseconds here! - but even if it took a second for the clock to start, as soon as it did the buttons would be read.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top