- 1、本文档共17页,可阅读全部内容。
- 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
脉冲采样(国外英文资料)
脉冲采样(国外英文资料)
Liu Yongqiang 16:49:45
SCM data acquisition system oscilloscope interface source
Assembly language output subroutine SUCU:
SUCU:SETB P1.7; the external sync signal is high
MOV, A, #0FFH; set the start flag to a high level
MOV DPTR, 0400H; sets the DAC0832 address
MOVX, @DPTR, A; send the start mark high
CPL P1.7; the external synchronization signal is over
INC A; set the start flag to 0
MOVX, @DPTR, A; send start flag low
DEC A
MOVX, @DPTR, A
INC A
MOVX, @DPTR, A; bold start mark
CALL SJCS; call data transfer subroutine
MOV, A, 90H
MOV DPTR, 0400H; sets the DAC0832 address
MOVX, @DPTR, A; send end mark high
MOV, A, 70H
MOVX, @DPTR, A; send end mark low
MOV, A, 90H
MOVX, @DPTR, A
MOV, A, 70H
MOVX, @DPTR, A; bold end mark
RET
Data transfer subroutine SJCS:
SJCS:MOV, R6, 00H;
LOOP0:MOV, P2, R6;
MOV, R1, 00H
LOOP1:DJNZ, R1, LOOP1
INC R6
CJNE, R6, 04H, LOOP0
RET
//keil c6.20c is directly embedded in the assembly method! (C51BBS, netizen Cuiwei)
//asm.h
#ifdef ASM
Unsigned, long, shiftR1 (register, unsigned, long);
#else
Extern, unsigned, long, shiftR1 (register, unsigned, long);
#endif
//end of asm.h
//asm.c
#define ASM
#include asm.h
#include reg52.h
#pragma OT (4, speed)
Unsigned, long, shiftR1 (register, unsigned, long, x)
{
#pragma ASM
CLR C
MOV, a, R4
RRC a
MOV, R4, a
MOV, a, R5
RRC a
MOV, R5, a
MOV, a, R6
RRC a
MOV, R6, a
MOV, a, R7
RRC a
MOV, R7, a
#pragma endasm
Return (x);
}
//end of asm.c
This * source file to compile the project file,
/ / the cursor point to this file, select the right click menu option for fileasm.c,
/ / attribute single properties in Generate Assembler SRC File Assemble SRC File
Two / set to black V will be Link Public Only V removed, then the compiler can.
/ / any position by this method can be used in the source code of C #pragma ASM and #pragma endasm embedded assembly language.
/ / but should pay attention to carefully in the direct use of parameter optimization, resulting in different levels of the different assembly code,
文档评论(0)