Showing posts with label simple. Show all posts
Showing posts with label simple. Show all posts

8085 Simple programming Examples



The programmes are based on the Data transfer group for other group search in our search box
Let’s do a program
MVI   A,20h
STA   5050h
HLT
Here, ‘MVI A, 20h’ stores the 20h in accumulator, and STA stores the content of accumulator to to 5050.

OUTPUT
A:20
           [5050]:20
                  
1)      Store accumulator content indirect
·         STAX Rp;
·         1 byte instruction

To understand this instruction let’s take an example
LXI            D,4060h;
MVI          A,20h;
STAX        D              ;[4060]ß20h
HLT
Here, LXI loads the immediate data 4060h to register pair D ,MVI moves 20h data to  accumulator and STAX instruction  content of accumulator is stored in address pointed by register D.
So he output is
D:40  E:60
A:20                                  

[4020]: 20
2)      Input from input port
Do yourself
3)      Output to output



Do yourself      

1)      write a program to move data from register B to C,C to D and D to E.

MOV        C,B   ; moves data from register B to C
MOV        D,C    ;moves data from register C to D
MOV        D,E     ; moves data from register ram D to E
HLT                     ;stops the program

Output :
Let register B contains data 20h
B: 20h   C: 20h
D: 20h   E:  20h


2)      Write a program to store 20h in address 4040.
1st  method
LXI      H, 4030h      ; stores 4030h in HL register pair
MVI     B,20h          ; stores 20h to register B
MOV   M,B             ; moves content of register B to memory location 4040
HLT

2Nd method
MVI   A, 20h
STA    4040h
HLT

Output
B: 20         C: J J
H:40            L:30
[4040] : 20
Write a program to store the data 40H and 20H to the address 5051 and 5052 respectively.
Method 1

LXI      H, 5051h     ; Loads 5051 to HL pair
MVI    M, 40h         ; moves the data 40 h to memory location pointed by HL i.e.5051
LXI      H, 5052h     ; Loads address location 5051 to HL pair
MOV   M,20h          ; moves the data 40 h to memory location pointed by HL ie,5051
HLT                         ; stops the program

Method 2

MVI   A, 40H      ; Moves data 40H to the accumulator
STA    5051H      ; Loads the content of accumulator content to address 5051
MVI    A, 20H     ; Moves data 20H Accumulator
STA    5052H      ; Loads the content of accumulator content to address 5052
HLT

Output
[5051] : 40
[5052] : 20

2) Write the program to store the data from the memory location 2051 and 2052 to register B and C respectively.
(Before doing this program in simulator load data in memory location 2051 and 2052 yourself)
Method 1

LDA     2051H      ; load the content of address 2051 to the accumulator
MOV   B,A           ; Moves the data from Acc.  Register to B
LDA    2052H       ; load the content of address 2051 to the accumulator
MOV   C,A           ; Moves the data from Acc. to register C
HLT



Method 2

LXI         H,2051H   ;loads 2051 to HL pair
MOV      B,M          ;moves the content of memory ( i.e. address containing  in HL pair ) to B reg

Simple Triac Dimmer Circuit

Simple Triac Dimmer Circuit

The circuit of a simple triac light dimmer shown below can be used for dimming incandescent lamps directly from AC mains. The circuit is very easy to construct and uses very few components. The pot is used for controlling the load power or the intensity of the light. The circuit can be also used for controlling ceiling fan speeds.

[ REPORT ] WIFI CONTROLLED ROBOT

THE FOLLOWING LINK ENABLES YOU TO TH E DOWNLOAD SECTON OF 

[ REPORT ] WIFI SMART ROBOT

[REPORT ] WIFI ENABLED ROBOT

For other  interesting ARDUINO PROJECTS here

 JUST INTRODUCING

WIFIenabled Robot is a system, which
controls the turtle robot using the web page. To make
this feasible we make use of the HNZG1 board with a
built in Micro controller and ZeroG-2100 Wi-Fi
module. HNZG1 board is developed exclusively by
MANIPAL DOT NET PVT. LTD comprises of ZeroG-
2100 module for wireless connectivity and inbuilt
PIC24F series microcontroller from Microchip
Technology Inc.
Switch control mode of Robot is controlled
using Joystick and can appropriately be guided to back,
forth, left and right directions
So in this project, we extend an interface to
the Switch control mode to suit our requirements.
Finally we have been able to bridge together the
HNZG1 board and the Turtle Robot, and eventually
control the Turtle Robot in wireless environment
through the control buttons embedded on the custom
Web page designed by us.

if u like the post just say thank u in comment box.

assembly code for line following robot, 89C2051,89C2051

The complete assembly code is as below


INCLUDE 89C2051.mc

'Defining constants
Forward EQU 67h
RightBack EQU 51h
LeftBack EQU 4Ah

    ORG 0000h

AJMP Main

    ORG 0030h

Main: 
     MOV P1,#00h                                'Disable Motor Driver
     MOV P3,#0FFh                              'Set P3 as input port to read sensor o/p 
     SETB P1.6                         'Make P1.6 to which switch is connected
                                                                 'an i/p
Start:
     JNB P1.6,Finish                               'Stop if switch at P1.6 is pressed
     MOV P1,#Forward
     CALL Delay                                      'Produce 0.05s delay
     JNB P3.2,R_Back                           'If Right Sensor at P3.2 is activated
                                                                 'bring right wheel back
Next: 
     MOV P1,#Forward
     CALL Delay
     JNB P3.3,L_Back                           'If Left Sensor at P3.3 is activated

                                                                 'bring left wheel back                 
Back:
     AJMP Start                                      'Repeat above operation

Finish:
     MOV P1,#00h                                'Disable Motor Driver

Again:
     SJMP Again                    'Loop forever

R_Back:
     MOV P1,#RightBack
     JNB P3.2,R_Back                           'Repeat if Right Sensor is still activated
     SJMP Next  

L_Back:
     MOV P1,#LeftBack
     JNB P3.3,L_Back                           'Repeat if Left Sensor is still activated
     SJMP Back

Delay:                                                    'Produces approx 0.05s delay
     MOV R0,#255
Time1: 
     MOV R1,#255
Time2:
     DJNZ R1,Time2
     DJNZ R0,Time1
     RET


    END