1. Copy the VDM5 1.dll file in the folder to the "D:\Keil4\C5 1\BIN" directory and the "D:\Proteus7.8\ MODELS" directory.
2. open D:\Keil4\TOOLS. INI file, and add a new line under tdrv8 = bin \ ul2lpc9.dll ("nxp lpc95xulink driver"):
TDRV9=BIN\VDM5 1。 DLL ("Proteus VSM monitor -5 1 driver ")
The "9" in "TDRV5" is actually to avoid duplication with the above labels.
(Steps 1 and 2 only need to be set for the first time. )
3. For example:
Create a new project with keil, such as calling test, compiling normally and generating a hex file (this part is not detailed). The source program is as follows:
# Define LEDS 6
# contains "reg5 1.h"
//led light strobe signal
Unsigned character code Select[]={0x0 1, 0x02, 0x04, 0x08, 0x 10, 0x20};
Unsigned character code LED_CODES[]=
{ 0xc0,0xF9,0xA4,0xB0,0x99,//0-4
0x92,0x82,0xF8,0x80,0x90,//5-9
0x88,0x83,0xC6,0xA 1,0x86,//A,b,C,d,E
0x8e,0xff,0x0c,0x89,0x7f,0xbf//f,space,P,H,.,-};
void main()
{
char I = 0;
long int j;
while( 1)
{
P2 = 0;
p 1 = LED _ CODES[I];
P2 = Select [i];
for(j = 3000; j & gt0; j-); The LED model is pulsed. After the I-th position is lit by a pulse, it will automatically come to a critical juncture.
//Modify the number of cycles, change the delay before the next bit is lit, and get different display effects.
i++;
If (i & gt5)I = 0;;
}
}
4.4. Layout diagram of simulation device of Proteus123. The DSN is in the folder, and this file is saved in the directory of keil's new test project above. (In fact, just make sure that the simulation diagram of proteus and keil's engineering documents are in the same directory. )
5. Find "target 1" on the left side of keil, right-click to select the first item, enter the debugging bar, select the "Use" point on the right side, select the newly created "Proteus VSM Monitor -5 1 driver" in the drop-down menu, and then click the "Settings" button to set the communication interface. Add "127.0.0. 1" after "host". If you don't use the same computer, you need to add the IP address of another computer here (Proteus should also be installed on the other computer). Add "8000" after "port".
6. Click Debug in 6. Proteus, and choose to use remote debugging monitoring.
7. Right-click AT89C52, and then left-click to open the Edit Component window. Select the hexadecimal file just generated in the ProgrammeFile column, click OK, and then run, and you're done ~ ~ ~