Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
05/23/02 17:28
Read: times


 
#23344 - RE: keil simulator
Yes, you can create a debugger script to wiggle the port pins of the simulated 8051.

The Keil simulator provides VTREGs (Virtual Target Registers) that you can manipulate to simulate the input of data outside the part.

Each port has an SFR (P0, P1, P2, ...) that you already know about. Well, in the simulator, there is a VTREG called PORT0, PORT1, PORT2, and so on. The VTREGs allow you to change the input values on the PORT pins (not the SFRs). So, If my program reads P1.1, I can write PORT1 |= 0x02 (to set the input pin to high). When My program readl P1.1, it will read a 1. I can write PORT1 &= ~0x02 (to set the input pin to low). Then, my program will read a 0.

If you use INT0 (P3.2) you can use the same method. PORT3 |= 0x04 to set and PORT3 &= ~0x04 to clear. If you have configured the external interrupt 0, changing the input to P3.2 will trigger an interrupt (just like in the real chip).

Refer to the following 2 knowledgebase articles from the Keil web site for more information on stuff you can do with the PORT VTREGs.




Jon


List of 5 messages in thread
TopicAuthorDate
keil simulator            01/01/70 00:00      
RE: keil simulator            01/01/70 00:00      
RE: keil simulator            01/01/70 00:00      
RE: keil simulator            01/01/70 00:00      
RE: keil simulator            01/01/70 00:00      

Back to Subject List