dsp汇编程序 LED

时间:2012-08-09 17:00:15
【文件属性】:

文件名称:dsp汇编程序 LED

文件大小:39KB

文件格式:DOC

更新时间:2012-08-09 17:00:15

汇编程序

.mmregs .def CodeEntry .def Eint1_ISR .data Data_DP: .text CodeEntry: .copy "set_dp.asm" ;初始化DP,SP .copy "set_iptr.asm" ;初始化中断向量表 ;Initialize the AD1571 K_STARTSEL .set 1<<7 ;D7 0:HARDWARE START 1:SOFTWARE START K_PROGEOC .set 0<<6 ;D6 0:INT 1:EOC K_CLKSEL .set 0<<5 ;D5 0:Internal Clock 1:External Clock K_SWPWDN .set 0<<4 ;D4 0:Normal 1:Power Down K_MODESEL .set 0<<3 ;D3 0:Single Channel 1:Sweep Mode K_CR0 .set (K_STARTSEL|K_PROGEOC|K_CLKSEL|K_SWPWDN|K_MODESEL)<<5 K_OSCSPD .set 0<<6 ;D6 0:INT.OSC.SLOW 1:INT. OSC. FAST K_OUTCODE .set 0<<3 ;D3 0:Binary 1:2s Complement K_READREG .set 0<<2 ;D2 0:Enable Self Test 1:Register Read back K_STEST .set 0 ;0 CONVERSION result READREG = 0 ;1 SELF TEST 1 result ;2 SELF TEST 2 result ;3 SELF TEST 3 result ;0 Contents of CR0 READREG = 1 ;1 Contents of CR1 K_CR1 .set (100H|K_OSCSPD|K_OUTCODE|K_READREG|K_STEST)<<5 DAC_DAT .set 2200h ADC_DAT .set 2300h SSBX INTM ;关闭中断 STM #0003H,IMR ;使能外部中断1 STM #0FFFFH,IFR ;清除未决的中断 RSBX INTM ;使能中断 STM #K_CR0,AR0 ;设置AD1571初始化字 STM #K_CR1,AR1 ;设置AD1571初始化字 PORTW *(10h),ADC_DAT ;初始化AD1571 PORTW *(11h),ADC_DAT ;初始化AD1571 LOOP: NOP B LOOP Eint1_ISR: PSHM AR0 ;保护AR0 PORTR ADC_DAT,*(10h) ;读取AD采样数据 PORTW *(10h),DAC_DAT ;将采样数据输出到DA NOP NOP POPM AR0 ;恢复AR0 RETE .end


网友评论