Top Banner
INDEX SR NO TITLE SIGN 1 Interfacing of LED, RELAY, Pushbutton 2 Sending and receive data serially to and from PC 3 Using a Watchdog Timer 4 Design a 8 bit Binary counter 5 DC Motor Control using PWM module 6 Interfacing of Temp Sensor 7 Interfacing seven segment Display 8 Scrolling text message on LED dot Matrix
28
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript

INDEX

SR NOTITLESIGN

1Interfacing of LED, RELAY, Pushbutton

2Sending and receive data serially to and from PC

3Using a Watchdog Timer

4Design a 8 bit Binary counter

5DC Motor Control using PWM module

6 Interfacing of Temp Sensor

7Interfacing seven segment Display

8Scrolling text message on LED dot Matrix

Practical no: 1 Interfacing of LED, RELAY, PushbuttonAimWrite a Program to blink an LED using 8051

Theory We now want to flash a LED. It works by turning ON a LED & then turning it OFF & then looping back to START. Figure shows how to interface the LED to microcontroller. The Anode is connected through a resistorto Vcc & the Cathode is connected to the Microcontroller pin. So when the Port Pin isHIGH the LED is OFF& when the Port Pin isLOW the LED is turned ON.

LED Interfacing Program#include MSDelayNew(unsigned int v);void main() // Start of main() function{while(1)// Infinite loop. The program will run forever{

P1 = 0x00;MSDelayNew(50);P1 = 0X01;MSDelayNew(50);}}

MSDelayNew(unsigned int v){unsigned int x, y;

for (x=0;x