完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
hi,
最近在跑sharc中的例程的时候, 运行Examples中的Block Based TalkThru (C)程序时,开发板连接音频线,点击run运行后,out端接speaker,可以听到音乐,但是点击Halt按钮后,仍然播放音乐,如何修改程序,可以点击run运行程序,点击Halt暂停不播放音乐。 2、关于工程文件中initSPORT.c,程序代码如下: #include "tt.h" #define DAC4 unsigned int PCI = 0x00080000 ; unsigned int OFFSET = 0x00080000 ; // TCB blocks for Chaining //Each block will be used for: // Filling from the ADC // Processing filled data // Sending to DAC // //Each one is doing only one of these steps for each SPORT interrupt. //For this example the startup state is // Start to 1st interrupt: Block_A is filled first, Block_C is sent // 1st int to 2nd int: Block_C filled, Block_A processed, Block_B sent // 2nd int to 3rd int: Block_B filled, Block_C processed, Block_A sent // 3rd int to 4th int: Block_A filled, Block_B processed, Block_C sent unsigned int Block_A[NUM_SAMPLES] ; unsigned int Block_B[NUM_SAMPLES] ; unsigned int Block_C[NUM_SAMPLES] ; //Set up the TCBs to rotate automatically int TCB_Block_A[4] = { 0, sizeof(Block_A), 1, 0};; int TCB_Block_B[4] = { 0, sizeof(Block_B), 1, 0}; int TCB_Block_C[4] = { 0, sizeof(Block_C), 1, 0}; void InitSPORT() { //Proceed from Block A to Block C TCB_Block_A[0] = (int) TCB_Block_C + 3 - OFFSET + PCI ; TCB_Block_A[3] = (unsigned int) Block_A - OFFSET ; //Proceed from Block B to Block A TCB_Block_B[0] = (int) TCB_Block_A + 3 - OFFSET + PCI ; TCB_Block_B[3] = (unsigned int) Block_B - OFFSET ; //Proceed from Block C to Block B TCB_Block_C[0] = (int) TCB_Block_B + 3 - OFFSET + PCI ; TCB_Block_C[3] = (unsigned int) Block_C - OFFSET ; //Clear the Mutlichannel control registers *pSPMCTL0 = 0; *pSPMCTL1 = 0; *pSPMCTL2 = 0; *pSPCTL0 = 0 ; *pSPCTL1 = 0 ; *pSPCTL2 = 0 ; //============================================================ // // Configure SPORT 0 for input from ADC // //------------------------------------------------------------ *pSPCTL0 = (OPMODE | SLEN24 | SPEN_A | SCHEN_A | SDEN_A); // Enabling Chaining // Block A will be filled first *pCPSP0A = (unsigned int) TCB_Block_A - OFFSET + 3 ; //============================================================ // // Configure SPORTs 1 & 2 for output to DACs 1-4 // //------------------------------------------------------------ #ifdef DAC1 *pSPCTL1 = (SPTRAN | OPMODE | SLEN24 | SPEN_A | SCHEN_A | SDEN_A) ; // write to DAC1 *pCPSP1A = (unsigned int) TCB_Block_C - OFFSET + 3 ; #endif #ifdef DAC2 *pSPCTL1 |= (SPTRAN | OPMODE | SLEN24 | SPEN_B | SCHEN_B | SDEN_B) ; // write to DAC2 *pCPSP1B = (unsigned int) TCB_Block_C - OFFSET + 3 ; #endif #ifdef DAC3 *pSPCTL2 = (SPTRAN | OPMODE | SLEN24 | SPEN_A | SCHEN_A | SDEN_A) ; // write to DAC3 *pCPSP2A = (unsigned int) TCB_Block_C - OFFSET + 3 ; #endif #ifdef DAC4 *pSPCTL2 |= (SPTRAN | OPMODE | SLEN24 | SPEN_B | SCHEN_B | SDEN_B) ; // write to DAC4 *pCPSP2B = (unsigned int) TCB_Block_C - OFFSET + 3 ; #endif } 我想修改AD采集回来的电压信号在将修改后的信号通过DA进行输出播放,需要如何对程序进行修改,之前修改后,输出的还是原来的信号。 需要修改[size=15.3333330154419px]initSPORT.c的模块还是修改其他模块? [size=15.3333330154419px] |
|
相关推荐
1个回答
|
|
|
|
|
|
只有小组成员才能发言,加入小组>>
给ADUM4223 增加信号驱动15V电压就不正常, 波动很大会被烧是什么情况?
1296 浏览 2 评论
ADP5092 SYS端口为2.09V,但是REG_OUT为0是什么原因?
1896 浏览 1 评论
ad7193差分输入ain1与ain2差是正值时,读到电压与实际值误差小,但为负值值,误差就变的很大
4237 浏览 2 评论
8994 浏览 1 评论
3138 浏览 1 评论
ADC3442采集,分析数据出现有规则毛刺,请问是哪方面的问题啊?
1420浏览 3评论
AD7190状态寄存器一直是0x80,连续转换模式下RDY不拉低
1642浏览 2评论
1614浏览 2评论
给ADUM4223 增加信号驱动15V电压就不正常, 波动很大会被烧是什么情况?
1298浏览 2评论
212浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-23 19:10 , Processed in 0.966061 second(s), Total 76, Slave 60 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号