UMPS is perhaps most efficient virtual simulator for simulating the programs of 8051/52/2051/4051, PIC micro controllers, HC micro controllers, AVR micro controllers etc. It provides perfect platform for simulating real time applications. It has wide varieties of peripherals to connect with micro-controllers like in display there are LED, matrix LED, alpha numeric display, all type of LCD etc. Other peripherals like ADC, DAC, serial transmitter-receiver, function generator, I2C memory, I2C display, PWM converter, digital recorder and player, shift register etc. are given to design any embedded system. With the help of umps, one can create virtual 8051 training board on his computer’s desktop. He can simulate all kind of programs by connecting required resources like 7 segment display, Matrix LED, LCD, Matrix keyboard and all he wants.
click here to download zip folder for this software
Here I have explained one example in which one can easily understand the operation of UMPS software. It describes how to edit compile and run a simple LED blinking program on port P0. Also it explains how to connect LEDs with port and see the chasing effect on them.
First open UMPS program from start menu -> all programs-> umps 1.91 demo-> umps 1.91 demo. You will see following screen.
Now first one has to load the precompiled CPU file available in configure menu. So open configure -> load CPU
You will be asked to load desired CPU from all given CPUs. As you have to work with 8051 assembly language, select either 8031.cpl or 8032.cpl file and click OK.
You will see the following message on your screen. Click OK.
Now you will see all the menus are enabled. Now from file menu click new file to create new file or you can open any existing file from open file tag. If you select new file then editor area will open where you can write program.
Write down a simple program for blinking LEDs on port P0 as given
mov p0, #00h
mov a, p0
loop: rlc a
mov p0, a
You will see that mnemonics org and end are highlighted as bold green and all other opcodes like mov, rlc, sjmp etc. highlighted as bold black. Now save the file as name “blinkled.asm” to any particular directory or folder. Then open program menu and select compile (or just press ctrl+F9). Move to your directory or folder and from the list find out “blinkled.asm”. Click OK.
You will see the message box appears showing status of compilation. If there is no error then it will show “END” otherwise it will indicate an error with line number and type of error. Solve the error and again compile.
After compilation we shall run the program. But before that we have to reset CPU by pressing ‘RESSET’ button
on toll bar. There are many options given to run program like step over, step into,
go (run) etc. So if you want to execute program step by step then press step over button from toll bar. You will see the program is executing step by step. In the status bar you can see the CPU time and number of cycles executed (both the things can be viewed from view->cpu status menu).
Now to see the output go to configure->cpu register. The cpu register window will appear on screen. Then click ‘add’ button and you will see the list of all register appears on screen.
Select registers P0, Acc and CY one by one as shown in figure.
Now as you execute the program you will see the values of P0, CY and ACC changes. If you right click any register then popup menu will appear to change the base in decimal, binary or hexadecimal.
If you double click register then the window appears to change the value of register.
If you enable cpu register window by clicking configure->cpu register and double click on any register then following window will appear.
From here you can change color setting of register name as well as value, its alignment, base name position, width etc.
Yet we want to see actual output appearing on port P0 indicated by LEDs. So we have to connect LEDs with port P0. For that select resources from configure window. Resource window will open. Then click add button and you will see number of resources like LED, seven segment display, push button, LCD, ADC and lot more.
Select one by one eight LEDs. Double clicking on any LED will display following window.Using this window you can change color of LED as well as name.
Select one LED and click on connection
button. Following window will appear.
You will see both anode and cathode terminals of LED are given. Now scroll down CPU register window and select P0. Select ‘b0’ from register bit. Then select anode of LED and click connect. Connect cathode with ‘always 0’ and click OK. Do same thing for all leds and connect them with from ‘b1’ to ‘b7’ respectively. Now as you run the program you can see the chasing effect on LED.
Let’s add one more thing to program. Edit the code as given below
mov p0, #00h
wait: jb p1.0, wait
mov a, p0
loop: rlc a
mov p0, a
Now program will wait in the loop till pin p1.0 is high. As it becomes low chasing effect will start. Again compile program and reset cpu. Now in step mode program will stop at that instruction and keep repeating loop till pin p1.0 becomes low. To make it low we shall connect a push button switch with that pin. So again select resource tab from configure menu and click add button. This time select push button from menu. As you double click on switch following window will appear.
One can set all the properties for the key like name, display, connection type etc. configure key as you want. Then click connection button and you will see this window.
There will be either two or three pins on key is given. Select ‘in’ and connect it will ‘always 0’. Select ‘out’ (or ‘out2’) and connect it with ‘b0’ of P1. Click OK. Now again continue to run the program. The program is still repeating same loop. But as you press switch on next step program will jump out of loop and start chasing effect.
You can also add register P1 in cpu register window. For that activate cpu register window by selecting configure->cpu register window. Then click add button and select P1 from window. Now the complete window will be as shown.
Here I have explained use of umps with the use of only one example. But one can connect all the resource given in resource window with 8051. For proper connection and operation of any resource one can always use umps help. For that click help -> index -> resources. You can get simplified datasheet and some useful information regarding that resource. Use this information and connect any resource with 8051.
So just go on….. ALL THE BEST!!!
Project Source Code
Filed Under: Electronic Projects