PDA

View Full Version : Variables not appearing in Watch Window MPLabv7.3



jd76duke
- 15th June 2006, 06:49
Hi All,

I'm using MPLab v7.3 and PBP 2.46. In previous projects using 18F4550 all my variables were available to watch in the Watch window as "Symbols".

I have started a new project with the 18F8527 and none of my variables are available for watching. There are hundreds of symbols in the drop down list but none of them are my variables.

I initially had all the variables in other files which were included in the top of my Main.bas file. I have since copied all the variable declarations into the Main file: no improvement. I have also checked that in the build options the "Source Level Debug" option is selected.

If I copy a variable name over to the watch window it says "Symbol not found".

Can anyone suggest how I can force MPLab to see my variables?

Thanks, John

paul borgmeier
- 15th June 2006, 07:57
John,

Try this in MPLab (if you have not already done so)

1)Open “Watch” from “View” Menu
2)Open “File Registers” from “View” Menu
3)With the mouse, physically click on your variable name in the File Register Window ( in the name column) and drag it to the Watch window.

Something to try,


Paul Borgmeier
Salt Lake City, Utah
USA

jd76duke
- 16th June 2006, 00:17
Hi Paul,

Thanks for the recommendation. It has helped. I saw some of my BYTE sized variables in the file register list and I can add them to my Watch Window. It seems my real problem is that I can't see Bit sized variables. Most of my variables are single bits as I have alot of momentary switches on my IO pins.

I'm beginning to suspect that maybe the MPLAB doesnt recognize BIT variables.

Thanks,

John

paul borgmeier
- 16th June 2006, 13:41
I'm beginning to suspect that maybe the MPLAB doesnt recognize BIT variables.
MPLAB does not recognize bit variables - it only recognizes byte sized variables. Luckily, as stated in the PBP manual, "Bits are packed into bytes as possible". In the "file Register" window of MPLAB you should be able to find all your PBP declared variables. Because MPLAB only knows bytes and you defined your variables as bits, your assigned names for bits are lost.

PBP will replace your named bits with a single name like "PB01" and "PB02", which will contain your assigned bits (8 per variable). In the watch window, you can see PB01 change as your bits change. You can even drag PB01, etc., to the watch window if you want. The only real difficulty is that the order that you assigned your bits are not mapped directly into the byte name in the same order. For example your first bit declared might be bit0 of PB01 and the second might be bit5. I beleive it is done alpabetically but am not sure - a little elbow grease debugging and you can map these out. Anyway, check it out and see. MPLAB SIM is great!

Paul Borgmeier
Salt Lake City, Utah
USA

paul borgmeier
- 16th June 2006, 14:36
Another option – take control yourself

Switch0_7 VAR BYTE ' define a bank of 8 switches
sw0 VAR Switch0_7.0 ' alias to bit0
sw1 VAR Switch0_7.1 ' alias to bit1
etc.

Use sw0, sw1, etc., as if you had assigned them as bit variables.

Now in MPLAB you will see Switch0_7 and know what bit is what.

Paul Borgmeier
Salt Lake City, Utah
USA