完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
想用5509实现mic输入phone口输出声音,但是这个程序没有反应,调试的时候也没有显示错误,不知道是什么原因?请问该如何解决,另外我用的是ccs3.3基于XP虚拟机做的
/* * Copyright (C) 2003 Texas Instruments Incorporated * All Rights Reserved */ /* *---------main_dma4.c--------- * This example places the MCBSP in digital loopback mode and * syncs MCBSP receive with DMA channel 4 and MCBSP transmit * with DMA channel 5. * The example uses predefined CSL macros and symbolic * constants to create the initialization values needed for * the MCBSP and DMA control registers to effect the transfer */ #include #include #include #include #include #include #include #include //---------Global constants--------- #define N 512 #define CODEC_ADDR 0x1A //AIC23在I2C总线上的从地址0011010 int TestflagR=0; int TestflagT=0; Uint16 i2c_status; //---------Global data definition--------- /* Define transmit and receive buffers */ #pragma DATA_SECTION(xmt,"dmaMem") Uint16 xmt[N]; #pragma DATA_SECTION(rcv,"dmaMem") Uint16 rcv[N]; /*锁相环的设置*/ PLL_Config myConfig = { 0, //IAI: the PLL locks using the same process that was underway //before the idle mode was entered 1, //IOB: If the PLL indicates a break in the phase lock, //it switches to its bypass mode and restarts the PLL phase-locking //sequence 24, //PLL multiply value; multiply 24 times 1 //Divide by 2 PLL divide value; it can be either PLL divide value //(when PLL is enabled), or Bypass-mode divide value //(PLL in bypass mode, if PLL multiply value is set to 1) }; /*******************************************************************************************/ /**********************************MCBSP设置************************************************/ MCBSP_Config ConfigLoopBack16= { MCBSP_SPCR1_RMK( MCBSP_SPCR1_DLB_OFF, /* DLB = 0,禁止自闭环方式 */ MCBSP_SPCR1_RJUST_LZF, /* RJUST = 2 */ MCBSP_SPCR1_CLKSTP_DISABLE, /* CLKSTP = 0 */ MCBSP_SPCR1_DXENA_ON, /* DXENA = 1 */ 0, /* ABIS = 0 */ MCBSP_SPCR1_RINTM_RRDY, /* RINTM = 0 */ 0, /* RSYNCER = 0 */ MCBSP_SPCR1_RRST_DISABLE /* RRST = 0 */ ), MCBSP_SPCR2_RMK( MCBSP_SPCR2_FREE_NO, /* FREE = 0 */ MCBSP_SPCR2_SOFT_NO, /* SOFT = 0 */ MCBSP_SPCR2_FRST_FSG, /* FRST = 0 */ MCBSP_SPCR2_GRST_CLKG, /* GRST = 0 */ MCBSP_SPCR2_XINTM_XRDY, /* XINTM = 0 */ 0, /* XSYNCER = N/A */ MCBSP_SPCR2_XRST_DISABLE /* XRST = 0 */ ), /*单数据相,接受数据长度为16位,每相2个数据*/ MCBSP_RCR1_RMK( MCBSP_RCR1_RFRLEN1_OF(1), /* RFRLEN1 = 1 */ MCBSP_RCR1_RWDLEN1_16BIT /* RWDLEN1 = 2 */ ), MCBSP_RCR2_RMK( MCBSP_RCR2_RPHASE_SINGLE, /* RPHASE = 0 */ MCBSP_RCR2_RFRLEN2_OF(0), /* RFRLEN2 = 0 */ MCBSP_RCR2_RWDLEN2_8BIT, /* RWDLEN2 = 0 */ MCBSP_RCR2_RCOMPAND_MSB, /* RCOMPAND = 0 */ MCBSP_RCR2_RFIG_YES, /* RFIG = 0 */ MCBSP_RCR2_RDATDLY_1BIT /* RDATDLY = 1 */ ), MCBSP_XCR1_RMK( MCBSP_XCR1_XFRLEN1_OF(1), /* XFRLEN1 = 1 */ MCBSP_XCR1_XWDLEN1_16BIT /* XWDLEN1 = 2 */ ), MCBSP_XCR2_RMK( MCBSP_XCR2_XPHASE_SINGLE, /* XPHASE = 0 */ MCBSP_XCR2_XFRLEN2_OF(0), /* XFRLEN2 = 0 */ MCBSP_XCR2_XWDLEN2_8BIT, /* XWDLEN2 = 0 */ MCBSP_XCR2_XCOMPAND_MSB, /* XCOMPAND = 0 */ MCBSP_XCR2_XFIG_YES, /* XFIG = 0 */ MCBSP_XCR2_XDATDLY_1BIT /* XDATDLY = 1 */ ), MCBSP_SRGR1_DEFAULT, MCBSP_SRGR2_DEFAULT, MCBSP_MCR1_DEFAULT, MCBSP_MCR2_DEFAULT, MCBSP_PCR_RMK( MCBSP_PCR_IDLEEN_RESET, /* IDLEEN = 0 */ MCBSP_PCR_XIOEN_SP, /* XIOEN = 0 */ MCBSP_PCR_RIOEN_SP, /* RIOEN = 0 */ MCBSP_PCR_FSXM_EXTERNAL, /* FSXM = 0 */ MCBSP_PCR_FSRM_EXTERNAL, /* FSRM = 0 */ 0, /* DXSTAT = N/A */ MCBSP_PCR_CLKXM_INPUT, /* CLKXM = 0 */ MCBSP_PCR_CLKRM_INPUT, /* CLKRM = 0 */ MCBSP_PCR_SCLKME_NO, /* SCLKME = 0 */ MCBSP_PCR_FSXP_ACTIVEHIGH, /* FSXP = 0 */ MCBSP_PCR_FSRP_ACTIVEHIGH, /* FSRP = 1 */ MCBSP_PCR_CLKXP_FALLING, /* CLKXP = 1 */ MCBSP_PCR_CLKRP_RISING /* CLKRP = 1 */ ), MCBSP_RCERA_DEFAULT, MCBSP_RCERB_DEFAULT, MCBSP_RCERC_DEFAULT, MCBSP_RCERD_DEFAULT, MCBSP_RCERE_DEFAULT, MCBSP_RCERF_DEFAULT, MCBSP_RCERG_DEFAULT, MCBSP_RCERH_DEFAULT, MCBSP_XCERA_DEFAULT, MCBSP_XCERB_DEFAULT, MCBSP_XCERC_DEFAULT, MCBSP_XCERD_DEFAULT, MCBSP_XCERE_DEFAULT, MCBSP_XCERF_DEFAULT, MCBSP_XCERG_DEFAULT, MCBSP_XCERH_DEFAULT }; /*******************************************************************************************/ /************************************DMA设置************************************************/ /* Create DMA Receive Side Configuration */ DMA_Config dmaRcvConfig = { DMA_DMACSDP_RMK( DMA_DMACSDP_DSTBEN_NOBURST, //Destination burst :-不使用突发 DMA_DMACSDP_DSTPACK_OFF, //Destination packing :-目标口禁止打包 DMA_DMACSDP_DST_DARAM, //Destination selection :-接收的目标口是DARAM DMA_DMACSDP_SRCBEN_NOBURST, //Source burst :-源突发禁止 DMA_DMACSDP_SRCPACK_OFF, //Source packing :-源口禁止打包 DMA_DMACSDP_SRC_PERIPH, //Source selection :-外设mcbsp DMA_DMACSDP_DATATYPE_16BIT //Data type :-设置数据类型16bit字长 ), /* DMACSDP 源与目标参数寄存器 */ DMA_DMACCR_RMK( DMA_DMACCR_DSTAMODE_POSTINC, //Destination address mode :-自动执行后增量(由于本程序中数据类型是16bit,所以+2) DMA_DMACCR_SRCAMODE_CONST, //Source address mode :-源地址为恒定地址 DMA_DMACCR_ENDPROG_ON, //End of programmation bit :- DMA_DMACCR_REPEAT_ON, //Repeat condition :-不管编程配置结束位,结束传输自动初始化开始 //DMA_DMACCR_REPEAT_OFF, DMA_DMACCR_AUTOINIT_ON, //Auto initialization bit :- //DMA_DMACCR_AUTOINIT_OFF, DMA_DMACCR_EN_STOP, //Channel enable :-设置时先关闭通道 DMA_DMACCR_PRIO_LOW, //Channel priority :-设置为低优先级 DMA_DMACCR_FS_ELEMENT, //Frame/Element Sync :-单元事件同步 //DMA_DMACCR_FS_DISABLE, DMA_DMACCR_SYNC_REVT0 //Synchronization control :-McBSP1 Receive Event(REVT1) ), /* DMACCR 通道控制寄存器 */ DMA_DMACICR_RMK( DMA_DMACICR_BLOCKIE_ON, //Whole block interrupt enable :-块传输完成后中断使能 //DMA_DMACICR_BLOCKIE_OFF, DMA_DMACICR_LASTIE_OFF, //Last frame interrupt enable :- DMA_DMACICR_FRAMEIE_OFF, //Whole frame interrupt enable :- //DMA_DMACICR_FRAMEIE_ON, DMA_DMACICR_FIRSTHALFIE_OFF, //Half frame interrupt enable :- DMA_DMACICR_DROPIE_OFF, //Sync. event drop interrupt enable :- DMA_DMACICR_TIMEOUTIE_OFF //Time out interrupt enable :- ), /* DMACICR 中断控制寄存器 */ (DMA_AdrPtr)(MCBSP_ADDR(DRR10)), /* DMACSSAL 源地址低位 */ 0, /* DMACSSAU 源地址高位*/ (DMA_AdrPtr)&rcv, /* DMACDSAL 目的地址低位*/ 0, /* DMACDSAU 目的地址高位*/ 2, /* DMACEN 1 帧内数据长度 16*2 两个数据一个帧*/ N/2, /* DMACFN 帧数大小 */ 0, /* DMACFI */ 0 /* DMACEI */ }; /* Create DMA Transmit Side Configuration */ DMA_Config dmaXmtConfig = { DMA_DMACSDP_RMK( DMA_DMACSDP_DSTBEN_NOBURST, //Destination burst :-不使用突发 DMA_DMACSDP_DSTPACK_OFF, //Destination packing :-目标口禁止打包 DMA_DMACSDP_DST_PERIPH, //Destination selection :-接收的目标口是外设mcbsp DMA_DMACSDP_SRCBEN_NOBURST, //Source burst :-源突发禁止 DMA_DMACSDP_SRCPACK_OFF, //Source packing :-源口禁止打包 DMA_DMACSDP_SRC_DARAM, //Source selection :源口为DARAM DMA_DMACSDP_DATATYPE_16BIT //Data type :-设置数据类型16bit字长 ), /* DMACSDP 源与目标参数寄存器 */ DMA_DMACCR_RMK( DMA_DMACCR_DSTAMODE_CONST, //Destination address mode :-目标口地址为恒定地址 DMA_DMACCR_SRCAMODE_POSTINC, //Source address mode :-自动执行后增量(由于本程序中数据类型是16bit,所以+2) DMA_DMACCR_ENDPROG_ON, //End of programmation bit :- DMA_DMACCR_REPEAT_ON, //Repeat condition :-不管编程配置结束位,结束传输自动初始化开始 //DMA_DMACCR_REPEAT_OFF, DMA_DMACCR_AUTOINIT_ON, //Auto initialization bit :- //DMA_DMACCR_AUTOINIT_OFF, DMA_DMACCR_EN_STOP, //Channel enable :-设置时先关闭通道 DMA_DMACCR_PRIO_LOW, //Channel priority :-设置为低优先级 DMA_DMACCR_FS_ELEMENT, //Frame/Element Sync :-单元事件同步 //DMA_DMACCR_FS_DISABLE, DMA_DMACCR_SYNC_XEVT0 //Synchronization control :-McBSP1 Transmit Event(XEVT1) ), /* DMACCR 通道控制寄存器 */ DMA_DMACICR_RMK( DMA_DMACICR_BLOCKIE_ON, //Whole block interrupt enable :-块传输完成后中断使能 //DMA_DMACICR_BLOCKIE_OFF, DMA_DMACICR_LASTIE_OFF, //Last frame interrupt enable :- DMA_DMACICR_FRAMEIE_OFF, //Whole frame interrupt enable :- //DMA_DMACICR_FRAMEIE_ON, DMA_DMACICR_FIRSTHALFIE_OFF, //Half frame interrupt enable :- DMA_DMACICR_DROPIE_OFF, //Sync. event drop interrupt enable :- DMA_DMACICR_TIMEOUTIE_OFF //Time out interrupt enable :- ), /* DMACICR 中断控制寄存器 */ (DMA_AdrPtr)&xmt[0], /* DMACSSAL 源地址低位*/ 0, /* DMACSSAU 源地址高位 */ (DMA_AdrPtr)(MCBSP_ADDR(DXR10)), /* DMACDSAL 目的地址低位*/ 0, /* DMACDSAU 目的地址高位*/ 2, /* DMACEN 1 帧内数据长度 16*2 两个数据一个帧*/ N/2, /* DMACFN 帧数大小 */ 0, /* DMACFI */ 0 /* DMACEI */ }; /* Define a DMA_Handle object to be used with DMA_open function */ DMA_Handle hDmaRcv, hDmaXmt; /* Define a MCBSP_Handle object to be used with MCBSP_open function */ MCBSP_Handle hMcbsp; volatile Uint16 transferComplete = FALSE; Uint16 err = 0; Uint16 old_intm; Uint16 xmtEventId, rcvEventId; //---------Function prototypes--------- /* Reference start of interrupt vector table */ /* This symbol is defined in file, vectors.s55 */ extern void VECSTART(void); /* Protoype for interrupt functions */ interrupt void dmaXmtIsr(void); interrupt void dmaRcvIsr(void); void taskFxn(void); /*******************************************************************************************/ /***********************************I2C的设置和AIC的设置************************************/ /* This next struct shows how to use the I2C API */ /* Create and initialize an I2C initialization structure */ I2C_Setup I2Cinit = { 0, /* 7 bit address mode */ 0, /* own address - don't care if master */ 144, /* clkout value (Mhz) */ 50, /* a number between 10 and 400*/ 0, /* number of bits/byte to be received or transmitted (8)*/ 0, /* DLB mode on*/ 1 /* FREE mode of operation on*/ }; /*数字音频接口格式设置 AIC23为主模式,数据为DSP模式,数据长度16位*/ Uint16 digital_audio_inteface_format[2]={0x0e,0x53}; /*AIC23的波特率设置,采样率为44.1K*/ Uint16 sample_rate_control[2] = {0x10,0x23}; /*AIC23寄存器复位*/ Uint16 reset[2] ={0x1e,0x00}; /*AIC23节电方式设置,所有部分均所与工作状态*/ Uint16 power_down_control[2] ={0x0c,0x00}; /*AIC23模拟音频的控制 DAC使能,ADC输入选择为mic*/ Uint16 analog_aduio_path_control[2] ={0x08,0x10}; //Uint16 analog_aduio_path_control[2] ={0x08,0x15};//MIC IN 有增益 //Uint16 analog_aduio_path_control[2] ={0x08,0x14};//MIC IN 无增益 //Uint16 analog_aduio_path_control[2] ={0x08,0x10};//Line IN /*AIC23数字音频通路的控制*/ Uint16 digital_audio_path_control[2] ={0x0a,0x05}; /*AIC23数字接口的使能*/ Uint16 digital_interface_activation[2] ={0x12,0x01}; /*AIC23左通路音频调节*/ Uint16 left_line_input_volume_control[2] ={0x00,0x17}; /*AIC23右通路音频调节*/ Uint16 right_line_input_volume_control[2] ={0x02,0x17}; /*AIC23耳机左通路音频调节*/ Uint16 left_headphone_volume_control[2] ={0x05,0xFF}; /*AIC23耳机右通路音频调节*/ Uint16 right_headphone_volume_control[2] = {0x07,0xFF}; /*******************************************************************************************/ /*******************************************************************************************/ void delay(Uint32 k) { while(k--); } /*******************************************************************************************/ /*******************************************************************************************/ void CODEC(void) { //printf ("%sn","CODEC"); /*I2C is undet reset*/ I2C_RSET(I2CMDR,0); /*设置预分频寄存器,I2C的mode clock is 10MHz*/ delay(100); I2C_RSET(I2CSAR,0x001A); I2C_RSET(I2CMDR,0x0620); I2C_setup(&I2Cinit); /*设置I2C的Mater clock*/ I2C_RSET(I2CCLKL,100); I2C_RSET(I2CCLKH,100); /*reset AIC23*/ i2c_status = I2C_write( reset, //pointer to data array 2, //length of data to be transmitted 1, //master or slaver CODEC_ADDR, //slave address to transmit to 1, //transfer mode of operation 30000 //time out for bus busy ); delay(1000); /*设置AIC23各部分均工作*/ i2c_status = I2C_write( power_down_control,//pointer to data array 2, //length of data to be transmitted 1, //master or slaver CODEC_ADDR, //slave address to transmit to 1, //transfer mode of operation 30000 //time out for bus busy ); /*设置AIC23的数字接口*/ i2c_status = I2C_write( digital_audio_inteface_format,//pointer to data array 2, //length of data to be transmitted 1, //master or slaver CODEC_ADDR, //slave address to transmit to 1, //transfer mode of operation 30000 //time out for bus busy ); /*设置AIC23模拟通路*/ i2c_status = I2C_write( analog_aduio_path_control,//pointer to data array 2, //length of data to be transmitted 1, //master or slaver CODEC_ADDR, //slave address to transmit to 1, //transfer mode of operation 30000 //time out for bus busy ); /*设置数字通路*/ i2c_status = I2C_write( digital_audio_path_control,//pointer to data array 2, //length of data to be transmitted 1, //master or slaver CODEC_ADDR, //slave address to transmit to 1, //transfer mode of operation 30000 //time out for bus busy ); /*设置AIC23的采样率*/ i2c_status = I2C_write( sample_rate_control,//pointer to data array 2, //length of data to be transmitted 1, //master or slaver CODEC_ADDR, //slave address to transmit to 1, //transfer mode of operation 30000 //time out for bus busy ); /*设置耳机音量*/ i2c_status = I2C_write( left_headphone_volume_control,//pointer to data array 2, //length of data to be transmitted 1, //master or slaver CODEC_ADDR, //slave address to transmit to 1, //transfer mode of operation 30000 //time out for bus busy ); i2c_status = I2C_write( right_headphone_volume_control,//pointer to data array 2, //length of data to be transmitted 1, //master or slaver CODEC_ADDR, //slave address to transmit to 1, //transfer mode of operation 30000 //time out for bus busy ); /*设置Line输入的音量*/ i2c_status = I2C_write( left_line_input_volume_control,//pointer to data array 2, //length of data to be transmitted 1, //master or slaver CODEC_ADDR, //slave address to transmit to 1, //transfer mode of operation 30000 //time out for bus busy ); i2c_status = I2C_write( right_line_input_volume_control,//pointer to data array 2, //length of data to be transmitted 1, //master or slaver CODEC_ADDR, //slave address to transmit to 1, //transfer mode of operation 30000 //time out for bus busy ); /*启动AIC23*/ i2c_status = I2C_write( digital_interface_activation,//pointer to data array 2, //length of data to be transmitted 1, //master or slaver CODEC_ADDR, //slave address to transmit to 1, //transfer mode of operation 30000 //time out for bus busy ); } //---------main routine--------- void main(void) { Uint16 i; /* Initialize CSL library - This is REQUIRED !!! */ CSL_init(); /* Set IVPD/IVPH to start of interrupt vector table */ IRQ_setVecs((Uint32)(&VECSTART)); PLL_config(&myConfig); /* Call function to effect transfer */ CODEC(); taskFxn(); } void taskFxn(void) { Uint16 srcAddrHi, srcAddrLo; Uint16 dstAddrHi, dstAddrLo; Uint16 i; /* By default, the TMS320C55xx compiler assigns all data symbols word */ /* addresses. The DMA however, expects all addresses to be byte */ /* addresses. Therefore, we must shift the address by 2 in order to */ /* change the word address to a byte address for the DMA transfer. */ srcAddrHi = (Uint16)(((Uint32)(MCBSP_ADDR(DRR10))) >> 15) & 0xFFFFu; srcAddrLo = (Uint16)(((Uint32)(MCBSP_ADDR(DRR10))) << 1) & 0xFFFFu; dstAddrHi = (Uint16)(((Uint32)(&rcv)) >> 15) & 0xFFFFu; dstAddrLo = (Uint16)(((Uint32)(&rcv)) << 1) & 0xFFFFu; dmaRcvConfig.dmacssal = (DMA_AdrPtr)srcAddrLo; dmaRcvConfig.dmacssau = srcAddrHi; dmaRcvConfig.dmacdsal = (DMA_AdrPtr)dstAddrLo; dmaRcvConfig.dmacdsau = dstAddrHi; srcAddrHi = (Uint16)(((Uint32)(&xmt[0])) >> 15) & 0xFFFFu; srcAddrLo = (Uint16)(((Uint32)(&xmt[0])) << 1) & 0xFFFFu; dstAddrHi = (Uint16)(((Uint32)(MCBSP_ADDR(DXR10))) >> 15) & 0xFFFFu; dstAddrLo = (Uint16)(((Uint32)(MCBSP_ADDR(DXR10))) << 1) & 0xFFFFu; dmaXmtConfig.dmacssal = (DMA_AdrPtr)srcAddrLo; dmaXmtConfig.dmacssau = srcAddrHi; dmaXmtConfig.dmacdsal = (DMA_AdrPtr)dstAddrLo; dmaXmtConfig.dmacdsau = dstAddrHi; /* Open MCBSP Port 1 and set registers to their power on defaults */ hMcbsp = MCBSP_open(MCBSP_PORT0, MCBSP_OPEN_RESET); /* Open DMA channels 4 & 5 and set regs to power on defaults */ hDmaRcv = DMA_open(DMA_CHA4,DMA_OPEN_RESET); hDmaXmt = DMA_open(DMA_CHA5,DMA_OPEN_RESET); /* Get interrupt event associated with DMA receive and transmit */ xmtEventId = DMA_getEventId(hDmaXmt); rcvEventId = DMA_getEventId(hDmaRcv); /* Temporarily disable interrupts and clear any pending */ /* interrupts for MCBSP transmit */ old_intm = IRQ_globalDisable(); /* Clear any pending interrupts for DMA channels */ IRQ_clear(xmtEventId); IRQ_clear(rcvEventId); /* Enable DMA interrupt in IER register */ IRQ_enable(xmtEventId); IRQ_enable(rcvEventId); /* Set Start Of Interrupt Vector Table */ IRQ_setVecs(0x10000); /* Place DMA interrupt service addresses at associate vector */ IRQ_plug(xmtEventId,&dmaXmtIsr); IRQ_plug(rcvEventId,&dmaRcvIsr); /* Write values from configuration structure to MCBSP control regs */ MCBSP_config(hMcbsp, &ConfigLoopBack16); /* Write values from configuration structure to DMA control regs */ DMA_config(hDmaRcv,&dmaRcvConfig); DMA_config(hDmaXmt,&dmaXmtConfig); #if 0 /* Take MCBSP transmit and receive out of reset */ MCBSP_start(hMcbsp, MCBSP_XMIT_START | MCBSP_RCV_START, 0u); /* Prime MCBSP DXR */ while (!(MCBSP_xrdy(hMcbsp))){ ; } MCBSP_write16(hMcbsp,xmt[0]); /* Enable all maskable interrupts */ IRQ_globalEnable(); /* Enable DMA */ DMA_start(hDmaRcv); DMA_start(hDmaXmt); /* Start Sample Rate Generator and Enable Frame Sync */ MCBSP_start(hMcbsp, MCBSP_SRGR_START | MCBSP_SRGR_FRAMESYNC, 0x300u); printf ("%sn""IF"); #else /* Enable all maskable interrupts */ IRQ_globalEnable(); /* Start Sample Rate Generator and Enable Frame Sync */ MCBSP_start(hMcbsp, MCBSP_SRGR_START | MCBSP_SRGR_FRAMESYNC, 0x300u); /* Enable DMA */ DMA_start(hDmaRcv); DMA_start(hDmaXmt); /* Take MCBSP transmit and receive out of reset */ MCBSP_start(hMcbsp, MCBSP_XMIT_START | MCBSP_RCV_START, 0u); printf ("%sn","ELSE"); #endif //while(DMA_FGETH(hDmaRcv, DMACCR, ENDPROG)); /* Wait for DMA transfer to be complete */ //DMA_FSETH(hDmaRcv, DMACCR, ENDPROG,1); //DMA_FSETH(hDmaXmt, DMACCR, ENDPROG,1); //printf ("%sn","AGAIN"); //while(DMA_FGETH(hDmaRcv, DMACCR, ENDPROG)); //DMA_FSETH(hDmaRcv, DMACCR, ENDPROG,1); //DMA_FSETH(hDmaXmt, DMACCR, ENDPROG,1); //printf ("%sn",err?"TEST FAILED" : "TEST PASSED"); /* Restore status of global interrupt enable flag */ //IRQ_globalRestore(old_intm); /* We're done with MCBSP and DMA , so close them */ //MCBSP_close(hMcbsp); //DMA_close(hDmaRcv); //DMA_close(hDmaXmt); } interrupt void dmaXmtIsr(void) { Uint16 i; //DMA_stop(hDmaXmt); //IRQ_disable(xmtEventId); //printf ("%sn","dmaXmtIsr"); //DMA_start(hDmaRcv); //DMA_start(hDmaXmt); TestflagT++; } interrupt void dmaRcvIsr(void) { //DMA_stop(hDmaRcv); //IRQ_disable(rcvEventId); //printf ("%sn","dmaRcvIsr"); Uint16 i; //DMA_start(hDmaRcv); //DMA_start(hDmaXmt); for(i = 0; i <= N - 1; i++) { xmt[i]=rcv[i]; } //DMA_start(hDmaRcv); DMA_start(hDmaXmt); TestflagR++; } |
|
相关推荐
1个回答
|
|
首先,我们需要检查以下几个方面来确定问题所在:
1. 硬件连接:确保麦克风(MIC)和耳机(PHONE)接口正确连接到5509开发板。 2. 代码检查:检查代码是否正确配置了MCBSP和DMA通道。以下是一些关键点: a. 确保MCBSP模块已正确初始化,包括采样率、位宽等参数。 b. 确保DMA通道4和5已正确配置,包括源地址、目标地址、传输大小等参数。 c. 确保MCBSP接收和发送通道已正确配置,包括时钟源、帧同步等参数。 3. 中断处理:检查代码中是否有中断处理函数,以及这些函数是否正确处理了MCBSP和DMA通道的中断。 4. 调试信息:在代码中添加调试信息,例如使用printf()函数输出关键变量的值,以帮助定位问题所在。 5. 硬件问题:如果以上步骤都无法解决问题,可能是开发板本身存在硬件问题。可以尝试更换开发板或联系厂商寻求技术支持。 以下是一些建议的调试步骤: 1. 检查硬件连接:确保麦克风和耳机接口正确连接到5509开发板。 2. 检查代码:确保MCBSP和DMA通道配置正确。 3. 添加调试信息:在代码中添加printf()函数输出关键变量的值。 4. 检查中断处理:确保中断处理函数正确处理了MCBSP和DMA通道的中断。 5. 检查硬件问题:如果以上步骤都无法解决问题,尝试更换开发板或联系厂商寻求技术支持。 希望这些建议能帮助您解决问题。如果问题仍然存在,请提供更多详细信息,以便我们为您提供更具体的帮助。 |
|
|
|
只有小组成员才能发言,加入小组>>
NA555DR VCC最低电压需要在5V供电,为什么用3.3V供电搭了个单稳态触发器也使用正常?
677 浏览 3 评论
MSP430F249TPMR出现高温存储后失效了的情况,怎么解决?
599 浏览 1 评论
对于多级放大电路板,在PCB布局中,电源摆放的位置应该注意什么?
1052 浏览 1 评论
736 浏览 0 评论
普中科技F28335开发板每次上电复位后数码管都会显示,如何熄灭它?
523 浏览 1 评论
请问下tpa3220实际测试引脚功能和官方资料不符,哪位大佬可以帮忙解答下
158浏览 20评论
请教下关于TAS5825PEVM评估模块原理图中不太明白的地方,寻求答疑
123浏览 14评论
在使用3254进行录音的时候出现一个奇怪的现象,右声道有吱吱声,请教一下,是否是什么寄存器设置存在问题?
124浏览 13评论
TLV320芯片内部自带数字滤波功能,请问linein进来的模拟信号是否是先经过ADC的超采样?
122浏览 12评论
TPA6304-Q1: TPA6304 两片公用一组I2C的话,其中一片配置不成功怎么办
165浏览 10评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-23 17:53 , Processed in 0.931301 second(s), Total 81, Slave 63 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号