Pumpkin, Inc.

Pumpkin User Forums

Watching local variable in MPLAB 6.32 in SALVO tasks

For issues specific to Microchip's PICmicro® MCUs, including compilers (e.g. HI-TECH PICC & PICC-18, Microchip MPLAB®-C18) and IDEs (e.g. Microchip MPLAB®).

Watching local variable in MPLAB 6.32 in SALVO tasks

Postby luben » Sun Oct 26, 2003 6:59 am

Hello,

The solution I got is just to name my local variables with unique names like i1, i2 , or to add the name of the task to the variable (like FAKELOCAL makes) - TASK_Serial.i .

The second solution (to implement into the variable name the task name) is better, but requires more efforts when writing the code.


I test this approach and it works. But will be great if I could use the current MPLAB 5.70 approach.

Regards
Luben

[This message has been edited by luben (edited October 27, 2003).]

luben
 
Posts: 324
Joined: Sun Nov 19, 2000 12:00 am
Location: Sofia, Bulgaria

Re: Watching local variable in MPLAB 6.32 in SALVO tasks

Postby luben » Sun Oct 26, 2003 9:54 am

Hello,

I have the following problem:

In MPLAB 6.32 with HiTech PIC16 8.02 PL1 everything compiles OK. But when trying to debbug the program in the watch window I can't see my local variables.

For example, if I have 4 tasks and in all of them I use

static char i;

in the watch window I see only one variable < i >.

In MPLAB 5.70.40 everything was smooth - I was able to get in watch window all my local (both auto and static) variables - FAKELOCAL did the job to create faked names for variables in functions.

Some suggestions and ideas?

Regards
Luben Hristov

[This message has been edited by luben (edited October 27, 2003).]

luben
 
Posts: 324
Joined: Sun Nov 19, 2000 12:00 am
Location: Sofia, Bulgaria

Re: Watching local variable in MPLAB 6.32 in SALVO tasks

Postby luben » Mon Oct 27, 2003 7:38 am

Hello,

Yes, maybe it's more "accurate" for the C rules, but for SALVO it's definately worse - all tasks in SALVO are defined like void functions and suffer from this new "impovement". MPLAB has no sense for the SALVO structure and functionality - it treats the tasks like called functions. Actually, the tasks are different programs (something like multiple "main" programs). The variables, used in SALVO tasks are usually static and have meaning to the task. From other side, when you stop the program flow, it's good to know what's up in different tasks. In this case, the new approach to teat variables in Watch Window is like "step back" - you need additional efforts to fetch this information.

MPLAB structure is perfect for linear programming - in this case the program flow and the local variables fits to current MPLAB watch window functionality. But the multitasking obviously breaks these rules.


Regards
Luben

[This message has been edited by luben (edited October 27, 2003).]

luben
 
Posts: 324
Joined: Sun Nov 19, 2000 12:00 am
Location: Sofia, Bulgaria

Re: Watching local variable in MPLAB 6.32 in SALVO tasks

Postby aek » Mon Oct 27, 2003 11:04 am

Hi Luben.

Maybe the approach the MPLAB v6.x designers took was to interpret the C scoping rules more "accurately" -- e.g. you can only see a function's local-scope variable (auto or static) when you're actually in that function ...

------------------

-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm


Return to PICmicro MCUs

Who is online

Users browsing this forum: No registered users and 2 guests

cron