First program on mplab _ led program
LED blinking is a basic thing that a fresher must do in electronics..
Moving on to MPLAB IDE .. requirements for this led blinking project
1. MPLAB IDE
2. Proteus ISIS
Now I am not going to show how select a new project in MPLAB, since i already have explained it in the previous blog
for reference
http://gettingstartedwithmplab.blogspot.in/
Now here I am using PIC 16F873
I am connecting a led in the RB0 pin .
positive end of the led is connected to the supply voltage +5v through a 330 ohm resistor.
program is as follows
#include<pic.h>
volid main()
{
TRISB=0X00;
PORTB=0XFF;
}
This small program will turn on led connected to any pin the the PORT B..
TRISB is a command that we used to initialize the port B as output..
PORTB is used to give value to the pins of the port B. 0XFF
will declare value '1' to all the pins in the port that is logically high and that makes the led glow ..
if you have a doubt with setting TRISB and PORTB commands go to the following link ..
here is the screenshot of Proteus ISIS simulation
hope you guys understood everything.. Thankyou . :)
LED blinking is a basic thing that a fresher must do in electronics..
Moving on to MPLAB IDE .. requirements for this led blinking project
1. MPLAB IDE
2. Proteus ISIS
Now I am not going to show how select a new project in MPLAB, since i already have explained it in the previous blog
for reference
http://gettingstartedwithmplab.blogspot.in/
Now here I am using PIC 16F873
I am connecting a led in the RB0 pin .
positive end of the led is connected to the supply voltage +5v through a 330 ohm resistor.
program is as follows
#include<pic.h>
volid main()
{
TRISB=0X00;
PORTB=0XFF;
}
This small program will turn on led connected to any pin the the PORT B..
TRISB is a command that we used to initialize the port B as output..
PORTB is used to give value to the pins of the port B. 0XFF
will declare value '1' to all the pins in the port that is logically high and that makes the led glow ..
if you have a doubt with setting TRISB and PORTB commands go to the following link ..
here is the screenshot of Proteus ISIS simulation
hope you guys understood everything.. Thankyou . :)