interfacing programs required urgent

Thread Starter

nhmdp

Joined Apr 28, 2013
5
Hello

I want programs to interface any sensors with 8086 microprocessor using 8255. Programs other than for sensors are also okay (but would be good if i got for sensors) except for adc, dac, keyboard, stepper motor and led.

I need the program urgent. I searched as much as i could but did not find any programs for interfacing.

Thanks in advance.:)
 

kubeek

Joined Sep 20, 2005
5,795
And anyway, why would you want to use such ancient technology as 8086 + 8255, when almost any new microcontroller can outpreform it without any peripheral circuits added?
 

Thread Starter

nhmdp

Joined Apr 28, 2013
5
i have this program for now which is for temperature sensor ad590. but i have temperature sensor for pt100. so i'm not sure if this program is gonna work

In this part below i understand that the port a,b,c of 8255 are connected to the given address but what does the next 3 statements mean?

Rich (BB code):
PORTA EQU FFC0H ; PORTA address
PORTB EQU FFC2H ; PORTB address
PORTC EQU FFC4H ; PORTC address
CTL EQU FFC6H ; Control port address
CTL_BYTE EQU 98H ; 8255 control reg.
CLEAR_DISPLAY EQU F800:4BB1H
DWAD EQU F800:4BB1H
DBDTA EQU F800:4F1F
and further down there is this statement
CALL FAR DWAD
does it mean that DWAD is a subroutine?


Rich (BB code):
MODEL SMALL
.STACK 100
.DATA
START:
PORTA EQU FFC0H ; PORTA address
PORTB EQU FFC2H ; PORTB address
PORTC EQU FFC4H ; PORTC address
CTL EQU FFC6H ; Control port address
CTL_BYTE EQU 98H ; 8255 control reg.
CLEAR_DISPLAY EQU F800:4BB1H
DWAD EQU F800:4BB1H
DBDTA EQU F800:4F1F
DEC_TEMP DB 0
SET_TEMP DB 0
ADC_VAL DB 0
COUNT DB 0
PRE_TEMP DB 0
.CODE
ADC TABLE:

DB 00H,03H,05H,08H,0aH,0dH,0fH,11H,14H,16H


DB 19H,1cH,1eH,21H,24H,27H,2aH,2cH,2eH,32H

DB 34H,36H,39H,3cH,3fH,42H,45H,48H,4aH,4cH

DB 4eH,50H,52H,54H,56H,58H,5bH,61H,64H,67H

DB 6aH,6dH,70H,72H,74H,77H,7aH,7dH,7fH,82H 

DB a0H,a2H,a5H,a8H,aaH,aDH,afH,b0H,b3H,b6H

DB b9H,bcH,bfH,c1H,c4H,c6H,c9H,ccH,cfH,d0H

DB d2H,d5H,d7H,daH,dcH,dfH,e0H,e2H,e5H,e7H

DB e9H,ebH,eeH,f1H,f4H,f6H,f9H,fcH,ffH

START:
                     MOV AL,CTL_BYTE ; 8255
                     MOV DX,CTL ; PORTC (lower) as output
                     OUT DX,AL ; PORTA as input 
                      MOV AL,DEC_TEMP
	CALL DEC_HEX
	MOV SET_TEMP,AL
	MOV AL,DEC_TEMP
	MOV AH,00
	MOV SI,	AX
	CALL FAR DWAD
	MOV DX,CTL
	MOV AL,02
	OUT DX,AL
	MOV AL,00
	OUT DX,AL
	MOV CX,70
L0:
	LOOP L0
BACK:
	MOV COUNT,0
	CALL ADC
	CALL DISP_TEMP
	CALL TEMP_CONTL
	JMP BACK
DISP_TEMP:
	MOV AL,ADC_VAL
	MOV SI,OFFSET ADC_TABLE
AGAIN:
	CMP AL,[SI]
	JC FOUND
	JE FOUND
	INC SI
	INC COUNT
	JMP AGAIN
FOUND:
	MOV AL,COUNT
	CALL HEX_DEC
	MOV AH,0
	MOV SI,AX
	CALL FAR DBDTA
	RET
TEMP_CONTL:
	MOV AL,COUNT
	CMP AL,SET_TEMP
	JC TURN_ON_RELAY
RELAY_OFF:
	MOV DX,PORTB
	MOV AL,0FFH
	OUT DX,A	L
	MOV DL,20H
HERE1:
	MOV CX,FFFFH
HERE:
	LOOP HERE
	DEC DL	
	JNZ HERE1
RET
TURN_ON_RELAY:
	MOV DX,PORTB
	MOV AL,00H
	OUT DX,AL
CONTINUE:
	MOV CX,FFFFH
L22:
	LOOP L22
	RET
ADC:
	MOV DX,CTL
	MOV AL,01
	OUT DX,AL
	MOV CX,70
L10:
	LOOP L10
	MOV AL,00
	OUT DX,AL
L1:
	MOV DX,PORTC
	IN AL,DX
	AND AL,80H
	CMP AL,80H
	JNZ L1
	MOV DX,PORTA
	IN AL,DX
	MOV ADC_VAL,AL
	RET
HEX_DEC:
	MOV AH,00H
	MOV CL,0AH
	DIV CL
	MOV CL,04H
	ROL AL,CL
	AND AL,F0H
	OR AL,AH
	RET
DEC_HEX:
	MOV BL,AL
	AND BL,0FH
	AND AL,F0H
	MOV CL,04
	ROR AL,CL
	MOV CL,0AH
	MUL CL
	ADD AL,BL
	RET
END START
 
Last edited:

tubeguy

Joined Nov 3, 2012
1,157
i have this program for now which is for temperature sensor ad590. but i have temperature sensor for pt100. so i'm not sure if this program is gonna work

In this part below i understand that the port a,b,c of 8255 are connected to the given address but what does the next 3 statements mean?

Rich (BB code):
PORTA EQU FFC0H ; PORTA address
PORTB EQU FFC2H ; PORTB address
PORTC EQU FFC4H ; PORTC address
CTL EQU FFC6H ; Control port address
CTL_BYTE EQU 98H ; 8255 control reg.
CLEAR_DISPLAY EQU F800:4BB1H
DWAD EQU F800:4BB1H
DBDTA EQU F800:4F1F
and further down there is this statement
CALL FAR DWAD
does it mean that DWAD is a subroutine?
...
[/code]
As the first 3 statements do, the next three EQU statements, make those labels equal to the given values. That is done for a little easier readability.
I believe the Control port address is for the control port in the 8255 which is used to configure the ports A-C.

The CALL FAR is I believe a long call to a subroutine.
 
Top