12/07/2015

Blinking LED using PIC Microcontroller

In this tutorial, we will learn, how to burn program in PIC Microcontroller. and we will also see how to use Proton IDE. If you still did not install Proton IDE and Proteus then click the following link and install it.

How to install Proton IDE and Proteus.

If anyone having any problem at any point, ask me in comment. I will try my best to resolve it. 
First of all, open the Proteus ISIS and Proton IDE software. It will look the same as below image.


At this point, i supposed you have learnt my previous tutorial, getting stard with Proteus ISIS.

>> Open the Proton IDE.
>> write program for blinking LED.
>> Copy the below code and past it in Proton IDE.



- - - - - - - - - - - - - -  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  - - -

 ' LED BLINKING CODE

 Device 18F452  ' Tell the compiler about device

 XTAL 20            ' Crystal Frequency

 ALL_DIGITAL TRUE   ' For digital input

 Input PORTB.0      ' Initialize portb.0 as input

 Output PORTD.0     ' Initialize portd.0 as output

 PORTB.0=0          ' set portb.0 as low

 PORTD.0=0          ' Set portd.0 As Low

 initial:             ' for looping

 If PORTB.0==1 Then    'condition

 High PORTD.0

 Else

 Low PORTD.0

 EndIf                  ' for ending if

 GoTo initial           ' For continue loop

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - - 



After pasting, compile the program by clicking at the compile, showing below.



Now, it will ask the address, where do you want to save the program. After saving, it will automatically create all related files, including HEX file.



 >> Now, put hex file in the Proteus ISIS.
>> Design exactly the same circuit as shown below.



>> Now, double click at the PIC 18F452.
>> Put HEX file as shown below.



 >> After adding the hex file, now click at the play button.




Now, simulation will run. You will get result as shown below.



That is all for today. In the next tutorial, we will learn about different component, which are commenly used like LCD interfarence, serial communication, motor, CCP etc. So stay tuned and subscribe via email and also like us on facebook. If someone having problemn ask me in comment. I will try my best to explain it. 



                            Previous <<             >>Next

 

1 comment:

Interfacing LCD With Arduino Microcontroller

In this tutorial we are going to  interface a  Liquid Crystal Display (LCD)  with Arduino Microcontroller .  Liquid Crystal Display are us...