Now, for the execution of the program, I am going to use simulator- Proteus 8. A simulator is a software that is used to test the program written for another machine before loading it. It is good to simulate the program first because a bad program can damage the whole system, and once it happens, the inner grief will tear you apart and I don’t want to that to happen to my readers. The point is that you are allowed to do mistakes without the risk of damaging your system.Proteus 8 is one such software. For simulation of the program in Proteus, follow these steps given below:
Setting up the Proteus:
- Open Proteus. At the home page, click on New Project.
- Type the name you want to give to your project and then hit next.
- Click on a circle that says create a schematic from a selected template, and then select DEFAULT and hit next.
- Click on a circle that says do not create a PCB layout and hit next.
- Click on no firmware project and hit next.
- Hit finish
- The page appears should be something like this.
Designing of the Circuit:
Now, this is your workplace in Proteus. We are going to design a circuit in this page only. We can simulate the circuit as well. For designing the circuit, we have to add components which can be done by:
- In the left corner, there should be a label named device. Click on P button and under the Keywords block, type Atmega 16/32. Double click on Atmega 16/32. It should be added in your device list. Similarly, under the keyword type “LED-“. Click any colour LED you want to add.
- Click on Atmega 16 and place anywhere you want to. Similarly, click on LED and place anywhere you want to. For ground, there is an option in left side called terminal mode. Select ground and place anywhere you want to. Draw the schematic as shown below.
Simulation of the program in Proteus
Now our work is almost done here. Our circuit is for simulation is complete but for simulation of the program in Proteus, we have to add the program in this microcontroller. For that follow the steps given below-
- Double click on Atmega 16/32. There should be a window appear out of nowhere. There in the option-program files, click on folder icon button and go to the folder of your project. In the folder, there should be another folder named Debug.In Debug, double-click on your “.hex” file. Drop down the CKSEL Fuses option and click on the frequency 4 MHz and hit OK.
Now you have loaded this program into the microcontroller Atmega16. You just have to simulate the program.
Click on the play button in the bottom left corner of the page and if everything works fine, your LED should Blink. Congratulations!!!