- To make any Port I/O you need to remember one keyword which is TRISX (X is Port Name you are using). Now if you write TRISB=1 this will make Port B as Input and writing TRISB=0 make Port B as Output.
- Lets see a program in which Microcontroller gets Input from Port B and display Output at Port A. The program begin by writing #include
where p18f4550.h is the header file you need to attach with your Project. Click here to see how to attach files in MPLAB IDE.
#include
Header File attached to Project
void main()
{
TRISB=1; Make Port B as Input
TRISA=0; Make Port A as Outputwhile(1) Super loop
{
PORTA=PORTB; Copy Data at Port B to Port A}
} - while(1) { …….} is called the Super loop and is used when you are using file for hardware.
- This program will continuously copy data from Port B to Port A. If you need to See the Program working in your computer you can download PIC Simulator IDE and watch your program working.
- Keep trying these type of Programs. Enjoy…
Problems with Microcontroller Projects? You may face many Problems, but do not worry we are ready to solve your Problems. All you need to do is just leave your Comments. We will assure you that you will find a solution to your project along with future tips. On Request we will Mail you the Codes for Registered Members of this site only, at free service...Follow Me.
PIC(18F) Microcontroller Programming in C (I/O Interfacing)
This is PIC Microcontroller 1st tutorial and in this tutorial we are going to learn, how to interface I/O Ports with PIC Microcontroller. PIC(18F4550) Microcontroller has 5 I/O Ports(A,B,C,D,E) those can work both as Input and Output. To program PIC Microcontroller in C you need MPLAB IDE which can easily be downloaded from Microchip’s site.
Subscribe to:
Post Comments (Atom)
Recent Comments
Popular Projects
-
Construction of microcontroller based Touchscreen Mobile Phone with Password protected features. Touch Screen GLCD based Digital Devices C...
-
The first project I am posting in this blog is a microcontroller project that communicates with a Siemens M55 mobile phone through the seria...
-
In this project we have used two types of different R.F Module like 433Mhz and 315Mhz interface into Pic16f877a,HT640 for R.F Encoder,HT64...
-
Click below links to get the project: Design with microcontrollers:Final year ECE projects ATmega644 JTAG Debugger Ultrasonic Hapti...
-
Introduction A digital thermometer is a good choice of project for beginners who just stepped in to the world of microcontrollers because it...
-
Automation today has increased the speed of living. This project in which radio frequency is used to automatically control the door locks a...
-
After finishing the serial LCD project , it is time to do some cool projects using PIC12F683. Now we can have a nice LCD display with PIC1...
-
Introduction Tachometer is a device that gives you the information about the rotational speed of any shaft or disc. It usually measures the...
-
The project is a GSM SMS Controller without using any GSM modem. This is using the BTSerial1 module which wirelessly connects to a Bluetoot...
-
Introduction Heart rate measurement indicates the soundness of the human cardiovascular system. This project demonstrates a technique to mea...
No comments:
Post a Comment