Searching \ for '[PIC] watch window and multi-byte variables' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=pic
Search entire site for: 'watch window and multi-byte variables'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] watch window and multi-byte variables'
2005\02\27@171458 by Bob J

picon face
Is there a way to create a watch and look at multi-byte variables in
MPLAB, when using the res directive?  If I create a word variable such
as temp_byte res 2, obviously when I add a watch for temp_byte I can
see the lower byte; how do I add a watch for temp_byte + 1?

Regards,
Bob

2005\02\27@182448 by Bob Barr

flavicon
face
On Sun, 27 Feb 2005 17:14:58 -0500, Bob J wrote:

>Is there a way to create a watch and look at multi-byte variables in
>MPLAB, when using the res directive?  If I create a word variable such
>as temp_byte res 2, obviously when I add a watch for temp_byte I can
>see the lower byte; how do I add a watch for temp_byte + 1?
>

You can set the properties for each item in the watch window.

IIRC, the way to set them varies in different versions of MPLAB. You
might try right-clicking on a watch item and see if a pop-up menu
appears. If one does, there should be a 'Properties' entry on it. You
should also be able to get there through the toolbar.

In all of the versions that I've used, you can display watch list
items as 8-bit, 16-bit, 24-bit, and 32-bit variables in hex or decimal
notation and in either high-endian or low-endian byte order.


Regards, Bob

2005\02\27@182720 by Harold Hallikainen

face picon face
One way would be to tell MPLAB that it's a 16 bit variable.

Harold


> Is there a way to create a watch and look at multi-byte variables in
> MPLAB, when using the res directive?  If I create a word variable such
> as temp_byte res 2, obviously when I add a watch for temp_byte I can
> see the lower byte; how do I add a watch for temp_byte + 1?
>
> Regards,
> Bob


--
FCC Rules Updated Daily at http://www.hallikainen.com

2005\02\27@201717 by Bob J

picon face
ahh, I see now.  Right-click, properties...Thanks!

Regards,
Bob


On Sun, 27 Feb 2005 15:24:56 -0800, Bob Barr <spam_OUTbbarrTakeThisOuTspamcalifornia.com> wrote:
{Quote hidden}

> -

2005\02\28@063200 by Gerhard Fiedler

picon face
Bob Barr wrote:

>>Is there a way to create a watch and look at multi-byte variables in
>>MPLAB, when using the res directive?  If I create a word variable such
>>as temp_byte res 2, obviously when I add a watch for temp_byte I can
>>see the lower byte; how do I add a watch for temp_byte + 1?
>
> You can set the properties for each item in the watch window.

> In all of the versions that I've used, you can display watch list
> items as 8-bit, 16-bit, 24-bit, and 32-bit variables in hex or decimal
> notation and in either high-endian or low-endian byte order.

Is there a way to see the n-th byte of a byte array? If it is declared as
an array, MPLAB mostly recognizes that and displays all the values. But
sometimes I have only a pointer to it (unsigned char*) and MPLAB doesn't
know that the pointer points to an array with 20 values. But I do, and I
might want to see all of them, or a particular one.

"*pointer" works and shows the value at the address pointer points to. But
"*(pointer+1)" doesn't work. Any ideas?

Thanks,
Gerhard

2005\02\28@211507 by Bob Barr

flavicon
face
On Mon, 28 Feb 2005 08:31:53 -0300, Gerhard Fiedler wrote:


>
>Is there a way to see the n-th byte of a byte array? If it is declared as
>an array, MPLAB mostly recognizes that and displays all the values. But
>sometimes I have only a pointer to it (unsigned char*) and MPLAB doesn't
>know that the pointer points to an array with 20 values. But I do, and I
>might want to see all of them, or a particular one.
>
>"*pointer" works and shows the value at the address pointer points to. But
>"*(pointer+1)" doesn't work. Any ideas?
>

Sorry, I'm not at all sure how you'd go about doing that.


Regards, Bob


'[PIC] watch window and multi-byte variables'
2005\03\02@155326 by Barry Gershenfeld
face picon face

>On Mon, 28 Feb 2005 08:31:53 -0300, Gerhard Fiedler wrote:
> >Is there a way to see the n-th byte of a byte array? If it is declared as
> >an array, MPLAB mostly recognizes that and displays all the values. But
> >sometimes I have only a pointer to it (unsigned char*) and MPLAB doesn't
> >know that the pointer points to an array with 20 values. But I do, and I
> >might want to see all of them, or a particular one.
> >
> >"*pointer" works and shows the value at the address pointer points to. But
> >"*(pointer+1)" doesn't work. Any ideas?

When I need something unusual, I let the program do the work.   If it's for
debugging, I create a variable called 'watch', then have the program fetch
the value pointed to and store it into the location I'm watching.  Makes it
easy to trace.

Perhaps you can use the same trick to take the pointer, do some math on
it, then store it and leverage the array display feature.   Or else just copy
the whole thing to a fixed array you can watch.

Barry

2005\03\03@064630 by Gerhard Fiedler

picon face
Barry Gershenfeld wrote:

>>>Is there a way to see the n-th byte of a byte array? If it is declared as
>>>an array, MPLAB mostly recognizes that and displays all the values. But
>>>sometimes I have only a pointer to it (unsigned char*) and MPLAB doesn't
>>>know that the pointer points to an array with 20 values. But I do, and I
>>>might want to see all of them, or a particular one.

> When I need something unusual, I let the program do the work.   If it's for
> debugging, I create a variable called 'watch', then have the program fetch
> the value pointed to and store it into the location I'm watching.  Makes it
> easy to trace.

Yes, that's what I do, too, or similar at least. I just wondered whether
there was an easy way to see an arbitrary array for which I only have a
pointer -- before adding debug code, and recompiling, and recreating the
same situation and so on.

Thanks,
Gerhard

More... (looser matching)
- Last day of these posts
- In 2005 , 2006 only
- Today
- New search...