Tag Cloud

usb to serial dongle program for moving message display 8051 endurance ultrasonic projects receiving string into 8051 by serial communication bascom telephone interface tariff indicator microstrip antenna calculator using 8051   indirect addressing   power supply   feedback control loop circuitry   pic basic projects   high and low voltage cutout with delay and melody   ir transmitter   5v   regulated power supply   program memory   mobile applications    

Flashing an LED


This section describes how to interface an LED to the microcontroller AT89C51/52 to flash.

The circuit explains how to connect an LED to the Microcontroller, the program to flash an LED connected to port 1.4 using the CPL instruction

; First Program, Flash an LED at P1.4
; EXCEL Technologies
;
; Hardware Notes:
; AT89C51 Running at 12 MHz
; P1.4 is the LED (to light, it is pulled down)

        ORG 00H        ; Execution Starts Here
FLASH:    CPL P1.4        ; Turn on/off the LED
        ACALL DELAY    ; call one second delay
        AJMP FLASH    ; repeat forever

DELAY:    MOV R1,#0FFH
REPEAT:    MOV R2,#0FFH
        DJNZ R2,$
        DJNZ R1,REPEAT
        RET
        END