⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 xsdispa.asm

📁 dsp c32下开发的waver单边带调制程序
💻 ASM
📖 第 1 页 / 共 5 页
字号:
half_bit_time .set  0     
whole_bit_time .set  0
;***********************************************
;the initialization of the main program
;***********************************************
	    .text
BEGIN: 	    LDP   0,DP			;1,the following be the cpu initialization     
	    LDI   5800H,ST		;clear and enable cache,and disable OVM,level-trigg 
	    LDI   stack,SP 		;2,INT 5800H level-trigg INT
	     				;3,GIE global enable cpu INT whose reset value is 0(disable)
	    XOR   IF,IF			;4,clear the IF register
	    LDI   06H ,IOF		;5,XF0 is output XF1 is input
	    LDI   0301H,R0
	    STI   R0,@0808020H		;6,setup time0 and time1 time0_ctl and time1_ctl
	    STI   R0,@0808030H          ;		
	    ;*************		;7,to restore the INT0 and INT1 make 485 to receive	    				
	    LDI   0FFFFFFFFH,IE         ;8,enable all INT
	    LDI   audi_cf1,R0		;9,@audi_cf1 is the first iir address
	    STI   R0,@audcofaddr	;save the first address to variable audcofaddr
	    STI   R0,@audcoshaddr	;save the first address to variable audcoshaddr
	    LDI   yudo_cf3,R0		;initialization the audio and yuandong iir cofficient
	    STI   R0,@yudcofaddr
	    STI   R0,@yudcoshaddr
       	    LDI   1,R0			;to initialization do junhen or not
       	    STI   R0,@junhenyn		;don't junhen
       	    LDI   1,R0			;7,to select the signal mode (signaling iir filter address)
       	    STI   R0,@xinning		;mode 1
       	    LDI   0,R7			;8,it's a counter to decide do if enter signal processing 
 	    LDI   output2,AR2		;AR2 point to the transmit buffer
	    LDI   output1,AR3		;AR3 point to the transmit buffer
	    LDI   sintab,AR4
	    LDI   input1,AR5
	    LDI   uc_disp,AR6		;to write to uc_disp
	    LDI   uc_disp,AR7		;to read from uc_disp
;***********************************************
;the initialization of AIC
;***********************************************
AIC_INIT:
           				;to reset the AIC
            LDI  IF,IF			;clear the IF register        	
	   	    			;the following will be the serial port initialization
	    LDI  @segloctl,R0  		;16bit mode FSX FSR (input),CLKX,CLKR(input)
	    STI  R0,@0808040H    
	    LDI  00000111H,R0
	    STI  R0,@0808042H
	    LDI  00000111H,R0
	    STI  R0,@0808043H		
	    LDI  0,R0
	    STI	 R0,@0808048H		;clear the serial transmit register
	    ;****************		;to remain reset AIC for some time 
	    ;****************		;to remove from serial reset
	    LDI  0,R0
	    LDI  0,R6
recewait1:  TSTB  020H ,IF		;received the first AIC int to initialize it
            BNZ   recewait1
            ADDI  1,R6 
	    XOR   IF,IF			
	    CMPI  1,R6
	    LDIZ  01H,R0		;1 AIC first request 
	    CMPI  2,R6
	    LDIZ  0100H,R0		;1 AIC first register config
	    CMPI  3,R6
	    LDIZ  01H,R0		;1 AIC second request 
	    CMPI  4,R6
	    LDIZ  0200H,R0		;1 AIC second register config
	    CMPI  5,R6
	    LDIZ  01H,R0		;1 AIC third request
	    CMPI  6,R6
	    LDIZ  03**H,R0		;1 AIC third register config
	    CMPI  7,R6
	    LDIZ  01H,R0		;2 AIC first request  		 
	    CMPI  8,R6
	    LDIZ  01H,R0		;1 AIC fourth request
	    CMPI  9,R6			
	    LDIZ  0100H,R0		;2 AIC first register config
	    CMPI  10,R6
	    LDIZ  0400H,R0		;1 AIC fourth register config
	    CMPI  11,R6
	    LDIZ  01H,R0		;2 AIC second request
	    CMPI  12,R6
	    LDIZ  0H,R0			;NOP
	    CMPI  13,R6
	    LDIZ  0200H,R0
	    CMPI  14,R6
	    LDIZ  0H,R0			;NOP
	    CMPI  15,R6
	    LDIZ  01H,R0		;2 AIC third request 
	    CMPI  16,R6
	    LDIZ  0H,R0			;NOP
	    CMPI  17,R6
	    LDIZ  03**H,R0		;2 AIC third register config
	    CMPI  18,R6
	    LDIZ  0H,R0			;NOP
	    CMPI  19,R6
	    LDIZ  0H,R6
	    CMPI  20,R6
	    LDIZ  01H,R0		;2 AIC fourth request 
	    CMPI  21,R6
	    LDIZ  01H,R0		;3 AIC first request 
	    CMPI  22,R6
	    LDIZ  0H,R0			;NOP
	    CMPI  23,R6
	    LDIZ  0400H,R0		;2 AIC fourth register config
	    CMPI  24,R6
	    LDIZ  0100H,R0		;3 AIC first register config
	    CMPI  25,R6
	    LDIZ  0H,R0			;NOP
	    CMPI  26,R6			;NOP
	    LDIZ  0H,R0
	    CMPI  27,R6			;3 AIC second request
	    LDIZ  0200H,R0
	    CMPI  28,R6			;NOP
	    LDIZ  0H,R0
	    CMPI  29,R6			;NOP
	    LDIZ  0H,R0
	    CMPI  30,R6			;3 AIC second register config
	    LDIZ  0200H,R0
	    CMPI  31,R6			;NOP
	    LDIZ  0H,R0
	    CMPI  32,R6			;NOP
	    LDIZ  0H,R0
	    CMPI  33,R6			;3 AIC third request
	    LDIZ  01H,R0
	    CMPI  34,R6			;NOP
	    LDIZ  0H,R0
	    CMPI  35,R6			;NOP
	    LDIZ  0H,R0
	    CMPI  36,R6			;3 AIC third register config
	    LDIZ  0300H,R0
	    CMPI  37,R6			;NOP
	    LDIZ  0H,R0
	    CMPI  38,R6			;NOP	
	    LDIZ  0H,R0
	    CMPI  39,R6			;3 AIC fourth request 
	    LDIZ  01H,R0
	    CMPI  40,R6			;NOP
	    LDIZ  0H,R0
	    CMPI  41,R6			;NOP
	    LDIZ  0H,R0
	    CMPI  42,R6			;3 AIC fourth register config
	    LDIZ  0400H,R0
	    CMPI  43,R6			;NOP
	    LDIZ  0H,R0
	    CMPI  44,R6
	    BZ    main
	    NOP
	    NOP
	    NOP
	    STI   R0,@0808048H
	    BR    recewait1
	    NOP
	    NOP
	    NOP
	 	    		    	    
;*******************************************************************
;the following is the main program
;*******************************************************************
	    LDI   ***** ,IF		;relocate the intvectors table
	    OR    2000H,ST		;enable the global interrupt
main:	    NOP
   
tracyn:     CMPI  3,R7      	    	;if receive three data
       	    BZ    sigpro1
       	    NOP
       	    NOP
       	    NOP
receyn:     LDI   1,R6
	    CMPI  @todisp1,R6		;receive the data from dispB
       	    BZ    sigpro2		;process the data from dispB
       	    NOP
       	    NOP
       	    NOP
main2:					;to detect if receive a frame from uc
       	    CALL  recframe    	    
       	    BR    main
;*******************************************************************
;the following is transmit data
;*******************************************************************       	   	
sigpro1:    LDI   0,R7
            LDI   1,R6
	    CMPI  @junhenyn,R6		;to decide do junhen or not
       	    BHI   dojunhenfa		;junhen=1 do junhen otherwise to detect 
	    LDI   1024,BK
	    LDI   @xinning,R6     
	    CMPI  1,R6	 	    	;transimit the signal
            BZ    fsigmode1
            NOP
            NOP
            NOP
            CMPI  2,R6
            BZ    fsigmode2
            NOP
            NOP
            NOP
            CMPI  3,R6
            BZ    fsigmode3
            NOP
            NOP
            NOP
            CMPI  4,R6
            BZ    fsigmode4
            NOP
            NOP
            NOP
            BR    loop1			;this is signaling 5 do processing
            NOP
            NOP
            NOP
fsigmode1:  LDI   227,IR0
	    LDI   @edetect,R6		;sigle frequency 2220 ASK
            CMPI  0,R6
            BZ    fmode1		;do nothing and return 
            LDF   *AR4++(IR0)%,R6
            MPYF  2,R6 
            STF   R6,@temp1   		;otherwise transmit 2220khz
fmode1:     BR    loop1           	
fsigmode2:  LDI   387,IR0
	    LDI   @edetect,R6		;sigle frequency 3780 ASK
            CMPI  0,R6
            BZ    fmode2
            LDF   *AR4++(IR0)%,R6			 
            MPYF  2,R6 
            STF   R6,@temp1    
fmode2:     BR    loop1            					;
fsigmode3:  LDI   @edetect,R6		;double freyuency 2190 and 2250				;	
            CMPI  0,R6
            BZ    fmode3
            LDI   224,IR0
            LDF   *AR4++(IR0)%,R6
            MPYF  2,R6
            STF   R6,@temp1
            BR    loop1
fmode3:     LDI   230,IR0
            LDF   *AR4++(IR0)%,R6
	    STF   R6,@temp1
	    BR    loop1           
fsigmode4:  LDI   @edetect,R6		;double freyuency 3750 and 3810				;	
            CMPI  0,R6
            BZ    fmode4
            LDI   384,IR0

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -