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.

Using PIC Kit2 to downlaod program to PIC

Status
Not open for further replies.

Scoobystu

New Member
I am currently having a problem with programming an embedded PIC 12f683 using the PICKIT2 system. I developed the prototype on the board supplied with the PICKIT2 and it worked fine, however I now need to program the chip on the final circuit board.

I have made an adaptor using the info supplied in Chapter 3 of the user manual. When I plug it into the header it gives a message to 'INSERT DEVICE'.

Do I need to supply a voltage to the circuit board outwith the voltage coming from the PICKIT2 header? The circuit will be running just under 5V so I don't think it should conflict with the USB.

Any help would be appreciated.

I can post the circuit diagram if required.

Stu
 
Hi,

You can have either (I wouldn't try both though). If the board its on has lots of other electronics, that draw power, then the pickit2 might not be able to supply enough current to them all, so powering the board seperately is always good.

Also, if theer are any current drawing bits of circuit on the data and clock for the programming, they might draw too much power from the pickit2, meaning it own't program. A diagram might be helpful.

Blueteeth.
 
You can have either (I wouldn't try both though). If the board its on has lots of other electronics, that draw power, then the pickit2 might not be able to supply enough current to them all, so powering the board seperately is always good.

Also, if theer are any current drawing bits of circuit on the data and clock for the programming, they might draw too much power from the pickit2, meaning it own't program. A diagram might be helpful.

Blueteeth.

There isn't too much to the circuit. See here

I got a response from Microchip online help and they suggested that the circuit to the MCLR/VPP Pin should be the same as the proto-board. That would mean I should put a 10k + 1k resistor in line with the supply voltage to that pin on my circuit for programming. Is this the case?

Was hoping that I could simply hook up to the header but nothing is that easy. I also realise that the CLK and DATA pins are back to front for the programming header.

I think I have blown the PICKIT2 programming header as it is not supplying 4.8V any more, simply 1.8V not enough to work the proto board.

Cheers Stu
 
Last edited:
Hi,

Yeah, sound advice form microchip there, it'll probably be the 'Clk and data' pins being the wrong way raround thats the trouble :D Programming in-circuit can be tricky, but is generally trouble free. And MCLR should nearly always be pulled up with a resistor for the program to run properly, unless you've enabled the internal pullup in software. But the Vpp from the PICkit2 should be connected directly to the MCLR pin.

When you say your PICkit2 is only supplying 1.8V on its 'VDD' pin...is that after you've clicked 'target 5.0v' in the GUI software? Unless your circuit is drawing a lot of current, I doubt you've blown it....and check the voltage from the GND and VCC pins on the PICkit2 with noting else connected to it, could be that your circuit is dropping the voltage somehow.

Just glancing over the schem...the transistor to the right...what is 'Vbat' and TR_collector' connected to? if they are shorted, then, when the transistor is on, it'll pretty much short the battery, and probably have a voltage drop of 1.8V, to mention get hot.

one more thing...what battery voltage are you using? I believe that PIC can run as low as 2.5V, so 3-4.5v (2 or 3 AA's) would be ideal. Over 5.5v and you'll risk blowing the PIC, so if its 6V+ use a 7805 (or similar) regulator to get your 5v. Also, the reason the PICkit2 only provides 5v, is because I *think* most PIC's have to be programmed with that supply voltage. Some may run at 2.5v - 5.5v, but they need to be 4.5V+ in order to program correctly.

Thats what I'm thinking anyway, let me know how you get on,

Blueteeth.
 
Thanks again

Yeah I love Microchip support!! I'm surprised they didn't recommend switching it off and back on again!

As for the PICKIT it is only supplying 1.8v when the 'Target Power' is selected. Before I started trying to connect to my circuit (custom board) I measured the voltage at VPP and VDD and they were both 4.8v. I then tried something a bit dodgy on the circuit board and when I next measured the voltage it had dropped. When I then put it back onto the PICKIT proto board that was working previously, it no longer works. The PIC on the proto board is still working, as I put a separate power source on to to check it and it works fine. I can't however program it any more.... so now I can't programme anything... deep sigh.

The 'Vbat' and TR_collector' will eventually be connected to a small heater. At the time of attempting to programme the custom board it was not connected.

Obviously I am fairly new to this and I have just managed to get my head around writing assembly code and was hoping to programme the PIC without too much hassle.

If the worst comes to the worst I will de-solder the 12f683 from the boards, programme them and put them back on!!
 
Woohoo

Just to let you know I think I have found the problem. The switch has been mounted on the circuit board incorrectly. It needs to be turned by 90 deg. Will need to send them back, well the ones I haven't destroyed. It was effectively on all of the time and would explain why the voltage at VPP was disappearing as it was going to ground all the time.

I ripped one of the switches off and then plugged the board into the header and I am now getting a voltage at VPP. Albeit a small one as the header is blown, no doubt due to drawing too much current through VPP.

I'm not out of the woods yet as I now need to get the manf to sort them....
 
Hi again,

Bummer :( Oh well, you can't always predict these things. Good luck in sorting out your next 'batch' :D

Blueteeth
 
Status
Not open for further replies.

Latest threads

Back
Top