Run your first program on simulator

 

You can start to test the flasher program on the
simulator.

The simulator is a program that simulates
Microcontroller code execution and other electronic
component behavior
.

One good simulator I ‘ve tried and I recommend is Labcenter Proteus 7.

You can install it and try the hardware components and software program and debug them for run-time errors and functioning errors. All this before building the real-world application on the board. This approach is very useful and can reduce developing time and frustration and eliminate situations such as you connect the circuit and get no action at all. You then wonder
what ‘s wrong. And you can get lost debugging hardware and software and don ‘t know where to
start from.

This introduction is to show the advantages of using the simulator before building your circuit board.

Let ‘s get started ……….

1- Install the simulator ( Labcenter Proteus 7 ).

2- Run the program ISIS.

3- Draw the components of the flasher application as in this screen-shot.


4- After you copy the code from the previous post into a file named Flasher.ASM, add the source

file as follows ;

– From the source menu , select Define Code Generation Tools …

– Choose the MPASMWIN from the scroll menu as the screen-shot,

– Add the source form the source menu — > Add/Remove Source files …

and choose the code generation tools MPASMWIN and the source file Flasher.ASM


Now you have successfully configured the source file and code generation tools for code

compilation.

5- You can now compile the program by choosing the Source menu —> Build All .

If every thing goes right, you should get the screen


6- You will notice that a Flaher.HEX file has been generated in the working folder.

7- Now double-click on the PIC16F84A component in your design , you get the window,

Choose the Flasher.HEX and set the Processor Clock Frequency to 4MHz.

8- Now press the play button to start debugging and running the program.


Now , you see the led flashing . Congratulations !!! The program is running.

We can start to build our first real-wold circuit….

2 Comments

  1. Hello World

    I was wondering where could I find a PIC microcontroller in Egypt ( RadioShack or El-Nekhely), because I am starting in the field of robotics and I want to try with a microcontroller before I start designing my own.
    Thank You

     
  2. السلام عليكم و رحمة الله و بركاته
    يمكنك شراء
    PIC Microcontroller
    من النخيلى و الجمال أرخص من
    RadioShack and Ram
    وبصفة عامة محلات باب اللوق بالتحرير
    كما يمكنك تجربة الدائرة على
    Proteus
    قبل بنائها فعلياً

    You can buy PIC Microcontroller from Gammal and El-Nekhely and Ram.
    You can try your circuit on Proteus 7 simulator before building the real circuit board.

     

Leave a Reply

Your email address will not be published.


*