WATCHing a pin with SX/B (Without using a variable)
John Kauffman
Posts: 653
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
·
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
It does not seem this can be done directly.
You can try this:
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.
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