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.

PICKIT 2 Debugging, why is PIC stuck in reset?

Status
Not open for further replies.

crash@home

New Member
PIC18F26J11, MPLAB 8

Ive been working on a some code in assembly for a while now, its all written in sections which all compile correctly, in their individual asm files.

Now i've sequentially built up my final program which runs smoothly however when i copy and paste the last part of the code, it builds but when i try to debug it the pickit fails to step past the Org 0x00 reset vector.

Having taken the code out and returning it to its last known working state, the same problem occurs


Watchdog timer is disabled
and i am not using an external oscillator

RCON reg is reading b'0011100'

the same as it was on the others that compiled and debugged/simulated successfully.

output window says
'target halted'

any ideas??
 
Care to post up your code? Not much we can do without seeing that.
 
Sounds like the PICkit2 debugger is failing to start for some reason. I had this issue on MPLAB X, but MPLAB 8.x seems to run it just fine. Can you post up your code? Do you have the processor connected to the PICkit 2? And did you reassemble the code after selecting PICkit 2 as your debugging tool under the Debug menu?
 
yes the processor is connected to the PICkit, and i tried rebuilding the code with it selected as the debugger and without it selected as the debugger
the code is currently 400 lines long, and the layout is not very neat as it is still incomplete and i am yet to structure it. should i still post it? im not sure how easy it would be to decipher..
 
I reloaded the latest version of the PICkit 2 OS and still having the same problem, does anyone know of any limitations to the number of lines that can be used in a single piece of code, i definitely havent used up all the memory but im just thinking that maybe the program counter (being of limited size itself) may not be coping well with 400+ lines.

Is it necessary to use the pagesel directive for something like this?
 
To the OP:

After programming the chip, go to the "Programmer" menu and select "release from reset".

Make sure MCLR is connected to +5v through a resistor or diode, not to ground.

Let me know if this helps.

Regards,
Matt
 
sorry for asking different question.. can PIC Kit2 generate 12v to target PIC or Input/output from 5v USB?
 
Pickit 2 generates the required HV for the MCLR pin whilst programming... There is a simple boost circuit that provides around 13v for that purpose... The pickit also provides a variable voltage to power the device as well.. The target voltage is set in software...
 
so basicly if i want to program using pic kit2 i just connect pic kit2 usb to computer, then i can test the circuit without external power?
 
You just need to comply with the pickit2 connections.... You have to have a 6 way header... Pin 1 = MCLR ... Pin2 = V+... Pin3 = Gnd... Pins 4 and 5 are PGC and PGD ( clock and data ) Pin 6 is unused...

That is why I make little programming boards with Zif sockets on...
 
Ive Just tried programmer > release from reset, but have had no joy.

I dont know that programmer is the correct menu for what I'm trying to do anyway, programming the chip does not give me the option to step through or run and watch the program,

i need to debug the final stages to make sure the mathematical/ read and write operations are performing as desired.

Thanks
 
Thanks for the support guys, sometimes the best thing to do is to take a couple of days off and come back to it..

For me, despite leaving notes and comments all over i find myself having to almost re-teach myself what my code was doing.

Anyway... checking the configuration bits showed me that DEBUG was off, weird because it was off with all the other code segments that had successfully debugged error free.

Such is life when dealing with Micros i suppose..
 
Thanks for the support guys, sometimes the best thing to do is to take a couple of days off and come back to it..

For me, despite leaving notes and comments all over i find myself having to almost re-teach myself what my code was doing.

Anyway... checking the configuration bits showed me that DEBUG was off, weird because it was off with all the other code segments that had successfully debugged error free.

Such is life when dealing with Micros i suppose..

You have it working then?
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top