Home
Microcontrollers
Abbreviations
Useful Tools
Hot Links
Gallery
Feedback

Abbreviations

A B C D
E F G H
I J K L
M N O P
Q R S T
U V W X
  Y Z  

Microcontrollers
Interfacing LED's
Interfacing 7 segment
Multiplexing 7 segments
PWM Basics
Interfacing Relays
Interfacing 4x4 keypad
8051 Serial port

    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.

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.

BACK

   

Custom Search

  

 

Home | Microcontrollers | Abbreviations | Useful Tools | Hot Links | Gallery | Feedback

Microcontrollers | Interfacing LED's | Interfacing 7 segment | Multiplexing 7 segments | PWM Basics | Interfacing Relays | Interfacing 4x4 keypad | 8051 Serial port

A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z

Email: feedback@shree-electronics.com, Feel free to link to this site.

Disclaimer : I have taken utmost care while composing this site. But neither the author himself nor any of the linked sites can be held responsible for any missing or inaccurate information.

© copyright Srikanth 2008.