interfacing programs required urgent

Discussion in 'The Projects Forum' started by nhmdp, Apr 28, 2013.

  1. nhmdp

    Thread Starter New Member

    Apr 28, 2013
    5
    0
    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.:)
     
  2. kubeek

    AAC Fanatic!

    Sep 20, 2005
    4,670
    804
    have you tried, like, writing it yourself? Maybe start with the datasheet of the 8255 and go from there.
     
  3. #12

    Expert

    Nov 30, 2010
    16,343
    6,827
    What? There's no ap for that?:eek:
     
  4. kubeek

    AAC Fanatic!

    Sep 20, 2005
    4,670
    804
    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?
     
  5. nhmdp

    Thread Starter New Member

    Apr 28, 2013
    5
    0
    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?

    Code ( (Unknown Language)):
    1.  
    2. PORTA EQU FFC0H ; PORTA address
    3. PORTB EQU FFC2H ; PORTB address
    4. PORTC EQU FFC4H ; PORTC address
    5. CTL EQU FFC6H ; Control port address
    6. CTL_BYTE EQU 98H ; 8255 control reg.
    7. CLEAR_DISPLAY EQU F800:4BB1H
    8. DWAD EQU F800:4BB1H
    9. DBDTA EQU F800:4F1F
    10.  
    and further down there is this statement
    CALL FAR DWAD
    does it mean that DWAD is a subroutine?


    Code ( (Unknown Language)):
    1.  
    2. MODEL SMALL
    3. .STACK 100
    4. .DATA
    5. START:
    6. PORTA EQU FFC0H ; PORTA address
    7. PORTB EQU FFC2H ; PORTB address
    8. PORTC EQU FFC4H ; PORTC address
    9. CTL EQU FFC6H ; Control port address
    10. CTL_BYTE EQU 98H ; 8255 control reg.
    11. CLEAR_DISPLAY EQU F800:4BB1H
    12. DWAD EQU F800:4BB1H
    13. DBDTA EQU F800:4F1F
    14. DEC_TEMP DB 0
    15. SET_TEMP DB 0
    16. ADC_VAL DB 0
    17. COUNT DB 0
    18. PRE_TEMP DB 0
    19. .CODE
    20. ADC TABLE:
    21.  
    22. DB 00H,03H,05H,08H,0aH,0dH,0fH,11H,14H,16H
    23.  
    24.  
    25. DB 19H,1cH,1eH,21H,24H,27H,2aH,2cH,2eH,32H
    26.  
    27. DB 34H,36H,39H,3cH,3fH,42H,45H,48H,4aH,4cH
    28.  
    29. DB 4eH,50H,52H,54H,56H,58H,5bH,61H,64H,67H
    30.  
    31. DB 6aH,6dH,70H,72H,74H,77H,7aH,7dH,7fH,82H
    32.  
    33. DB a0H,a2H,a5H,a8H,aaH,aDH,afH,b0H,b3H,b6H
    34.  
    35. DB b9H,bcH,bfH,c1H,c4H,c6H,c9H,ccH,cfH,d0H
    36.  
    37. DB d2H,d5H,d7H,daH,dcH,dfH,e0H,e2H,e5H,e7H
    38.  
    39. DB e9H,ebH,eeH,f1H,f4H,f6H,f9H,fcH,ffH
    40.  
    41. START:
    42.                      MOV AL,CTL_BYTE ; 8255
    43.                      MOV DX,CTL ; PORTC (lower) as output
    44.                      OUT DX,AL ; PORTA as input
    45.                       MOV AL,DEC_TEMP
    46.     CALL DEC_HEX
    47.     MOV SET_TEMP,AL
    48.     MOV AL,DEC_TEMP
    49.     MOV AH,00
    50.     MOV SI, AX
    51.     CALL FAR DWAD
    52.     MOV DX,CTL
    53.     MOV AL,02
    54.     OUT DX,AL
    55.     MOV AL,00
    56.     OUT DX,AL
    57.     MOV CX,70
    58. L0:
    59.     LOOP L0
    60. BACK:
    61.     MOV COUNT,0
    62.     CALL ADC
    63.     CALL DISP_TEMP
    64.     CALL TEMP_CONTL
    65.     JMP BACK
    66. DISP_TEMP:
    67.     MOV AL,ADC_VAL
    68.     MOV SI,OFFSET ADC_TABLE
    69. AGAIN:
    70.     CMP AL,[SI]
    71.     JC FOUND
    72.     JE FOUND
    73.     INC SI
    74.     INC COUNT
    75.     JMP AGAIN
    76. FOUND:
    77.     MOV AL,COUNT
    78.     CALL HEX_DEC
    79.     MOV AH,0
    80.     MOV SI,AX
    81.     CALL FAR DBDTA
    82.     RET
    83. TEMP_CONTL:
    84.     MOV AL,COUNT
    85.     CMP AL,SET_TEMP
    86.     JC TURN_ON_RELAY
    87. RELAY_OFF:
    88.     MOV DX,PORTB
    89.     MOV AL,0FFH
    90.     OUT DX,A    L
    91.     MOV DL,20H
    92. HERE1:
    93.     MOV CX,FFFFH
    94. HERE:
    95.     LOOP HERE
    96.     DEC DL 
    97.     JNZ HERE1
    98. RET
    99. TURN_ON_RELAY:
    100.     MOV DX,PORTB
    101.     MOV AL,00H
    102.     OUT DX,AL
    103. CONTINUE:
    104.     MOV CX,FFFFH
    105. L22:
    106.     LOOP L22
    107.     RET
    108. ADC:
    109.     MOV DX,CTL
    110.     MOV AL,01
    111.     OUT DX,AL
    112.     MOV CX,70
    113. L10:
    114.     LOOP L10
    115.     MOV AL,00
    116.     OUT DX,AL
    117. L1:
    118.     MOV DX,PORTC
    119.     IN AL,DX
    120.     AND AL,80H
    121.     CMP AL,80H
    122.     JNZ L1
    123.     MOV DX,PORTA
    124.     IN AL,DX
    125.     MOV ADC_VAL,AL
    126.     RET
    127. HEX_DEC:
    128.     MOV AH,00H
    129.     MOV CL,0AH
    130.     DIV CL
    131.     MOV CL,04H
    132.     ROL AL,CL
    133.     AND AL,F0H
    134.     OR AL,AH
    135.     RET
    136. DEC_HEX:
    137.     MOV BL,AL
    138.     AND BL,0FH
    139.     AND AL,F0H
    140.     MOV CL,04
    141.     ROR AL,CL
    142.     MOV CL,0AH
    143.     MUL CL
    144.     ADD AL,BL
    145.     RET
    146. END START
    147.  
    148.  
    149.  
     
    Last edited: Apr 28, 2013
  6. nhmdp

    Thread Starter New Member

    Apr 28, 2013
    5
    0
    this is for my project!!
     
  7. tubeguy

    Well-Known Member

    Nov 3, 2012
    1,157
    197
    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.
     
Loading...