This is a test post
Creative World
Creative World, a weblog of new, creative and interesting ideas that can make the world better.
Monday, February 20, 2012
Sunday, February 19, 2012
Sunday, February 12, 2012
Sunday, June 29, 2008
Microcontrollers Tutorials
This post helps you how to use microcontrollers
Micro-controllers are used to work in the way the user wants, the user should write a program in c language using Mplab. In this tutorial you will be taught how to glow an led, which is a most fundamental thing to be done with micro-controllers.
Mplab and MCC18 Software:
Download links:
http://ww1.microchip.com/downloads/en/DeviceDoc/MPLAB_IDE_v8_63.zip
http://ww1.microchip.com/downloads/en/DeviceDoc/MPLAB-C18-Lite-v3_34.exe
Download,install Mplab and Mcc18 softwares, during installation of mcc18, click all the check boxes to integrate all the files of mcc18 to mplab.
Mplab Configuration:
1.Open mplab, Click configure->select device->PIC18F4550->ok.
2.Click Project->project wizard->next->next, change Active Toolsuite->Microchip C18 Toolsuite->next.
3.Click Browse,then create a new folder with name mplab,then open the folder and save the project as Tutorials, then click Next->finish.
4.Now open->Notepad , then save as Tutorials.c , in new folder you created in the previous step and close the notepad.
5.Now Right click on Source files->Add files, in the same window browse for the Tutorials.c file , then click open.
6.Now Right click on Header files->Add files, in the same window go to C:\MCC18\h , then select 18f4550.h file and click open it.
7.Now Right click on Linker Script->Add files, in the same window go to C:\MCC18\lkr , then select 18f4550.lkr file and click open.
8.Click Project->Build Options->project, select Directories->Show directories for->Include search path->new....paste C:\MCC18\h
select Library Search path->new... paste C:\MCC18\lib, then select Linker-script search path->new..paste C:\MCC18\lkr.
Programming:
1.Double click on Tutorial.c under source files.
2.Copy and paste the Code.
Code:
#include"p18f4550.h"
void main(){
OSCCONbits.IRCF0=1; //Internal oscillator intialization
OSCCONbits.IRCF1=1;
OSCCONbits.IRCF2=1;
TRISB=0; //Directing the portb as output port
while(1){ //Infinite loop
PORTB=0xFF; //0xFF=11111111 All the 8pins in portb are made 1 or'on'
}
}
3.Then save the file, then click ctrl+F10 to build the file.
4.A message saying "BUILD SUCCEEDED" appear.
All done in the software part
Hardware:
The things needed before proceeding are
1.Microcontoller Pic 1
2.Pic Burner 1
3.Bread Board 1
4.Two batterys(1.5v) 2
5.Leds 1
6.Connecting wires
1.Microcontroller Pic (18f4550-40):
The above mentioned pic is available in many varieties, for a common approach, i selected this series. It has 40 pins.
It is available in selected Electronics shops or you can order samples from microchip.
For ordering samples visit:
http://www.microchip.com/samples/
But you need a register with a valid recognized institutional email id
For ssn college of engineering students use your own college email id to register.
They charge a shipment of fee : 7.50 USD
2.Pic Burner:
I use Pickit 2 burner, which has a usb connector alone which very easy to burn the all most all pic ics.
Micro-controllers are used to work in the way the user wants, the user should write a program in c language using Mplab. In this tutorial you will be taught how to glow an led, which is a most fundamental thing to be done with micro-controllers.
Mplab and MCC18 Software:
Download links:
http://ww1.microchip.com/downloads/en/DeviceDoc/MPLAB_IDE_v8_63.zip
http://ww1.microchip.com/downloads/en/DeviceDoc/MPLAB-C18-Lite-v3_34.exe
Download,install Mplab and Mcc18 softwares, during installation of mcc18, click all the check boxes to integrate all the files of mcc18 to mplab.
Mplab Configuration:
1.Open mplab, Click configure->select device->PIC18F4550->ok.
2.Click Project->project wizard->next->next, change Active Toolsuite->Microchip C18 Toolsuite->next.
3.Click Browse,then create a new folder with name mplab,then open the folder and save the project as Tutorials, then click Next->finish.
4.Now open->Notepad , then save as Tutorials.c , in new folder you created in the previous step and close the notepad.
5.Now Right click on Source files->Add files, in the same window browse for the Tutorials.c file , then click open.
6.Now Right click on Header files->Add files, in the same window go to C:\MCC18\h , then select 18f4550.h file and click open it.
7.Now Right click on Linker Script->Add files, in the same window go to C:\MCC18\lkr , then select 18f4550.lkr file and click open.
8.Click Project->Build Options->project, select Directories->Show directories for->Include search path->new....paste C:\MCC18\h
select Library Search path->new... paste C:\MCC18\lib, then select Linker-script search path->new..paste C:\MCC18\lkr.
Programming:
1.Double click on Tutorial.c under source files.
2.Copy and paste the Code.
Code:
#include"p18f4550.h"
void main(){
OSCCONbits.IRCF0=1; //Internal oscillator intialization
OSCCONbits.IRCF1=1;
OSCCONbits.IRCF2=1;
TRISB=0; //Directing the portb as output port
while(1){ //Infinite loop
PORTB=0xFF; //0xFF=11111111 All the 8pins in portb are made 1 or'on'
}
}
3.Then save the file, then click ctrl+F10 to build the file.
4.A message saying "BUILD SUCCEEDED" appear.
All done in the software part
Hardware:
The things needed before proceeding are
1.Microcontoller Pic 1
2.Pic Burner 1
3.Bread Board 1
4.Two batterys(1.5v) 2
5.Leds 1
6.Connecting wires
1.Microcontroller Pic (18f4550-40):
The above mentioned pic is available in many varieties, for a common approach, i selected this series. It has 40 pins.
It is available in selected Electronics shops or you can order samples from microchip.
For ordering samples visit:
http://www.microchip.com/samples/
But you need a register with a valid recognized institutional email id
For ssn college of engineering students use your own college email id to register.
They charge a shipment of fee : 7.50 USD
2.Pic Burner:
I use Pickit 2 burner, which has a usb connector alone which very easy to burn the all most all pic ics.
Subscribe to:
Posts (Atom)