Showing posts with label Programes. Show all posts
Showing posts with label Programes. Show all posts

8051 program to count the number of 1’s & 0’s in a number

By With 6 comments:


Write a program to count the number of 1’s & 0’s in a number


                 ORH 0000H
                 CLR  PSW 3
                CLR   PSW   4
    MOV R0, #00H
    MOV R, #00H
    MOV DTPR, #3000H
    MOV A, @DPTR
L1:           RLC A
                JNZ  L2         
                INC R0
L2:           DJNZ R0, L1
                MOV  A, #08H
                CLR C
                MOV R, A
AGAIN : SJMP AGAIN


RESULT:-
INPUT                                   OUTPUT
11010010-D2H                       4-(1’S)
                                                4-(0’S)

8051 program to rotate DPTR.

By With No comments:


               8051 program to rotate DPTR.
               
              ORG 0000H
              CLR      C
              MOV      A, DPL
              RLC       A
             MOV       DPL, A
             MOV       A, DPH
             RLC       A
             MOV       DPH, A
             CLR       A
             ORL       A, DPL      
             MOV      DPL, A
AGAIN: SJMP AGAIN

RESULT:-
INPUT                                   OUTPUT
Register  value    
DPTR    1234H                     DPTR      2468H

8051 program to add two 8 bit numbers and store the result at external memory location 2050H.

By With 6 comments:


Write a program to add two 8 bit number and store the result at external memory  location 2050H.


                 ORG 0000H
                 MOV A, #05H
                 MOV R, #09H
                ADD A, R1
                MOV DPTR, #2050H
                MOV @ DPTR, A
AGAIN: SJMP AGAIN

INPUT:
A=05H
R1=09H
OUTPUT:
2050 = 0EH..


LED Blinking Using Assembly Language – 8051

By With No comments:

LED Blinking Using Assembly Language – 8051



ORG 00H
CLR P3.0
CLR P2.0
AGAIN : JB P3.0,ON
SETB P2.0
ACALL DELAY
CLR P2.0
ACALL DELAY
SJMP AGAIN
ON : SETB P2.0
SJMP AGAIN
DELAY : MOV R0,#05H
GO : MOV R1,#0FFH
HERE : DJNZ R1,HERE
DJNZ R0,GO
RET
END

keywords:flashing led microcontroller, led blink without microcontroller, led blinking using 8051 microcontroller, blinking led pic microcontroller, led blinking circuit using microcontroller, led blinking using pic microcontroller, led blinking program in microcontroller, led blinking program for pic microcontroller, led blinking circuit using 8051 microcontroller, led blinking program for 8051 microcontroller, led blinking microcontroller, blinking led avr microcontroller, microcontroller based led blinking, led blinking using 8051 microcontroller c program, 8051 microcontroller led blinking in c, led blinking program with 8051 microcontroller and keil uvision 4, 8051 microcontroller led blinking program, blinking led with microcontroller, 8051 microcontroller led blinking, program for led blinking using 8051 microcontroller,


Microcontroller Program to generate a square wave of 10 Hz at pin P1.0 of 8051 using timer

By With 1 comment:

#include <reg51.h> // include 8051 register file
sbit pin = P1^0; // decleare a variable type sbit
for P1.0
main()
{
P1 = 0x00; // clear port
TMOD = 0x09; // initialize timer 0 as 16 bit timer
loop:TL0 = 0xAF; // load valur 15535 = 3CAFh so after
TH0 = 0x3C; // 50000 counts timer 0 will be
overflow
pin = 1; // send high logic to P1.0
TR0 = 1; // start timer
while(TF0 == 0) {} // wait for first overflow for 50 ms
TL0 = 0xAF; // again reload count
TH0 = 0x3C;
pin = 0; // now send 0 to P1.0
while(TF0 == 0) {} // wait for 50 ms again
goto loop; // continue with the loop
}

http://thegkgarden.blogspot.com

keywords:c program to generate a square wave, matlab program to generate a square wave, program to generate square wave in 8051, program to generate square wave using 8051, program to generate square wave in 8085, program to generate square wave in 8086, program to generate square wave using 8255, program to generate square wave using 8085, program to generate square wave in keil, program to generate square wave, assembly language program to generate a square wave, write a program to generate a square wave with 75 duty cycle, write a program to generate a square wave of 50 duty cycle, write a program to generate a square wave, assembly program to generate square wave, write an 8051 assembler program to generate a square wave, write a program to generate square wave in 8051, write a program to generate square wave using 8086, program timer 0 to generate a square wave of 0.5khz, write a program to generate a square wave with 75 duty cycle on bit p1.5, 8051 c program to generate square wave, embedded c program to generate square wave, program to generate square wave using dac, program to generate square wave in c, program to generate square wave in matlab, 8085 program to generate square wave logic, program to generate square wave using matlab,