Keil™, An ARM® Company

Technical Support

DSCOPE: SBITS DO NOT CHANGE WHEN USING MON51


Information in this article applies to:

  • C51 Version 5.50

SYMPTOMS

My program defines an sbit for bit 0 of port 1:

sbit db0 = P1^0;

When I simulate my program in dScope and set a watchpoint on db0, the value shown is correct. However, when I use MON51, the watchpoint on db0 shows it as always having the value '0'.

CAUSE

This appears to be a bug in dScope. When it updates the value for P1, it fails to update any related sbit variables.

RESOLUTION

A workaround is to define a bit variable and assign it to the sbit you wish to observe. You can then set a watchpoint on the bit variable. For example, when P1 changes in your program, add the following line:

real_db0 = db0;

Declare real_db0 as a bit:

bit real_db0;

Last Reviewed: Sunday, March 12, 2006


Did this article provide the answer you needed?
 
Yes
No
Not Sure