当前位置:网站首页>Assembly and Interface Technology Experiment 6 - ADDA conversion experiment, AD acquisition system in interrupt mode
Assembly and Interface Technology Experiment 6 - ADDA conversion experiment, AD acquisition system in interrupt mode
2022-07-06 22:11:00 【dor. yang】
One 、 The experiment purpose
The experiment used 8259A,ADC0809, Digital tube to complete the design of a data acquisition system , The purpose is to understand the interrupt mode A/D Implementation method of data collection , Master the hardware design and the writing method of interrupt program , It is the training of students' comprehensive experimental ability .
Two 、 Experimental content
Use ADC0809 The passage of 0, Access 0-5V DC voltage of , use “ DC signal ” The potentiometer adjusts the analog voltage value ,A/D End of conversion signal EOC Connected to the main 8259A Of MIR3 On , collection 100 Data and store it in memory , At the same time, the collected 16 Hexadecimal data is displayed on the nixie tube . Please adjust it many times 0-5V The voltage value of ( Whirl “ DC signal ” knob ), Conduct A/D collection , And observe the changes of data in memory .
3、 ... and 、 Experimental phenomena
Every time I collect 100 Data may be the same ( The data of the nixie tube may also remain unchanged ), When “ DC signal ” Different data can be collected when the knob is rotated .
Four 、 Experimental wiring diagram
5、 ... and 、 The experimental steps
1、 Connect the experimental circuit correctly according to the schematic diagram ( Need to connect the red line ).
The circuit diagram is as follows :
2、 Correctly understand the experimental principle .
take 298H As a result of A/D0809 The port of , take 280H As a result of 8255A The port of .
take A/D0809 At the end of data conversion EOC High level of as 8259A The interrupt source of , Connected to MIRQ3, Of the main film IR3. in addition 8255A Of A Mouth in 0 Output segment code in mode ,B Mouth in 0 Output bit code in mode , Make the nixie tube display .
The flow chart of the main program is as follows :
Flow chart of interrupt service program :
3、 Write the experimental program , And debugging on the computer , Observe the results of the experiment .
The experimental procedure is as follows :
STACKS SEGMENT
STA DW 512 DUP(?)
TOP EQU LENGTH STA
STACKS ENDS
DATA SEGMENT
IO0809A EQU 298H
LED DB 3FH,06H,5BH,4FH,66H,6DH,7DH,07H,7FH,6FH,77H,7CH,39H,5EH,79H,71H
TMP_1 DB ?
TMP_2 DB ?
TMP DB ?
DATA ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATA,SS:STACKS
START:
MOV AX,CS
MOV DS,AX
MOV DX,OFFSET INT3 ; System function call 、 Set interrupt vector 、 from DS:DX Point to four byte address
MOV AX,250BH ; AL= Interrupt type number (=0BH---0B*4= Vector table address )
INT 21H ; ( Realize adding INT3 The address of )
MOV DX,283H ;8255 Command port address , To initialize
MOV AL,10001001B ; Set the way it works ,A Working in 0 Mode input ,B mouth 0 Mode output
OUT DX,AL
MOV AX,STACKS ; Set the stack segment register SS
MOV SS,AX
MOV SP,TOP ; Set stack pointer SP Initial value of
IN AL,21H ; Set interrupt mask word ( use " read - And - Write " Mode enable )
AND AL,0F7H ; Can make IRQ3
OUT 21H,AL ; write in OCW1( Shielded word )
MOV SI,0 ; Create a logo , original =0
MOV AX,DATA
MOV DS,AX
MOV DX,IO0809A ; start-up A/D converter
OUT DX,AL
LOOP1:
STI ; Open the interrupt (IF Set up 1)
IN AL,DX
MOV CX,0FFFFH ; Set the delay constant
CMP SI,01 ; Search mark 、 Judge whether the conversion is completed
JNE LOOP1 ; Unfinished : Return to wait
LOOP3:
LOOP LOOP3 ; When the conversion is completed, first delay
CLI
MOV DX,IO0809A ; Start again A/D converter
OUT DX,AL
JMP LOOP1 ; Return to continue waiting for the next interrupt
INT3:
PUSH AX ; Interrupt service routine
PUSH DX
PUSH CX
MOV SI,1 ; Create a sign that the conversion is complete (SI=1)
MOV DX,IO0809A
IN AL,DX ; from A/D Converter input data
; Process the collected data : take 8 Binary number is split into two hexadecimal numbers for display
MOV TMP,0
MOV TMP,AL ; take AL Save to BL
MOV CL,4
SHR AL,CL ; take AL Shift four places to the right
CALL DISP1 ; Adjust the display subroutine to display its upper four digits
MOV AL,TMP
AND AL,0FH
CALL DISP2 ; Adjust the display subroutine to display its lower four digits
MOV DL,20H ;( Space character )
INT 21H
MOV DL,20H ;( Space character )
INT 21H
PUSH DX
MOV AH,06H ; Determine whether a key is pressed
MOV DL,0FFH ;DX=FF when The input character
INT 21H ;AL= Characters entered
POP DX
JE LOOP2 ; If there is no keyboard operation (AL=0) Then turn START
IN AL,21H ; Interrupt mask word OCW1 operation ;
OR AL,08H ; take IMR Medium IRQ3 shielding
OUT 21H,AL
MOV AH,4CH ; sign out
INT 21H
LOOP2:
STI ; Interrupt before returning to the main program
MOV AL,20H ; Write OCW2, Hair EOI command
OUT 20H,AL ; send ISR The corresponding bit is cleared
POP CX
POP DX
POP AX
IRET ; Interrupt return
DISP1 PROC NEAR ; Display subroutine
MOV TMP_1,AL
MOV AL,00H
MOV DX,281H
OUT DX,AL
MOV AL,TMP_1
MOV BX,OFFSET LED ;BX Is the starting address of the digital table
XLAT ; Find out the corresponding segment code
MOV DX,280H ; from 8255 Of A output
OUT DX,AL
MOV AL,02H
MOV DX,281H ;
OUT DX,AL
RET
DISP1 ENDP
DISP2 PROC NEAR ; Display subroutine
MOV TMP_2,AL
MOV AL,00H
MOV DX,281H;
OUT DX,AL
MOV AL,TMP_2
MOV BX,OFFSET LED ;BX Is the starting address of the digital table
XLAT ; Find out the corresponding segment code
MOV DX,280H ; from 8255 Of A output
OUT DX,AL
MOV AL,01H
MOV DX,281H ;
OUT DX,AL
RET
DISP2 ENDP
CODE ENDS
END START
Experimental results and problems encountered :
Although the setting is output on the two digit nixie tube , But because the nixie tube can only output one bit at a time , And considering the fluctuation of the data , So we didn't set the delay in the program , It is hoped that the real data situation can be presented through high-frequency data display .
Our experimental box has good performance , So in the process of the experiment, we can observe from 00 To FF Complete data range , The above figure shows the maximum value , But because the data flashes too fast , There is only one in the photo F.
During the experiment , One of the main difficulties encountered is the display of digital tubes , This is found online XLAT Instructions , Can be BX + AL And send the results to AL,LED Is an array previously defined in the data segment , What is stored is the segment code representation of a series of numbers ,BX yes LED The offset address of , that BX + AL Namely AL The address of the hexadecimal segment code corresponding to this binary number , Deliver to A You can get the correct digital display by speaking .
边栏推荐
- What a new company needs to practice and pay attention to
- MariaDB database management system learning (I) installation diagram
- 插入排序与希尔排序
- Basic introduction of figure
- 关于char[]数组通过scanf赋值使用上的一些问题。。
- Kohana 数据库
- VIP case introduction and in-depth analysis of brokerage XX system node exceptions
- [Chongqing Guangdong education] Information Literacy of Sichuan Normal University: a new engine for efficiency improvement and lifelong learning reference materials
- 华为在多个行业同时出击,吓人的技术让欧美企业瑟瑟发抖
- Why rdd/dataset is needed in spark
猜你喜欢
GPS from entry to abandonment (XIV), ionospheric delay
Uni app app half screen continuous code scanning
GPS从入门到放弃(十二)、 多普勒定速
GPS从入门到放弃(十五)、DCB差分码偏差
Xiaoman network model & http1-http2 & browser cache
2022年6月国产数据库大事记-墨天轮
The golden age of the U.S. technology industry has ended, and there have been constant lamentations about chip sales and 30000 layoffs
GPS從入門到放弃(十三)、接收機自主完好性監測(RAIM)
GPS从入门到放弃(十六)、卫星时钟误差和卫星星历误差
Vit paper details
随机推荐
GPS du début à l'abandon (XIII), surveillance autonome de l'intégrité du récepteur (raim)
Method return value considerations
解决项目跨域问题
AI enterprise multi cloud storage architecture practice | Shenzhen potential technology sharing
【sdx62】WCN685X将bdwlan.bin和bdwlan.txt相互转化操作方法
C#實現水晶報錶綁定數據並實現打印4-條形碼
Some problems about the use of char[] array assignment through scanf..
Oracle control file and log file management
嵌入式常用计算神器EXCEL,欢迎各位推荐技巧,以保持文档持续更新,为其他人提供便利
Management background --2 Classification list
关于char[]数组通过scanf赋值使用上的一些问题。。
NPM run dev start project error document is not defined
GPS从入门到放弃(十六)、卫星时钟误差和卫星星历误差
UNI-Admin基础框架怎么关闭创建超级管理员入口?
GPS from entry to abandonment (XVII), tropospheric delay
小满网络模型&http1-http2 &浏览器缓存
功能强大的国产Api管理工具
GPS从入门到放弃(十二)、 多普勒定速
Leveldb source code analysis series - main process
HDU 2008 数字统计