Need Help Understanding How to Restart MPLAB Debug

Started by jsternmd September 27, 2009
I have read and read but I cannot figure out why every time I debug through to some code of interest, that when I want to re-start from the beginning (as with a fresh power-on) MPLAB doesn't seem to work right. I have tried reset, clear all memory, recompiling but then debug steps through code and regsiters don't change. I have had this since v 8.30 and with the the current 8.36. I must be missing some basic understanding or setup problem. Any help appreciated as I am getting tired of closing and re-opening the project and MPLAB.

thanks in advance

----- Original Message -----
From: "jsternmd"
To:
Sent: Sunday, September 27, 2009 2:34 PM
Subject: [piclist] Need Help Understanding How to Restart MPLAB Debug
>
> I have read and read but I cannot figure out why every time I debug
> through to some code of interest, that when I want to re-start from the
> beginning (as with a fresh power-on) MPLAB doesn't seem to work right. I
> have tried reset, clear all memory, recompiling but then debug steps
> through code and regsiters don't change. I have had this since v 8.30 and
> with the the current 8.36. I must be missing some basic understanding or
> setup problem. Any help appreciated as I am getting tired of closing and
> re-opening the project and MPLAB.
>

Reset works for me. Try putting a nop after your org 0, if you are in
Absolute mode. The debugger should start there when you reset.

Leon

Leon

----- Original Message -----
> 1a. Need Help Understanding How to Restart MPLAB Debug
> Posted by: "jsternmd" j...@earthlink.net jsternmd
> Date: Sun Sep 27, 2009 6:35 am ((PDT))
> I have read and read but I cannot figure out why every time I debug
> through to some code of interest, that when I want to re-start from
> the beginning (as with a fresh power-on) MPLAB doesn't seem to
> work right.

I wonder what you expect? Exactly what doesn't work?

On reset, nothing is changed except for a few registers, and they aren't
necessarily cleared. If you look at the tables describing registers in the
datasheet, there is a column called "Value at POR Reset". This shows the
power on values for the particular register. In most cases, they don't
change. In some cases the register is zeroed, in some cases a few bits are
cleared, in a few cases, some bits are set. When you have an image of a
single register, there is a row above it that says things like "R/W-0".
This means this is a read-write bit and the power on value is cleared.
"R-1' means a read-only bit and the power on value is set.

The general purpose registers are not affected by a reset, although with
MPLAB, you can clear the GPRs. Remember that the program memory and general
purpose registers are separate, and can be cleared separately. This often
causes confusion. Clearing program memory DOES NOT clear the general
purpose registers.

Also remember that when you power on an actual PIC, the GPR's are random,
NOT cleared. When you first start MPLAB, the GPRs are cleared. If you
reset an actual PIC or MPLAB, the GPRs are unaffected.

72/73 de WB8RCR http://www.qsl.net/wb8rcr
didileydadidah QRP-L #1446 Code Warriors #35