View previous topic :: View next topic |
Author |
Message |
sergioigel
Joined: 13 Aug 2010 Posts: 26 Location: RJ/Brazil
|
How do I change the value in "windows watches" MPL |
Posted: Fri May 03, 2019 9:53 am |
|
|
Hi,
How do I change the value in "windows watches" MPLABX ?
using simulator...
thanks, |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19539
|
|
Posted: Fri May 03, 2019 10:43 am |
|
|
Ask on the MPLAB forum.
MPLAB is nothing to do with CCS, so you need to ask on the forum
for questions about this, not here. |
|
|
sergioigel
Joined: 13 Aug 2010 Posts: 26 Location: RJ/Brazil
|
|
Posted: Fri May 03, 2019 11:42 am |
|
|
Ttelmah wrote: | Ask on the MPLAB forum.
MPLAB is nothing to do with CCS, so you need to ask on the forum
for questions about this, not here. |
ok....sorry |
|
|
sergioigel
Joined: 13 Aug 2010 Posts: 26 Location: RJ/Brazil
|
|
Posted: Wed May 08, 2019 11:32 am |
|
|
Ttelmah wrote: | Ask on the MPLAB forum.
MPLAB is nothing to do with CCS, so you need to ask on the forum
for questions about this, not here. |
hi,
microchip response:
"Sometimes compilers optimize variables."
...
ccs optimizes this?
and that's why I can not change the values? |
|
|
dluu13
Joined: 28 Sep 2018 Posts: 395 Location: Toronto, ON
|
|
Posted: Wed May 08, 2019 12:35 pm |
|
|
If it's a optimization level that is causing your problem, then you can try this:
Project Properties -> CCS C Compiler -> Compiler Options
Then in the right side of the window, you should be a Optimization Level option that you can change. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19539
|
|
Posted: Thu May 09, 2019 12:21 am |
|
|
OK. I just ran up MPLABX, and played with this.
What you do is there is a little grey square just right of the value.
Click this.
It's totally silly the value is sitting there and you would expect to be
able to change it but you can't. However click on this little square and
it pops up a window, where you can change it.
Brilliant design..... |
|
|
sergioigel
Joined: 13 Aug 2010 Posts: 26 Location: RJ/Brazil
|
|
Posted: Thu May 09, 2019 11:00 am |
|
|
dluu13 wrote: | If it's a optimization level that is causing your problem, then you can try this:
Project Properties -> CCS C Compiler -> Compiler Options
Then in the right side of the window, you should be a Optimization Level option that you can change. |
hi, I try to change the value in Optimization Level. it was at 9 and I changed it to 0 and then to 5 and it did not work. keeps blocking me from changing the value of the variable |
|
|
sergioigel
Joined: 13 Aug 2010 Posts: 26 Location: RJ/Brazil
|
|
Posted: Thu May 09, 2019 11:01 am |
|
|
this is my thread, I started it there. |
|
|
sergioigel
Joined: 13 Aug 2010 Posts: 26 Location: RJ/Brazil
|
|
Posted: Thu May 09, 2019 11:02 am |
|
|
Ttelmah wrote: | OK. I just ran up MPLABX, and played with this.
What you do is there is a little grey square just right of the value.
Click this.
It's totally silly the value is sitting there and you would expect to be
able to change it but you can't. However click on this little square and
it pops up a window, where you can change it.
Brilliant design..... |
for some reason I can not change the value of a variable |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19539
|
|
Posted: Thu May 09, 2019 12:54 pm |
|
|
Seriously, take a step back.
Try a very simple program. One variable, and see if you can change this.
Understand that watch values are not 'live' when the code is outside
the routine in which they are declared. So if you call a function and
return, with a watch declared on a variable inside this function, the watch
will show the value it had when you left the function, but it cannot then be accessed at all. Only when the code is in the function that generates/controls
it. MPLAB will normally switch to saying 'out of scope' when you leave the
function, but some types of variable it does still show.
It is the little square right at the left of the window. Make sure you are seeing
this. It can go off the left edge of the screen and have to be scrolled back.
The one earlier, affects the address of the variable, and you can't change
this. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu May 09, 2019 12:56 pm |
|
|
Click on the "Halt" button to stop the simulator from running. Then you
can change the value. I tested this just now with the LATC register and
it worked.
Click on the little box to the right of the "Value" number.
The little box looks like this:
Then a window will pop up with the current value, such as 0x00.
Backspace over it. Then type in a new value, such as 0x55 and click on
the OK button. It should work. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19539
|
|
Posted: Thu May 09, 2019 1:39 pm |
|
|
Aaargh!....
Never considered the possibility somebody would try to change a value while
the processor was actually running.... |
|
|
sergioigel
Joined: 13 Aug 2010 Posts: 26 Location: RJ/Brazil
|
|
Posted: Fri May 10, 2019 11:17 am |
|
|
I tried all these alternatives and it did not work.
In the old MPLAB v8.92 it worked perfectly.
Even EEPROM values I could change,
but in MPLAB-X it does not change any value. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri May 10, 2019 11:31 am |
|
|
I don't think we can do anything more to help you. |
|
|
|