Saturday, June 6, 2009

PIC Programming With the Basics - Article 2

This is the second article of this tutorial series. Up to now, we have already finished basic arrangements of the project, as well as the coding. (We will be dealing about the coding in a separate article more deeply. Until we will use the previous coding part) now we have to do the compiling pert and the simulating part.

Step 1: After you have finished the coding part, we have to compile and see whether there are errors or not. For that you have to press the build project button (ctrl+F9).

The button is displayed in the picture. It will be compiled automatically when you press the button.

Build the Project

Then you have to wait until you get the result.

Step2: If the project compiled successfully, it will be displayed as in the above picture. If it wasn't there should be a problem some where of your project. Most probably in the coding. As you may have forgotten to put a semicolon or may be a wrong code. (We will discuss about these things later.)

If so you have to correct those errors until you are getting the successfully compiled programme. If so, now we have finished our first project. All we have to do is, run the project & get the out put.

Step3: We are going to use the Proteus 7 Software for this task. Just open the software. You will be given an interface as below.

Now you need to pick the devices to run the pragramme. Just click the pick button there and get the needed devices.

Step4: Pick a pic16f84, LogicProbe (Active) to see the out put. You can just type the devices you need to get, and then they will be appearing. Then just double click on top of them to get them in to your devices list. Finally just click "ok".

Step5: Now you have to arrange the devices as a circuit. Just click on the top of the name of the device (Example: pic16f84), and then place it on the right hand side area. Finally it should look like this.

Step6: Finally you need to load the ".hex" file in to your pic-microcontroller. For that, just double click on the top of the pic. Then a dialog box will be appearing.

Loading the ".hex" file

Set the clock frequency as 4MHz.As we made it to 4, when we were starting our programme.

Ok, that's all. Just click the OK button. Then our target is achieved. Just click the Play button at the bottom of the page. Then you can see the whole PortB of the pic is blinking. Although we have used only one logic state, whole the port should blink.

Anyway that's the end of the first task. Follow the other articles, if you wish to follow the other techniques too.

Thanks. Your Comments are highly appreciated. So please don't hesitate to post your comments.

Visit http://www.picbestsite.com for more details.Learn PIC programming from the basics.Figures were used frequently to demonstrate the facts easily.Download the needed software, materials freely. visit http://www.picbestsite.com

No comments:

Post a Comment