Shop OBEX P1 Docs P2 Docs Learn Events
WATCHing a pin with SX/B (Without using a variable) — Parallax Forums

WATCHing a pin with SX/B (Without using a variable)

John KauffmanJohn Kauffman Posts: 653
edited 2006-09-29 01:31 in General Discussion
WATCHing a pin with SX/B (Without using a variable)
·
Is there a way during debug mode to WATCH the value of a pin directly, that is without putting it into a variable?
·
Following code works:
·
'

' VARs DECLARATIONS
MyButton var Bit
Watch MyButton,1,UBIN
·
Following code won’t compile because “The symbol <rb> is not defined”
·
'

' VARs DECLARATIONS
Watch RB.3,1,UBIN
·
Thanks

Comments

  • YendorYendor Posts: 288
    edited 2006-09-26 18:27
    Not sure if this helps, and kinda deviates from your question, but I believe you can see the highs/lows in the SXSIM, under I/O Panel.
  • Sparks-R-FunSparks-R-Fun Posts: 388
    edited 2006-09-28 21:40
    John,

    It does not seem this can be done directly.

    You can try this:
    '----------------------------------------------------
    ' VARs DECLARATIONS
    MyButton var RB.3
    Watch MyButton, 1, UBIN
    
    


    This does not seem to use any on-chip RAM and will let you observe the direction setting (Input = 1, Output = 0 ) of the pin while using the debugger.

    I suspect that you really wish to see the High/Low status of the pin when configured as an input. The only way I know to accomplish that through the debugger is to watch the register settings each time the program is paused or polled. Find the bit position of the input you wish to observe in one of the 'R' registers and observe its value.

    I hope this helps.
  • BeanBean Posts: 8,129
    edited 2006-09-29 01:31
    This looks like a question for PeterM.
    What's funny is that you CAN watch RA, but not RB or RC ???

    P.S. You can WATCH RA or WATCH RA.0, but WATCH RA.1 doesn't ever change (nor RA.2)

    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

    There are only two guaranteed ways to become weathy.
    Spend less than you make.
    Make more than you spend.


    Post Edited (Bean (Hitt Consulting)) : 9/29/2006 1:35:13 AM GMT
Sign In or Register to comment.