Shop OBEX P1 Docs P2 Docs Learn Events
SX/B - Watched Bit not Showing Changes — Parallax Forums

SX/B - Watched Bit not Showing Changes

Sparks-R-FunSparks-R-Fun Posts: 388
edited 2006-10-31 18:45 in General Discussion
I suspect Bean will be the best person to answer this, though perhaps I am overlooking something someone else can spot.

I was trying to debug a large program by watching the state of one of my bit variables. In the process I discovered that the bit is changing but the change is not being reflected in the watched variables window or at least not in the manner I expect. (I see no change, It always reads %1.)

I have attached a very small program that replicates the condition I am experiencing. The program changes the state of bit 7 of my first variable. I expect the watched value to change in the watch window as I step through the program. It does not. Have I done something wrong?

If you run the attached program in debug mode until the BREAK statement, then step though it, you should see this condition replicated. I am using IDE Ver. 3.2.3 and SX/B v1.51.03.

- Sparks

Comments

  • metron9metron9 Posts: 1,100
    edited 2006-10-27 07:13
    If you use

    watch systemstatus, 8,ubin

    it shows up

    Perhaps a watch on an individual bit alias is not possible. I can't make it work on a bit alias

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Think outside the BOX!
  • BeanBean Posts: 8,129
    edited 2006-10-27 10:38
    I think that was fixed in the latest version of the IDE. You can download version 3.2.3 from here http://www.parallax.com/sx/downloads.asp

    Bean

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap used 4-digit LED display with driver IC·www.hc4led.com

    Low power SD Data Logger www.sddatalogger.com
    SX-Video Display Modules www.sxvm.com

    "People who are willing to trade their freedom for·security deserve neither and will lose both." Benjamin Franklin
    ·
  • Sparks-R-FunSparks-R-Fun Posts: 388
    edited 2006-10-31 16:46
    Sorry for the delay. I've been away.

    Bean - I am using V 3.2.3! Do you get a different result? I tried it again this morning just to double check everything. The bit in the watch window still does not change, though today it was reading %0 always. When I posted earlier it was showing me %1 always.

    metron9 - You are right. Using "watch systemstatus, 8,ubin" does indeed show the bit changing. So I am good. I can just use that.

    Obviously this is not a large concern. It is just something I saw occurring that differed from what I thought should occur. I wanted to determine whether it was a problem within the IDE or just with my understanding of it.

    Thank you for your replies!

    - Sparks
  • BeanBean Posts: 8,129
    edited 2006-10-31 17:35
    Sparks,
    I did a little more investigating, and I found that if the bit is in the global memory area (< $10) then it doesn't work. But if the bit is NOT in the global area (>= $10) then it does work.

    If you want you can declare some byte variables before the one you want to watch and that will move the bit out of the global memory area.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap used 4-digit LED display with driver IC·www.hc4led.com

    Low power SD Data Logger www.sddatalogger.com
    SX-Video Display Modules www.sxvm.com

    "People who are willing to trade their freedom for·security deserve neither and will lose both." Benjamin Franklin
    ·
  • Sparks-R-FunSparks-R-Fun Posts: 388
    edited 2006-10-31 18:45
    Ahhh... Ok.

    It seemed to me that I had watched a bit variable before without incident, but I was not certain. Thanks for narrowing the scope of the problem. It is easy enough to work around.

    - Sparks
Sign In or Register to comment.