📄 ad_da.asm
字号:
*********************************************************
* ADS805 *
* 1.本程序实现ADS805的调试,以测试其采样频率等。 *
* 2.ADS805的采样频率10K--20M.本程序调试过程中使用1M *
* 3.使用的信号是100K的方波,正弦波。 *
* *
* Author: YangSS *
* Version: v3 Date: 05\12\2 *
*********************************************************
.title "AD_DA"
.mmregs
.def _c_int00
.include "Ads805.h"
temp .usect "temp", 1
output .usect "output", 1000H
.text
*********************************************************
* Interrupt table Configure the necessary interrupt *
* *
*********************************************************
.align 0x80
_c_int00:
B Start ;RESET
NOP
NOP
.space 22*4*16
TINT0:
ret
;B Receive
NOP
NOp
.space 5*4*16
*********************************************************
* Main Function for the ADS805 debug *
* *
*********************************************************
Start:
STM #1000h, SWWSR ;I/O wait 1 clk
STM #00a0h, PMST
SSBX INTM
STM #00H, IMR
STM #3FFFH, IFR ;Clear all the
STM #8000H, GPIOCR ;Interrupt
CALL Dsp100M
*********************************************************
* TIMER interrupt *
* 1.Configure the divided frequency for sampling *
* 2.Here the divide coefficient 2*5. *
*********************************************************
TIME0:
STM #010100100100b, TCR0
STM #01h, PRD0
STM #3FFFH, IFR
STM #010100100100b, TCR0
NOP
NOP
NOP
; Configure the sampling start
RPT #22
NOP
*************************************************
* FUNCTION : Receive *
* PARAMETRES; NONE *
* PURPOSE : RECEIVE THE DIGITAL(12 bits) *
* THROUGH ADS805. *
*************************************************
STM #temp, AR3
STM #1000h, AR4
STM #output, AR2
; Sample 1500h data
ST #1500h, BRC
RPTB SamFin-1
Receive:
PORTR 2000h,*AR3 ;2
RPT #3 ;6
NOP
MVDD *AR3, *AR2+ ;1
RPT #7 ;9
NOP
; Configure the sample interval for specifical purpose
;rpt #18 ;20
;nop
;rpt #18 ;20
;nop
;b Receive
SamFin:
STM #output, AR2
ST #1500h, BRC
RPTB Finish-1
DataDeal: ;
LD *AR2, A
AND #1FFFh, A
NOP
NOP
NOP
NOP
STL A, *AR2+
NOP
NOP
Finish:
B Finish
******************************************************
* FUNCTION: DspXM *
* PARAMETRE: NONE *
* PURPOSE : CONFIGURE THE CLOCKS FOR DSP. *
******************************************************
Dsp100M:
STM #0000h,CLKMD
F100M:
LDM CLKMD,A
AND #01h,A
BC F100M,ANEQ
STM #10EFh,CLKMD ;Configure DSP clkout
RPT #100
NOP
RET
.end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -