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

📄 sdi_test.asm

📁 基于ADSP的G.729语音编解码程序
💻 ASM
字号:

/* Analog Devices, Inc
  One Technology Way
  Norwood, MA 02062-9106
  DSP Applications Assistance Tel: 617-461-3672
  Fax: 617-461-3010

  September 1990

  This code is intended to perform a basic functional test of an ADSP-2101.
  The test is not exhaustive but does touch all sections of the part. A
  reasonable level of confidence in the functionality of the processor can be
  obtained by passing the test. Throughout this code, comments describe what 
  is being tested and to what standards.  Should enhancement become necessary,
  it can be easily accomplished.  Unnecessary sections of the code can also be
  removed freely, as each test is completely modular. If there are concerns 
  or comments, please call for DSP Applications Assistance at 617-461-3672.
*/

//.MODULE/RAM	functional_test;
.section/data data1;
.VAR	jump_test_result,
		call_test_result,
		loop_test_result,
		dp_test_result,
		ALU_func_result,
		DAG1_result,
		DAG2_result,
		MAC_result,
		SHIFTER_result,
		TIMER_result;

/*------------------------------------------------------------------------------*/
/* Reset vector and Interrupt Table                                             */
/*------------------------------------------------------------------------------*/
.section/pm program;	
 JUMP setup; NOP; NOP; NOP;     /*reset vector*/
 RTI; NOP; NOP; NOP;             /*IRQ2*/
 JUMP receive1; NOP; NOP; NOP;   /*WaterMark INT*/
 RTI; NOP; NOP; NOP;     /*IRQL2*/
 RTI; NOP; NOP; NOP;             /*SPORT0 transmit*/
 RTI; NOP; NOP; NOP;             /*SPORT0 receive*/
 JUMP receive2; NOP; NOP; NOP;       /*BSB*/
 RTI; NOP; NOP; NOP;     /*BDMA*/
 RTI; NOP; NOP; NOP;             /*SPORT1 transmit*/
 RTI; NOP; NOP; NOP;             /*SPORT1 receive*/
 RTI; NOP; NOP; NOP;             /*timer*/
 RTI; NOP; NOP; NOP;     /*Power down*/
 RTI; NOP; NOP; NOP;             /*Breakpoint*/
 JUMP changewm; NOP; NOP; NOP;   /*WK_mode_irq*/



/*------------------------------------------------------------------------------*/
/* Setup data memory result variables for self test.  If tests are PASSED each  */
/* test_result will be 0xA1A1, if any test is FAILED the corresponding result   */
/* will be 0xDEAD (or at least not 0xA1A1).                                     */
/*------------------------------------------------------------------------------*/
//.section/pm program;
                    /*-----Initializations-----*/
setup:  AX0 =0x0000;

        ICNTL=0x07;                     /*enable edge sensitive IRQs*/
		IMASK= 0x2410; 
//        IMASK=0x2510;                   /*enable I2S & BSB receive IRQ*/

  AY0=0x100;
  IO(0x729)=AY0;           /*setup water mark = 0x100*/   

//  AY0 = 0x08;
//  IO(0x72E) = AY0;                      /*start audio operation*/


 	AX0 = 0xffff;
	IO(0x70a) = AX0; 

  IDLE; 				// WAIT change wk mode

/*------Wait for command------------*/

  IMASK=0x0010;                   /*enable I2S & BSB receive IRQ*/
	I0 = 0;
	M0 = 1;
	L0 = 0;
//  CNTR = 54;
//  DO wait_bsb3 UNTIL CE; 
//  		NOP;
//	  IDLE;             /*wait int for bsb */   
//	wait_bsb3:  IDLE; //NOP;
	IDLE;
	IDLE;
	IDLE;
	IDLE;
	IDLE;
	IDLE;
	IDLE;
	IDLE;
	IDLE;
	IDLE;
	IDLE;
	IDLE;
	IDLE;
	IDLE;
	IDLE;
	IDLE;
	IDLE;
	IDLE;
	IDLE;
	IDLE;
	IDLE;
	IDLE;
	IDLE;
	IDLE;
	IDLE;
	IDLE;
	IDLE;
	IDLE;
	IDLE;
	IDLE;
	IDLE;
	IDLE;
	IDLE;
	IDLE;
	IDLE;
	IDLE;
	IDLE;
	IDLE;
	IDLE;
	IDLE;
	IDLE;
	IDLE;
	IDLE;
	IDLE;
	IDLE;
	IDLE;
	IDLE;
	IDLE;
	IDLE;
	IDLE;
	IDLE;
	IDLE;
	IDLE;
	IDLE;


	I1 = 0;
	M1 = 1;
	L1 = 0; 
    cntr = 0x300; 
  	DO dm2ac UNTIL ce;
  		AY1 = dm(I1, M1);
		IO(0x700) = AY1; 
	dm2ac: 
		IO(0x700) = AY1;

  AY0 = 0x08;
  IO(0x72E) = AY0;                      /*start audio operation*/

  // Clear all IRQ
  IFC = 0x00ff;
  IMASK = 0x2500;		// turn off bsb IRQ , only enable WaterMark

/*
  I1 = 0;
  M1 = 8;
  L1 = 256; 
  cntr = 0x300; 
  DO dm2ac UNTIL ce;
  	AY1 = dm(I1, M1);
	dm2ac: IO(0x700) = AY1;

	IFC = 0x00ff;
	IMASK = 0x0100;

	AX0 = 0x0;
	IO(0x70a) = AX0; 
*/
  IDLE;
  IDLE;
  IDLE;
jmp_idle:  
  IDLE;	
  Jump jmp_idle; 

  changewm: 
	// LED 
	AX0 = 0x5555;
	IO(0x70a) = AX0; 

	NOP;  	
  	NOP;
	RTI;
//  AY0=0x600;
// IO(0x729)=AY0;           /*setup water mark = 0x600*/   
//  RTI;
  
  receive1:				// Watermark IRQ;
	// LED 
	AX0 = 0xffff;
	IO(0x70a) = AX0; 

 	cntr = 0x200;
	DO dm2_ac UNTIL CE;
		AY1 = dm(I1, M1);
		IO(0x700) = AY1; 
  	dm2_ac:
   		IO(0x700) = AY1; 

	// LED 
	AX0 = 0xffff;
	IO(0x70a) = AX0; 
	   	
	RTI; 
  
  receive2:		// bsb interrupt
 	cntr = 0x0100;
	DO 	bsb2dm UNTIL CE; 
		AX0 = IO(0x702);
	bsb2dm:
		DM(I0, M0) = AX0; 

	AX0 = 0x7fff;
	IO(0x707) = AX0; 
	///// Data transfer to AC buffer
/*
	I1 = 0;
	M1 = 2;
	L1 = 256; 
    cntr = 0x300; 
  	DO dm2ac UNTIL ce;
  		AY1 = dm(I1, M1);
		IO(0x700) = AY1; 
	dm2ac: 
		IO(0x700) = AY1;
*/
	// LED 
	AX0 = 0x5555;
	IO(0x70a) = AX0; 

	RTI;			



//  AY0=0x000a;              /*mute audio buffer*/
//  IO(0x72E)=AY0;

//  CNTR=0x000a;             /*do 10 sets of data*/
//  DO danjee3 UNTIL CE;
//     AX0=IO(0x700);
//  danjee3: IO(0x702)=AX0;           /*stop mute*/

//  AY0=0x0008;
//  IO(0x72E)=AY0;

//  CNTR=0x00f6;             /*do remained 246 sets of data*/
//  DO danjee4 UNTIL CE;
//     AX0=IO(0x700);
//  danjee4: IO(0x702)=AX0;

//  AY0=0xff01;
//  IO(0x707)=AY0;
//  RTI;

//.ENDMOD;

⌨️ 快捷键说明

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