IndianEngineer

India's No 1. www.IndianEngineer.tk

Microcontroller LEd InterFacing

http://www.shree-electronics.com/images/DSC00288.JPG

The first thing usually done while learning any microcontroller or embedded system is blinking an LED. The circuit below shows the circuit for Interfacing an LED.

http://www.shree-electronics.com/images/led_small.gif

note: Since the circuit diagram dimensions are big, your browser may fit the image to window size, if you are using Internet explorer, then an expander tool will be displayed on the bottom right corner, if you are using firefox , then when you move the mouse pointer over the image a magnifier tool will be displayed.

Here an LED is connected to the first pin of port0 (P0.0). The assembly program given below is simple and self explanatory.

;*************************************************
;
;Program: Blinking LED.
;Author: Srikanth
;Website: http://shree-electronics.com/
;Description: Blinks an LED connected to P0.0
;continuously
;
;*************************************************

led equ P0.0

org 00h
up: setb led ;Turn ON the LED
acall delay ;call delay subroutine
clr led ;Turn OFF the LED
acall delay ;call delay subroutine
sjmp up ;Loop

delay:mov r7,#0ffh ;delay subroutine
loop:mov r6,#0ffh
djnz r6,$
djnz r7,loop
ret

end

The program is purposely made lengthy in order to explain some programming techniques such as subroutine, loop etc.


About these ads

April 11, 2010 - Posted by | Microcontroller Interfacing |

2 Comments »

  1. Am engineer working in electronics industry i want to develop electronic projects this site is very nice it is very useful to the technical peoples to improve their practical knowledge.

    Thanks

    Comment by suresh kumar B | April 20, 2011

  2. plz send me total details regarding this project…

    Comment by teenmar | December 23, 2011


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 632 other followers

%d bloggers like this: