 Good afternoon to one and all. I Priyanka Padmanabhan on behalf of our team would like to introduce our project the emulator 8051. Firstly we would like to thank Professor D.B. Patil for giving us this opportunity to work here this summer. We would also like to thank our mentor Dr. Madhuri Savant and our guide Mr. Pankaj Patil. I would like to introduce our team. We have Alekhya, Pryasi, Sumant, Sveksha and Anupam. Our project is an Android application that has been designed especially for the Akash tablet. It's aim is to make the understanding of embedded systems especially those of microcontrollers easy. This is the overview of our presentation. We start with the introduction. We then have the architecture of the 8051 microcontroller followed by the modeling of the microcontroller in our application, the modules of the application, the difficulties, a brief demonstration, conclusion, future scope and what we learnt. Now breaking down the term emulator 8051, an emulator is a software that imitates the behavior of one computer system on another. A microcontroller on the other hand is a single integrated circuit comprising of a processor, a memory core as well as IO peripherals. The microcontroller that we have used in our application is the 8051 belonging to the MC51 series. Our project is essentially a virtual platform which facilitates the user to build the circuit on the application to write the assembly code, execute the assembly code and view the results both in the form of animations as well as the internal registers of the microcontroller. Now what makes us think that our application is needed in the wild standard market today? The equipment which is currently available for emulators, simulators, oscilloscopes is so expensive that it's practically inaccessible to the students. Our application being free of cost is a good alternative to the use of real hardware. It involves the concepts of circuit designing, assembly coding as well as execution on a common platform. All of this are essential for any embedded designer. The animations that we have used also makes understanding much more easy. Now this is a brief description of the application of comprises of five modules. We have the workbench where the user can draw the circuits which he needs. We then have the assembly editor where the assembly code can be written. We have the internals 8051 where the contents of the internal registers of the microcontroller are displayed. We have a file menu which handles all the file handling operations and lastly help where the user can know more about the application as well as the 8051 microcontroller. Now let's get go into a little detail about the microcontroller itself. The 8051 is a single chip 8 bit microcontroller having 40 pins. It comprises of a read only memory of 4 kilobytes, a random access memory of 128 bytes. It has IO ports with programmable pins, timers, counters and serial data communication is also possible with this microcontroller. This is the pin description. As you can see the user has access to 4 ports. These ports can be configured to be input, output and they also have additional functionalities. This is the memory organization of the 8051. As I said earlier it has a RAM, ROM and external memory can also be added if needed. I now like to call upon Sveksha to continue with the implementation. Now I would be talking about the modeling of 8051. Firstly talking about the internal contents of 8051, up to 4kb of program instruction can be stored in the internal memory of the 8051. The 128 bytes of data memory is directly accessible by the instructions written by the user. Out of which 32 bytes are bit addressable by a subset of 8051 instruction. Further taking you to the software modeling of these hardware specifications. The 4kb ROM has been represented by a string array ROM of length 4096 units. The internal RAM of 128 bytes is represented by the first 128 units of a string array RAM which is of 256 unit length. Out of which the first 32 bytes represent the register banks. The next 16 bytes represent the bit addressable area and the last 80 bytes represent the general purpose area. The next 128 unit represent the special function registers such as ports, accumulators and register B and the program status word or PSW. The flags affected during the arithmetic operations of the program have been handled directly by the corresponding bit values of the PSW. Now before taking you to the first module of our application I would like to give you a gist of the workflow of the emulator. Entering into the application screen via launch screen and home screen we can see three basic modules. The first the workbench, the second the assembly editor and the third the internals 8051. The workbench provides an option to create the circuit, the assembly editor provides an option to assemble the code, both of both the modules provide the user with an option to perform file handling operations. Now talking about the very first module of our application which is the workbench. The workbench which is the very basic user interface of our application. This is how it looks. It has the 8051 microcontroller chip and the power timer and pull-up circuit already placed on the grid. To the right there is a panel which contains three buttons. The first to create the circuit. The second is the execute button which allows the user to run the experiment. The third is the oscilloscope button which pops in the graph if the user uses the digital to analog converter circuit. The workbench facilitates the user to perform different experiments with the help of different circuit interface that are provided in the circuit panel. These circuits are the seven segment display, the LED circuit, the stepper motor circuit and the digital to analog converter. The assembler updates the port values according to the assembly code that is written and the corresponding animation could be seen on the formulated circuit which is present on the workbench. For an instance the glow of the LED which is shown in this picture has been is depicted once the code corresponding to this has been written. Now, Preyasi will take you further to the next module. The next module of our application is assembly code editor. Before going to assembly code editor, I would like to give you a short description about assembly language and the assembler. So, what is assembly language? Assembly language is basically a low level language for a computer or other programmable device in which there exist a very strong relationship between the language and the architectures machine code instructions. Next and what is an assembler? This is basically a utility program which actually converts the assembly language into the executable machine code format. For example, the assembly code move a comma r 0 is converted into the binary format of triple 1 0 1 triple 0 to be understable by the hardware. Now, coming into the world of hardware what user faces when he actually interacts with the 8051 microcontroller board. User has to write the exact opcode. He has to embed the opcode into the into the microcontroller board and then he has to execute the code in order to see the outputs in the external devices connected. But in our application we are providing the user with a facility in which he is able to write the direct assembly code so that the difficulty of memorizing all the opcodes is reduced. This is the basic user interface for our assembly editor in which the assembly workspace is a text area. The user writes the assembly code and taps on the assemble button. The editor we are providing is capable of detecting errors. The code is the code is compiled line by line and the opcodes are fetched and it saved in the corresponding memory addresses of the microcontroller. If the code contains any error the all the line numbers containing error are shown in the lockcat module next. And if the code is error free the user is intimated with the message compiled successfully which is shown in the lockcat module as well as the ROM contents and the memory uses area is updated which shows the total memory uses. In our application we have implemented the concept of two pass assembler in order to avoid the difficulty of finding the label addresses which is basically depends on the user. For case of branch instructions the sequence of execution is changed from one part of the code to the another that is why we have implemented the concept of two pass assembler. Now I would like to call upon Suman to continue further. Now I am going to present you the one of the module of a project that is internals 8051. This is the layout of the internals 8051 module and we can see the type of registers where the memory content is stored. And this interface usually displays the internal memory content of the RAM. After assembling the code the registers in the form of string variables read the updated values during the execution of the program and display it in the form of hexadecimal. And in this internals 8051 module we have the type of registers there CPU registers, general purpose registers, data pointers, ports, timers and interrupts. Now going to the specific functionality of each registers the CPU registers usually store the arithmetic and logic units. The general purpose registers store the variables and some other data useful for the microcontroller. And this data pointers allow the 8051 to access external memory. And this ports access to transfer the input and output data for the microcontroller. And on moving to the next module that is help menu. It acts as a guide for the user on how to use this application and very basics of the 8051 microcontroller and some list of experiments. And this module usually consists of three submenus they are user manual, about 8051 and the experiment list. By moving to the user manual it gives the complete information to the user on how to use this application and it gives the specific functionality of each and every specific button in which we used in this application. And as moving to the about 8051 it gives the very basic information about the 8051 microcontroller that sits architecture, its interfaces with different circuits and the assembly instructions. And the experiments list consists of some experiments for the user so that he can perform these experiments on a workbench and can see the animated output here. Now like I would call upon I like you to continue the presentation. I'm here to tell you about the file handling part implemented in this application. It provides the user the options to create a new project, save the project, delete the project and open the previously saved project. On tapping the new button the circuit and code both get cleared providing the user a new workspace. On tapping the save button the user can save the circuit and code. This is done by saving two files in a folder. They are the circuit.sch and the code.asm. Circuit.sch is a schematic file which saves the IDs of the circuit. For example, here 1200 says that LED circuit is connected on port zero and code.asm file will have the text written by the user. On tapping the open button a list view of project saved before will be appeared and on single click the experiment will be loaded. On long click the option to delete will be appearing. Moving ahead in the development of this application, we have faced some difficulties. The one of the thing is to deal with the jump instructions when the labels are used by the user. For this we have implemented the concept of two pass assembler which on its first pass gets the labels, stores them and on the second pass it will give the memory address to the labels. And we had a problem to the simultaneous execution of the code and showing the animations on the canvas. For this we have implemented the timer class in Java which runs on UI thread which invalidate the canvas. And we thought of using the SVG images for the animation, but it was a difficulty to change the XML of SVG images during the run time. So, we had to use the PNG images for the circuits and animations are done on the canvas. I will go ahead by showing the demonstration. Launching the application emulator 8051. This is the splash screen which will lead us to the tab which have two tabs the introduction and the about us. Introduction gives a brief introduction about the 8051 emulator and about us tells about the information about the developers. On introduction tab we have two buttons take a tour and start. On clicking start the main workbench will be loaded and on take a tour a video which will show the usage of the application is provided. Now, I will be showing the video. This is the introduction please and on clicking the start button the workbench is loaded where we have the button to create the circuit. On clicking the create circuit we have the four of four ports. Here are the options to select the circuits and on clicking on the LED circuit it is selected. On clicking the build button the circuit is loaded on the workbench. Going to editor to write the assembly code. Here the instruction which is written will be move P0, hash phi h. After the instruction is written the user will be assembling the instruction by clicking the assemble button where he can see the message and the contents. Going back to workbench to see the animations. Clicking on the execute button you can see the output that LEDs glow. And on internal 8051 he can see the register contents changing. On opening the drawer for the file handling operations. For save he can save the experiment both the circuit and the code. The open and new buttons are also provided. And the other tab is help. Where he can get the three documents user manual about 8051 and the experiments list. Now I will be demonstrating a simple experiment of glowing LEDs alternately. Where the microcontroller is placed and clock reset and pull up circuits are also placed which trigger the microcontroller. The three buttons create circuit execute and oscilloscope can be seen. On clicking the create circuit button there is a circuit panel where we can select the circuits on different ports. On port 2 I will be selecting the LED circuit and on clicking build the circuit is placed. Going to editor to write the assembly code. The instruction is move A comma hash 20 h. This sends accumulator the value 20 and then main is a label which I will be using later for loops. It is move P2 comma hash 55 h which will enable the orbits of the port 2 and then NOP instruction for some delay. It is no operation instruction and move P2 comma hash AAH. This will enable the even bits of the port 2 and then I will be decrementing A. Yes sir. I want to show. Then yes sir we will be doing that also. It is Jnz main. Then on assemble button I have got an error that we have an error in line number 4. So I will be correcting it. Then on assemble I can see the message that compiles successfully the ROM usage and the ROM contents. Going back to workbench to execute the circuit. On clicking execute button we can see the LED is glowing alternately and on internal side 051 we can see the port 2 value updating dynamically. I will be now showing some other experiment that I have already saved earlier. In this experiment we can see that on port 0 we have a stepper motor circuit and on port 1 we have 7 segment display circuit. In this experiment we will see as the stepper motor rotates the 7 segment displays the direction of motion that is it displays C in case of clockwise motion and A in case of anti-clockwise. This is the corresponding code in the editor. Here we can here we will be rotating the stepper motor 5 times in clockwise direction and 5 times in anti-clockwise direction. When I assemble this code and run this we can see that the stepper motor is rotating first clockwise and now anti-clockwise. The corresponding values of internals are like this. Now I will show one more experiment. Here we will be generating a rectangular signal. This is the corresponding code for the same. When I assemble and run this on the oscilloscope we can see that the rectangular signal is being generated. That is in the demo section. Moving ahead. All these modules were integrated together to give the user a feel of real lab in a virtual environment. The level of user interactivity was done so that it gives user a better understanding of the 8051 microcontroller. Since it's a virtual lab basically it eliminates the cost of hardware requirement hence the cost is not an issue. While building this application we face a number of difficulties and a few challenges were handled and some are listed in this as a future scope of the project. The first one is making it executable for closed loop systems. Next is serial communication and external interrupts can also be included. From the workbench perspective a greater variety of circuits can also be made available to the user. Next is an option of coding through a C compiler can be provided. And lastly we can give an option of automatic generation of reports once the user is done with this experiment. Moving ahead. Now what we learn from this whole internship. Firstly is the android development. We all of us learn the android application building from a Hello World program to this application where we use a number of functionalities like the tab host menu, the timers, the UI threads. Then we also had sliders, we had animations on the canvas and lots more. Then we also understood the assembly programming in a better way. Since we not only use those assembly instructions but also we the since we need to build a assembler the parsing of those instructions is also done. Next is the teamwork. We all understood that the need of working in a team in a better way and also how to manage our time well. And lastly the document methodology that we followed helps us to understand the UML modeling and also the convention that we should follow while making a document. Very nice work. In fact I happen to be in a BLSI short-term course yesterday at father et al. And there were about 40-50 faculty members who come from various colleges and I was talking about a software that we had and everybody wanted to have a microcontroller simulation which is precisely what you have done. Apparently this is used in all BE projects. So all the electronics people are very keen on this. First of all what is your background? Are you CS people, IT people, electronics people? Mix. So you have all. So it's very nice. I would like to explore how difficult it is to add this you know this feature to something like let's say key CAD. Are you familiar with key CAD or ng-spice? Is it easy or difficult? What do you think? Assembler should be in key CAD and key review C programming. So it is doable? Yes. The corresponding assembler we have to do. So you have an emulator? I mean assembler is available? Yes. It is already available or you created the assembler also? To interpret all the... 255 instance. Very good. Select. What is the limitation currently? Because your emulator would have internally allocated sub-memory to hold instructions and so on. So what is the longest program for example which I can write? The ROM is a 4kb and if you want you can add external memory also but in emulator we didn't provide it. So up to 4kb? Yes sir. How have you tested that all 8051 instructions are properly executed? So we have tested every instruction. Every instruction individually. Does your report contain the test report as well? No. So it is interesting to know how you tested them. Can you comment on let's say just one instruction and how did you test it? So manually testing every instruction. So the answer is not what we are supposed to get and try to analyze what we were doing wrong and then after we did the changes we again tested the instruction that we got from the first time to check it again. That is because you can observe the register contents and everything after everything. So you have made sure that the emulator behaves exactly like what in 8051. Yes sir. We have reported all instructions. Although the output were available so we can always verify with us if the instructions are being passed properly. Good. So let's give them a big hand. I would just like to make one comment. Kannan asked that are you from electronics are you from computer science? So they are from a mixed breed. However when later on Professor Kannan was asking some additional question on integrating it with this or this you could see two or three people in the team were very comfortable but the others had not heard of those terms. They are probably CS guys. IT. Okay. Now this is a very very important point that all of you have to remember. In days ahead and this was I think universally to always but more important now most of the problems that you will solve in real life will be interdisciplinary in some way or the other. The tragedy of existing education system is that you are here to learn things only in a specific area almost at the cost of exclusion of everything else. This was not so traditionally in engineering education. Everybody was trained to be fundamentally a good engineer which means that basic knowledge of all the branches of engineering as known then was required to be taught and learned by every student and then of course you specialize in your topic. With the completion of five year program to four year program and with enormously large amount of knowledge getting added to every branch this has not been possible. There are for example computer science students and there would be amongst you who have no clue on hardware. Am I right? Can you raise your hands if you are not comfortable with hardware? Many of you. Feel free yeah. There's no harm in admitting that. But I want to tell you that that will not work in future to the best of your advantage. Now this is the time when you are in the college. This is the time when you keep your eyes and ears open. One of the reasons for such projects is that a group of people participate and that group then entirely comes to known integrity of all other related topics. That is one of the reasons why I want all of you to listen very attentively to what is going on. So that you will you may not learn everything about the other field but you will know how that learning has to be acquired and how work needs to be done joint. Just to give you an example Professor Kannan who was confidently asking them about interfacing this to that to that. You might all believe he's a professor of electrical engineering. He is not. He's a professor of chemical engineering. He actually has a chemical engineering degree from IIT Madras. Of course subsequently he cheated and acquired an electrical engineering degree from Rice University. See he is more like a control systems person but because of his strong chemical engineering background he can talk very authoritatively of all kinds of controls which are required in chemical engineering and in general in other. So I would like all of you to remember this. Never ever underestimate the need and importance of knowledge in other areas which you might not have formally studied but it's absolutely important. Look at the earlier project you know optics for example all of us have forgotten without learning and mastering the specific optics part they would not have done what they have done. So that is another requirement that you should be able to do. Thank you so much.