hello with the Keil uVISION2 51 simulation,sometimes,the register has been set,but the relative VTREG doesn't get to change .for example,in my programme,some positions of register P1 has been set 1,but PORT1 has nothing changed.In some particular programs,it gets to be worse. I wonder if it's a bug of the Keil simulative programme,and how can I make it work? Thanks and regards Huihl@netease.com
The simulator behaves exactly like an 8051 device. The PORTx VTREG represents the I/O pins whereas the symbol 'Px' (i.e. P1) is the SFR register itself. When you pull the PORTx value low (for example by modifing it in the peripheral dialogs), you cannot get it high by setting the SFR register. This is the same as with the chip (when you force a pin to low, you cannot get it high via the SFR register since it is then used as input). For more information refer to pages like: http://www.keil.com/dd/vtr/2976/1511.htm.
lots of thanks.I have gotten it with your help.