I talked about some basic simulators for the 8051 micro-controller in my previous post. They are strictly for beginners (if you’re one) as you can only verify the output by checking the values on ports, pins, and internal registers etc. To be honest, that’s how you get to learn the basics and see how everything works internally in the micro-controller. However, sooner or later, you’ll be going a bit further (if you’re really interested) and will need to attach (interface) external hardware because that’s exactly how we intend to utilize a micro-controller. This is where Proteus comes in – a complete simulation platform.
WHAT IS PROTEUS?
It’s pretty much obvious by now that Proteus is a simulation platform for different micro-controllers. You can attach a variety of electronic components as required by your project. It has a complete library and you’ll find it sufficient for your needs like (to name a few in general) resistors, capacitors, LCDs, LEDs, keypads, and different ICs etc. You can actually design a complete circuit and simulate the output. Here’s how you’re going to do it.
- Write and compile your code in Keil uVision (this gives you the desired HEX file).
- Debug your code in Keil (optional) just to make sure it works the way you expect it to.
- Simulate the whole project in Proteus.
It will work or it won’t. Either way, you’ll be able to track down any bug or flaw in your code (hopefully) and make changes accordingly. This will completely ensure your project’s success – at least you’ll have a working prototype.
It’s a paid application but you can still download the demo version free of cost from their official website. It’s a fully functional package and you can use it for running your simulations as long as you want. The only crucial limitation is that it won’t let you save your designs.
It’s designed to be user-friendly and you’ll have no problem getting familiar with the different features and options. Also, you don’t have to worry about some confusing configurations or settings prior to simulation. Few clicks here and there and you’re ready to go. Here is how.
- Select and place components using the library.
- Connect all the components as required.
- Load HEX file (if you’re using micro-controller).
It’s even simpler than it sounds. Let me demonstrate each step graphically.
Suppose I want to place AT89C51 micro-controller in the design area. Here’s what I’ll do.
- Click the Pick from library (P) button as shown in the image.
- Select a category
- Micro-processor ICs in my case.
- Select desired item from the list
- AT89C51 in my case.
- Click OK button.
You can also search for your desired component using the search keywords. After selecting component from the library, left-click anywhere in the design area to activate the selected component and then left-click again to place it in your desired place. You can place all your components this way.
- Place all the required components from library.
- Connect each component by clicking at start and end nodes.
Loading HEX file
If you’re using 8051 or any other micro-controller, you need to load the HEX file that you generated using the relevant compiler.
- Double click the 8051 micro-controller component to open its properties.
- Browse for the HEX file and load it.
And as luck would have it, you don’t have to worry about the reset circuitry, oscillator input, or power input to utilize the micro-controller in Proteus. It’s all set beforehand and you can simply ignore it. You can change the operating frequency from the properties if required.
Simulating the Circuit
So far, in this tutorial, I have placed a micro-controller and one LED. I have also loaded the required HEX file that contains the actual code for toggling this LED connected to P2.0. The controls at the bottom-left corner will help you simulate the circuit in real-time. You can start, stop or pause the simulation anytime.
When you start the simulation, you will actually see the LED turn on and off. How to toggle LED? Well that’s a tutorial for another day perhaps. For now, I hope you’ve grabbed the basic idea of how to simulate something in Proteus. Happy simulating!