Google

Oct 27, 2008

Program to interface DAC using 8255 and generate triangular waveform

Program to interface DAC using 8255 and generate triangular waveform

The following is the assembly language using DAC to interface with 8255 and generate a square wave on CRO. Here in the code, we use two loops one for the rising part of the wave and the other element to reach zero i.e decrement. The two jump instructions used in the program are iterated to repeat cycles of a triangular wave.

Code:

MOV DX,8807 : DX is loaded with control word register address of 8255
MOV AL,80
OUT DX,AL : Contents of AL are transferred to portA of 8255
MOV DX,8801 : DX is loaded with Port A address of 8255
MOV AL,00
UP1 OUT DX,AL ; Contents of AL are transferred to portA of 8255
INC AL
CMP AL,FF
JNZ UP1
OUT DX,AL : Contents of AL are transferred to portA of 8255
DEC AL
JNZ UP2
JMP UP1; Repeat the same

The expected square wave can be observed in a CRO. Thus we programed in assembly language to interface DAC using 8255 to generate a triangular waveform.

Related links
Ebooks for micro processors and micro controllers

Oct 24, 2008

Program to interface DAC using 8255 and generate ramp waveform

Program to interface DAC using 8255 and generate ramp waveform

The following is the assembly language using DAC to interface with 8255 and generate a ramp on CRO. Here in the code, we use two jump instructions JMP and JZ in order to form the ramp wave. The jump instructions used in the program are iterated to repeat cycles of a ramp wave.

Code:

MOV DX,8807 : DX is loaded with control word register address of 8255
MOV AL,80
OUT DX,AL : Contents of AL are transferred to portA of 8255
MOV DX,8801 : DX is loaded with Port A address of 8255
Ramp MOV AL,00
Begin OUT DX,AL ; Contents of AL are transferred to portA of 8255
INC AL
CMP AL,FF
JZ Ramp
JMP Begin ; Repeat the same

Thus we programed in assembly language to interface DAC using 8255 to generate a ramp wave.

Related links
Ebooks for micro processors and micro controllers

Oct 21, 2008

Program to interface DAC using 8255 and generate square waveform


Program to interface DAC using 8255 and generate square waveform

The following is the assembly language using DAC to interface with 8255 and generate a square wave on CRO. Here in the code, we use two delay elements one for the rising part of the wave and the other delay element to reach zero i.e decrement. Certain value chosen is delayed or sustained for a time period to form the square wave. The two loops used in the program are iterated to repeat cycles of a square wave.



Code:

MOV DX,8807 : DX is loaded with control word register address of 8255
MOV AL,80
OUT DX,AL : Contents of AL are transferred to portA of 8255
MOV DX,8801 : DX is loaded with Port A address of 8255
Begin MOV AL,00
OUT DX,AL ; Contents of AL are transferred to portA of 8255
MOV CX,00FF
Delay1 Loop Delay1
MOV AL,FF
OUT DX,AL : Contents of AL are transferred to portA of 8255
MOV CX,00FF : CX is loaded with 00FFH
Delay2 Loop Delay2 : Repeat until CX=0
JMP Begin ; Repeat the same

The expected square wave can be observed as in the figure shown. Thus we programed in assembly language to interface DAC using 8255 to generate a square waveform.

Related links
Ebooks for micro processors and micro controllers

Assembly language program to find square root of 8-bit number

Following is the assembly language program to find square root of 8-bit number.
In this program we initially load the index registers with specified values. We load the value of the number into SI Register. Then using a few logical steps as mentioned in the code i.e JMP insctructions we find the square root of a 8-bit number.

Code:
MOV SI,2000
MOV DI,4000
MOV CX,0001
MOV BX,0000
MOV AL,[SI] ; Load AL with the value given as at SI
UP SUB AL,CL
JL down ; jump to down label
INC BL
ADD CL,02 ; add 2 to contents of CL register
JMP UP ; jump to up label
DOWN MOV[DI],BL
INT A5

Thus by implementing the above code we can find the square root of 8-bit number

Related posts
square root of hexa decimal number
Ebooks

You might be also interested in:

:: Find Square Root of a hexadecimal number in assembly language
:: common intreview questions on 8086
:: Assembly Language Source Codes

Oct 18, 2008

Program to perfrom sum of elements in an array

Program to perform sum of elements in an array
Following is the assembly language program to find the sum of elements in a given array. This code is for 16-bit addition with 64 stack size.

Code:

MOV AX,@DATA ; Load AX with data
MOV DS,AX ; Load DX with AX
MOV ALPBCD ; Load AL with N1
MOV BL,AL ; load BL with AL
AND AL, OFH ; AND AL with OF H
MOV UBCD2,AL; Load N3 with AL
AND BL, OFOH
MOV CX,0004 ; Load CX with 0004
ROR BL,CL Rotate right BL,CL times
MOVE N2,BL
INT 3


Related links

all experts
bytes
wiki

Oct 15, 2008

Program to interface stepper motor with 8086 and rotate with anti clock wise direction in full stepping

The following program is to interface stepper motor with 8086 and rotate with anti clock wise direction in full stepping. The purpose of this is to observe and control the stepping action of the motor using assembly language code. The code is also practically illustrated with two live demonstrations on how speed of the motor varies if one of the instruction codes is changed to a new value.

Code:

MOV DX,8807 : Load DX with control word register address of 8255
MOV AL,80 : load control word 80 into AL
OUT DX,AL: Contents of AL are loaded into control word register of 8255
MOV DX,8801: Load PortA address of 8255 into DX
MOV AL,33: Load value 33 into AL
Again OUT DX,AL: Contents of AL are loaded into control word register of 8255
MOV CX,0100: set counter to delay
Loop Again
ROL AL,1 : Rotate left by 1
JMP Again : Unconditional jump to label again

Following is the practical illsutration of the output for the above given code.



The instruction MOV CX,0100 can be changed to a new value in order to vary the speed.
So, for instance lets say MOV CX,7000. Following is the video demonstration of how the speed varies if the value is changed in the above instruction


Thus by changing the instruction the speed of the stepper motor can be varied according with interfacing it to an 8086 microprocessor for full stepping

Related posts:
Interfacing a stepper motor with an AVR Microprocessor

Interfacing a stepper motor with pic micro controller

Interfacing a stepper motor to 8086 using 8255