How to connect Proteus with Keil IDE

Let’s explain now how to configure Proteus VSM to work with C Keil IDE. The interaction beetwen Proteus and C Keil is achieved via the Virtual Debug Monitor (VDM) interface. if Keil C  and  Proteus are properly installed , copy the dll VDM51.dll from for example  C: \Program File\Labcenter Electronics\ Proteus X Professional\MODELS\VDM5 1. Dll  to the C: \ Program Files\keil \C51\BIN directory.

use Notepad for editing  the file  C:\keil\TOOLS. INI file

under the section [C51] you’ ll find the line

TDRV0=BIN\MON51.DLL (“Keil Monitor-51 Driver”)

immediately below add the line that specifies the location of the dll

TDRV1 = BIN\VDM51.DLL (“Proteus VSM Monitor-51 Driver”)

then save the tools.ini file.

Now open the Keil IDE to create a new project

 

 

select the CPU AT89C51

the Source file is the following:

# define LEDS 6

# include “reg5 1. h”

unsigned char code Select [] = {0x0 1, 0x02, 0x04, 0x08, 0x1 0,0 x20};

unsigned char code LED_CODES [] =

{0xc0, 0xF9, 0xA4, 0xB0, 0x99, // ​​0-4

0x92, 0x82, 0xF8, 0x80, 0x90, // ​​5-9

0 x 8 8, 0 x 8 3, 0 x C 6, 0 x A 1, 0 x 8 6, // ​​A, b, C, d, E

0x8E, 0xFF, 0x0C, 0x89, 0x7F, 0xBF // F, space , P, H,., -};

void main ()

{

char i = 0; long intj; while (1)

{P2 = 0;

P1 = LED_CODES ;

P2 = Select ;

for (j = 3000; j> 0; j –); // This LED models pulsed light , pulsed light by the //i-th bit , it will modify cycles , changing light delay before the next one , //get a different display.

i ++;

if (i> 5) i = 0;

}

}

 

click the “Project menu/Options for Target” option

 

In the dialog box that appears, on  “Debug” tab, select “Proteus VSM Monitor-51 Driver” as shown in the image

Proteus_page96_image1

Click “Use” ,then click “Setting” button to set the communication interface, in “Host” add  “127.0.0.1”. As number of port edit 8000.Finally, compile the project.

Proteus settings

Into the Proteus ISIS, click the left mouse button on the menu “Debug”, select “use remote debuger monitor”, as shown below.

Proteus_page98_image1

Click the Start button to run the simulation, we can observe each pin frequency variation, red for high power frequency, blue represents low-frequency.

Posted in Proteus and tagged , , , , , .