How To Open Source Code In Proteus

Proteus is an open source, commercial product with the project being built with the intention on releasing the source code under an open source license. It has all of the features that you would expect in a professional workstation: Intel Core i5 dual core processor, 4GB of memory, and 240GB SATA hard drive. It comes with Adobe After Effects CS3 software, Windows 7 Professional (64 bit) operating system, Sony suite of digital image editing software.

Want to open source a great game but don’t know where to start? Here’s the perfect guide for programmers and designers alike. Open Source Game Development starts with a step by step introduction of Proteus’ source code, and this book can help you learn how to write your own game software from scratch. All of the game features are explained through actual programming examples, and each chapter ends with a sample game project that you can download and modify as you wish! You’ll learn exactly what I’ve learned during the creation of Proteus, including things like: – Correct design decisions that lead to better quality code faster – Tips on working with designers – Alternative approaches for specific tasks – Useful advice on areas like database security, multiplayer development, object-oriented programming, real time network programming. This isn’t stuff you can easily find in professional books written by other authors!

What is Proteus and How Does it Compare to Other Simulation Software?

Proteus is a simulation and electronic design development tool developed by Lab Center Electronics. It is a very useful tool as it ensures that the circuit design or firmware code is working properly before you begin to physically work on it.

It has an extensive number of components in its library which can be used to virtually design your circuit. The designs you make can be easily compiled and debugged through Proteus’s virtual meters (voltmeter and ammeter), oscilloscope, serial monitor, and more.

I prefer Proteus for Arduino project simulation because of its extensive collection of libraries. However, it is not only limited to simulation — you can also make PCB designs with it.

TinkerCAD is also another tool that can be used for simulation.Developed by AutoDesk, it is a cloud-based software which is only limited to Arduino simulation.

If you are a beginner to Arduino and circuit design, then I recommend you try out TinkerCAD. If you want to work on a cool project which involves some circuit design, I recommend Proteus.

These compilers each generate a debug file, if enabled in the output options. You have not mentioned your compiler, so I am going to give an example for Hi-Tech C for PIC10/12/16. Your compiler is going to generate a .cof file as well as a .hex file after the compilation, if enabled in the compiler output options.

Double click your PIC in proteus, “Edit Component” dialog will appear. It is the same window that you include your hex file, however this time you are going to include your .cof file:

Edit Component

Click “OK” after you have included, now double click on your crystal if you have any, and click and activate the box labeled “Exclude from Simulation”, click “OK”, do the same for the capacitors that are connected to that crystal, if any.

Now click on “Advance Simulation by one animation frame” button, shown below:

Step button

Now you can see your source code, and navigate through it via the same button above. If you cannot see the code, and your compiler is not in the list I mentioned, then unfortunately it is not supported. If you cannot see any code window, then activate it by “Debug >> PIC CPU >> Source Code”. You can also see your variables with “Debug >> PIC CPU >> Variables”.

How to Install an Arduino Library in Proteus

Proteus doesn’t come with an inbuilt Arduino library, so you have to install it externally. Follow the steps below to install it on your PC.

1. Download all library-related files from GitHub.

Simulate_Arduino_Project_AK_MP_image23.png

Download the Zip file.

2. Extract the zip file and navigate to Proteus-master\Arduino\Library.

Simulate_Arduino_Project_AK_MP_image3.jpg

3. Copy both of the files and paste them in one of the following paths:

C:\Program Files\Labcenter Electronics\Proteus 8 Professional\LIBRARY

or

C:\Program Files\Labcenter Electronics\Proteus 8 Professional\Data\LIBRARY

Simulate_Arduino_Project_AK_MP_image21.jpg

Now, open Proteus and check whether the Arduino board libraries are installed properly or not.

4. In Proteus, create a new project.

Simulate_Arduino_Project_AK_MP_image20.jpg

Create a new project in Proteus.

5. Decide where you would like to save your project.

Simulate_Arduino_Project_AK_MP_image15.jpg

Choose where to save your project.

Click Next once you are done and select the appropriate page layout according to your needs.

6. After finishing the settings, you will land on the empty workspace. Here, you can place components from the library.

Simulate_Arduino_Project_AK_MP_image10.jpg

Arduino IDE Setup

Arduino IDE Setup

Before start simulation need to make sure that in File>>Preferences, compilation is marked. Because “compilation” compile the code and generate .hex file.This .hex file is needed for running the Proteus simulation.

Getting Started in the Proteus Workspace

Select the op-amp symbol, which changes the mode to component mode. Then click P, which will cause a list of components to pop up. Here, you can find all types of components and footprints for simulation.

Simulate_Arduino_Project_AK_MP_image2.png

Set your mode to component mode.

Search for Arduino in the component list. All Arduino related boards and connector libraries will display. If none of the files display on your machine, you can repeat re-installing the Arduino library.

Simulate_Arduino_Project_AK_MP_image8.jpg

Select Arduino UNO, as you will be programming on this board in this example.

After selecting the library and clicking OK, click the spot on the workspace where you would like to drop the board.

Simulate_Arduino_Project_AK_MP_image17.jpg

Proteus Setup

Proteus Setup
Proteus Setup

Proteus is the software where we run our simulation.First make sure that you have Proteus installed in your operating system.If not, then download and install Proteus.After run the Proteus software, If you don’t find arduino in the library.Then, there is a .rar file download it and copy/cut the file.After that paste it into the Proteus library.I am using windows 7 operating system.In my case the location of the Proteus library is, C drive>Program Files>Labcenter Electronics>Proteus 7 Professional>LIBRARY.After that you will find arduino in your library.

How to Simulate Projects

I’m going to show you how to simulate your Arduino projects with an example using a seven-segment up-counter and Arduino. The code and hardware will be presented in the next section, so for time being, just focus on simulation.

First, mimic the wiring connections shown below in Proteus.

Simulate_Arduino_Project_AK_MP_image13.png

You can find all components from the list to complete hardware wiring. To connect any two components through a wire, left-click on one of the connector ends and drag the mouse towards another end to connect it.

Simulate_Arduino_Project_AK_MP_image4.png

Create connections by left clicking and dragging the connector path between components

Power pins, such as Vcc and Gnd, can be found in Terminal Mode

Simulate_Arduino_Project_AK_MP_image26.png

Locate power pins

Once you are done making the connections, upload the hex file of the code to your Arduino. To do this, open the code you downloaded from GitHub in Arduino IDE.

Check whether the compilation option is checked to generate the hex file. It can be found from File —> Preferences.

Simulate_Arduino_Project_AK_MP_image1.jpg

Compile the code and copy the hex file-path.

Simulate_Arduino_Project_AK_MP_image22.png

Double click on the Arduino board to insert the hex file of code.

Simulate_Arduino_Project_AK_MP_image16.png

Paste hex file.

After inserting a hex file, you can start the simulation by pressing the play key.

Simulate_Arduino_Project_AK_MP_image11.gif

Proteus Simulation

(Step-2)Proteus Simulation
(Step-2)Proteus Simulation

2 More Images

Run the Proteus and draw the circuit like the picture.You can directly connect Led with pin 13.But it is a good practice to add a 220 ohm resistor with led in series.Resistor limits the current flow.Double click on arduino and paste the .hex file in “Program File:”.Run the simulation by clicking “Run the simulation” button. LED is Blinking if everything is okay. Congratulation!!!!

Interfacing a Seven-segment Display to Perform Up-counting

As the name suggests, a seven-segment display is a combination of 7 LEDs which are used to display alphabets and numbers. It also has a small dot LED known as dp.

Simulate_Arduino_Project_AK_MP_image25.png

Seven-segment display pinout.

All LEDs in a seven-segment display are named alphabetically, making it very easy for a programmer to display a number or alphabet.

Here, connect all LEDs to the digital pins of the Arduino. A HIGH state from the digitalWrite function will turn ON an LED and vice versa. Below is a chart to display numbers using a common cathode seven-segment LED.

What is an L293D IC Why is it Used?

Arduino is not sufficient to drive the DC motor directly as the motor consumes more current. Arduino can source 40mA (max) from its GPIOs and a DC motor requires up to 200 – 300 mA. So, current amplification between the Arduino and the DC motor is required. That is where the L293D IC H-bridge driver comes in.

The main advantage of using an H-bridge is you only have to change the current direction to move the motor forward or backward rather than changing voltage polarity.

Two H-bridge diagrams are shown below, each with different current directions. In image A, turning the first and second transistor on causes the motor to turn clockwise. In image B, turning the third and fourth transistor on will cause it to turn counter-clockwise.

Simulate_Arduino_Project_AK_MP_image14.png

Here is the pinout of the IC

Simulate_Arduino_Project_AK_MP_image6.png

It requires two Vcc’s: 5V (Vcc1) for its internal driver operation and 12V (Vcc2) for the motor. The L293D can drive two motors at a time and for each motor, it has two input pins (A) and two output pins (Y).

At one input pin, we have to pass a HIGH digital signal and at other a LOW signal. These signals will then be amplified and given to the motor. Basically what we have done is, we have just applied a positive signal on one pin of the motor and LOW signal to another pin of the motor. This will tend to move the motor continuously in a particular direction at maximum speed. But for assigning speed, we will source PWM pulses from Arduino to enable the L293D’s pin.

Conclusion

For those who wish to learn how to create their own games, Proteus breaks down the steps into a manageable and organized book. It is an essential if you do not have any experience coding or want a jumpstart on learning how to write your first game. With the comments in the text and screenshots in each code that is created, the reader is able to get an idea of what each line does before going into the implementation step by step. The product is aimed at those who are interested in creating their own games but are not too sure where to start as there is no prior experience required at all.

0 Comments

No Comment.