完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
你好,
我尝试使用ADMA将数据从ADC-SAR传输到UART。为此,我遵循了AN51705中显示的配置,但我得到了这个错误: “.Me.c:函数中的‘DMAICONFIG’: Maun.C:83:36:错误:“AdcSARYA 1WRK0ZPTR”未声明(首次使用此函数) 有人能帮我吗? 最好的问候 霍萨姆 主+DMA配置: 项目包括: /DMA1**的/DMA配置常数 定义DMAY1YBYTESY-PARYSB(1U) 定义dMA11-请求- PrimeSurb(1U) 定义dMA11SRCbBASE(CyDeVelePrimeBaseBasic) 定义DMAE11DSTBASBASE(CyDeVeldEngurBaseBasic) 空格DMAICONFIG(空格); int() { AcdSARY1LSTART(); DMAIN配置(); AdcSARYA 1SART转换(); *将初始化/启动代码放在此处(例如MyStimSistAd())*/ /*CyGloalActuable;*//*不注释此行以启用全局中断。*/ (;) { *将您的应用程序代码放在这里。*/ } } 空DMAIN配置() { /DMA1**的变量声明 Unt8DMAY1SKAN; UIT8 8DMAY1YTD〔1〕={ 0 }; /*简化DMA通道*/ DMAY1ZANCH= DMAE11DMANITI化(DMAY1YBYTEXPARYBY突发,DMAY1IQuestESTPARYBY突发, Hi16(DMA11SRCB基),Hi16(DMAE11DSTBASE碱); *分配TD** DMAY1YTD〔0〕=CydMatalLoad(); /*TD配置设置*/ CydMatdSt配置(DMAY1YTD〔0〕,1U,DMAIN VALIDIDYTD,DMAY1YA TdTyMutOUTHEN); *设置源地址和目的地址*/ CydMatdStAdvices(DMAY1TD TD〔0〕,Lo16((UTIN 16)AdcSARYA 1WRK0YPPTR),Lo16((UTIN 16)UARTHARTXDATAZRE RG); /*TD初始化*/ CyDmaChSetInitialTd(DMA1),DMAY1YTD〔0〕; /*启用DMA通道*/ CydMaunTable(DMAY1SK,1U); } 以上来自于百度翻译 以下为原文 Hello, I’m trying to transfer data from ADC-SAR to UART using the DMA. For this I followed the Configuration showed in AN52705, but I’ve got this error: “.main.c: In function 'DMA_Config': .main.c:83:36: error: 'ADC_SAR_1_WRK0_PTR' undeclared (first use in this function)” Could anyone help me? Best regards Hosam Main + DMA configuration: #include /* DMA Configuration constants for DMA_1 */ #define DMA_1_BYTES_PER_BURST (1u) #define DMA_1_REQUEST_PER_BURST (1u) #define DMA_1_SRC_BASE (CYDEV_PERIPH_BASE) #define DMA_1_DST_BASE (CYDEV_PERIPH_BASE) void DMA_Config(void); int main() { ADC_SAR_1_Start(); DMA_Config(); ADC_SAR_1_StartConvert(); /* Place your initialization/startup code here (e.g. MyInst_Start()) */ /* CyGlobalIntEnable; */ /* Uncomment this line to enable global interrupts. */ for(;;) { /* Place your application code here. */ } } void DMA_Config() { /* Variable declarations for DMA_1 */ uint8 DMA_1_Chan; uint8 DMA_1_TD[1] = {0}; /* Iniitialize DMA channel */ DMA_1_Chan = DMA_1_DmaInitialize(DMA_1_BYTES_PER_BURST, DMA_1_REQUEST_PER_BURST, HI16(DMA_1_SRC_BASE), HI16(DMA_1_DST_BASE)); /* Allocate TD */ DMA_1_TD[0] = CyDmaTdAllocate(); /* TD configuration setting */ CyDmaTdSetConfiguration(DMA_1_TD[0], 1u, DMA_INVALID_TD, DMA_1__TD_TERMOUT_EN); /* Set Source and Destination address */ CyDmaTdSetAddress(DMA_1_TD[0], LO16((uint16)ADC_SAR_1_WRK0_PTR), LO16((uint16)UART_TXDATA_REG)); /* TD initialization */ CyDmaChSetInitialTd(DMA_1_Chan, DMA_1_TD[0]); /* Enable the DMA channel */ CyDmaChEnable(DMA_1_Chan, 1u); } |
|
相关推荐
25个回答
|
|
发布完整的项目总是明智的,所以我们都可以查看所有的设置。要做到这一点,使用创建者& GT;文件& GT;创建工作区束(最小)并附加所得到的文件(不要使用Chrome,这仍然可能不起作用)。
可能你已经对你的组件的名字做了一个排版。 鲍勃 以上来自于百度翻译 以下为原文 It is always advisable to post the complete project, so that we all can have a look at all of your settings. To do so, use Creator->File->Create Workspace Bundle (minimal) and attach the resulting file (do NOT use chrome, that still may not work). Probably you have made a typo regarding your Component's name. Bob |
|
|
|
也许数据表是错误的,因为它的表定义与示例Furin在
数据表上有这个打字 结果= CygGETYGRI16(ADCX-SARYA 1SARA WRK0YPPTR); 问候,Dana。 以上来自于百度翻译 以下为原文 Maybe datasheet is in error becuse in its table definition vs example furthere on in datasheet there is this typing - result = CY_GET_REG16( ADC_SAR_1_SAR_WRK0_PTR ); Regards, Dana. |
|
|
|
这是这个项目
AcdSARY1MSP.Cyrj.CaseVo.01.Zip 577.4 K 以上来自于百度翻译 以下为原文 Here is the Project |
|
|
|
谢谢你的提示,它的工作知道:)我刚刚发布了项目之前,我读你的答复
谢谢你,鲍伯 霍萨姆 以上来自于百度翻译 以下为原文 thank you Dana for your hint, its working know :) i just posted the Project before I read your reply thank you Bob too Hosam |
|
|
|
你好,
我又来了, 成功后,我cy8kit-001编制实施项目(PSoC 5lp),不幸的是,我找不到任何数据把UART端口使用DMA的时候。 我测试通信UART发送把ADC数据没有DMA和它的作品。 有人可以看一下,那会很好吗? 最好的问候 霍萨姆 AcdSARY1MSP.Cyrj.CaseVo.02.Zip 571 K 以上来自于百度翻译 以下为原文 Hi, here I’m again, after successful compiling I implemented the Project on CY8KIT-001(PSoC 5LP), unfortunately I couldn’t get any data throw the UART-port when using the DMA. I just tested the communication throw UART by sending the ADC-data without DMA und it works. Could someone take a look at it, that would be nice? Best regards Hosam |
|
|
|
我试图使用这里所描述的DMA向导(第32页),但是UART没有出现在“目标”字段中。也许我必须激活UART才能到达DMA??
以上来自于百度翻译 以下为原文 I tried to use the DMA wizard as described here(Page 32)but the UART didn’t appear in the “Destination” field. Maybe I have to activate the UART to be reached by DMA ?? |
|
|
|
在CydMatdStaseCuffic()中,您指定DMALValueIDyTD作为下一个TD,我认为您应该使用TD(0)来传输多个字节,而不仅仅是一个字节。另外,我将SAR位设置为8。
在UART线上,您最多可以获得10000字节/秒,但SAR提供更多的样本,您必须找到解决该问题的方法。 鲍勃 以上来自于百度翻译 以下为原文 In CyDmaTdSetConfiguration() you specified DMA_INVALID_TD as the next TD, I think you should use the TD[0] to transfer multiple bytes and not only one. Additionally i would set SAR-bits to 8. You will get a maximum of about 10000 bytes/second over the UART line, but the SAR delivers more samples, you must find a solution for that problem. Bob |
|
|
|
谢谢鲍伯,我会在星期一试一试并给出反馈。
实际上,为了在PC上进一步处理,我想把数据传输到400 kSPS。但我认为它不会像我希望的那样工作。因此,我将尝试实现芯片上的数据处理,例如FFT或者可能使用另一个接口。 我是PSOC的初学者,这个项目变得复杂,但仍然很有趣: 霍萨姆 以上来自于百度翻译 以下为原文 Thanks Bob, I’ll try it on Monday and give a feedback Actually, for further processing on a PC I want to transfer the data with up to 400KSps. But I think it’ll not work as I wish. So i’ll try to implement the data processing on chip, eg. FFT or maybe use another interface. I’m a beginner in PSOC and this project becomes complicated but still interesting :) Hosam |
|
|
|
你想申请一个案子来解决这个问题。
SAR。看看论坛,似乎没有人这样做。 并为其他人提供解决方案。 在柏树创建一个技术案例 CyPress网站 “支持” “技术支持” “创造一个案例” 你必须先在赛普拉斯网站上注册。 问候,Dana。 以上来自于百度翻译 以下为原文 You m ight want to file a CASE to solve this using full res of SAR. Looking at forum no one seems to have done this yet. And post back the solution for others. To create a technical case at Cypress - www.cypress.com “Support” “Technical Support” “Create a Case” You have to be registered on Cypress web site first. Regards, Dana. |
|
|
|
你好,
它仍然不起作用… 我能读与示波器的DMA NRQ信号,它与857143hz是ADC,即采样率频率脉冲,样品被写入存储器(登记的UART)但不转移出去。 我在psocdevelopper发现这似乎是一个类似的问题,像我但我不能打开压缩文件。除此之外,你是鲍伯和达纳吗? 当做 霍萨姆 我提起诉讼的“发射率高adc_samples通过UART”很快我会发布/解决方案 AcdSARY1MSP.Cyrj.CaseVo.05.Zip 571.3 K 以上来自于百度翻译 以下为原文 Hi, It still doesn’t work… I could read the nrq-Signal of the DMA with a oscilloscope out, it is pulses with the frequency of 857143Hz which is the Sample rate of the ADC, that means, the samples are written in the memory (register of UART) but not transferred out. I found this on PsocDevelopper, it seems to be a similar problem like mine but somehow I couldn’t open the zip-file. Besides is it you Bob and Dana in this conversation? Regards Hosam Ps. I filed a case about “Transmit High-Rate ADC_Samples through UART” and soon I’ll post the/a solution |
|
|
|
|
|
|
|
也许我应该重读线程,但看看最新发布的
项目- 1)你的ADC设置为1m的SPS,8位,那是8个兆字节/秒或 8兆比特/秒,+一些开销为EOC和读和DMA。 2)您的UART设置为115K位/秒,或14千字节/秒。 总之你是产生更多的数据,UART可以处理。 尝试扭转速率慢,如SAR到74分钟K SPS或使用 触发转换,得到利率下调<;<;UART,和然后看看数据 河流开始有意义了。或平均足够的样本得到速率& lt; UART。 问候,Dana。 以上来自于百度翻译 以下为原文 Maybe I should reread thread, but looking at latest posted project - 1) Your ADC is set for 1M SPS, 8 bits, so thats 8 Mbyte/sec or 8 Mbits/sec, + some overhead for EOC and read and DMA. 2) Your UART is set to 115K bits/sec, or ~ 14 Kbytes/sec. In short you are producing far more data that the UART can handle. Try reversing the rates, eg slow SAR down to its min of 74 K SPS or use a trigger for conversion, to get rate down << UART, and thens ee if data stream starts making sense. Or average enough samples to get rate << UART. Regards, Dana. |
|
|
|
纠正这个问题
1)您的ADC设置为1M SPS,8位,因此是8兆字节/秒或 8兆比特/秒,+一些开销为EOC和读和DMA。 对此- 1)您的ADC设置为1M SPS,8位,因此是1兆字节/秒或 8兆比特/秒,+一些开销为EOC和读和DMA。 以上来自于百度翻译 以下为原文 Correct this - 1) Your ADC is set for 1M SPS, 8 bits, so thats 8 Mbyte/sec or 8 Mbits/sec, + some overhead for EOC and read and DMA. to this - 1) Your ADC is set for 1M SPS, 8 bits, so thats 1 Mbyte/sec or 8 Mbits/sec, + some overhead for EOC and read and DMA. |
|
|
|
Hosam
你有不同的选择,根据你的环境和你的需要: 你可能的样本数据进行短时间高速度,缓冲区中的数据然后发送块在UART。 你可以设置在400khz定时器,设置你的SAR单转换和触发每个转换。在EOC获取并发送结果。该方法能接近核心的availlable MIPS,所以使用DMA将自由需要的一些说明。 鲍勃 以上来自于百度翻译 以下为原文 Hosam, You have different choices based on your environment or your needs: You may sample data with a high rate for a short time, buffer the data and then transmit the chunk over the UART. You may setup a timer at 400kHz, set your SAR for single conversion and trigger each conversion. At eoc get and transmit the result. This method can come near the availlable MIPs of the core, so using DMA will free some of the needed instructions. Bob |
|
|
|
嗨,鲍伯,
这正是我今天所做的。拳头建议 -采样“实际CONV,速率(SPS)=66666 7”,所以我预期66666个7采样/秒。 -使用ADCl SARIRAIRQ缓冲区40个样本UND,然后停止中断 -通过URAT传送它们 PiNi2上的信号是频率为66666 7赫兹的脉冲,到目前为止是很好的,因为我用66666×7采样/s采样。 现在,我如何检查每一个样本都没有丢失它们,换句话说,中断例程与采样率一样快吗? 我这样做了: (66666个7个样本/s)/ 40个样本=16666675个1个/s 如果输入信号的频率为16666675赫兹,40个样本应该代表一个周期,但我得到两个周期-& gt;中断例程与采样率一样快一半。 为什么???? 如何缓冲变量中的高采样率数据? 霍萨姆 PoSosiPrxSythayAdc1.1.Cyrj.CaseVo.01.Zip 567.1 K 以上来自于百度翻译 以下为原文 Hi Bob, That’s exactly what I did today. Fist suggestion - Sampling with “Actual conv, rate (SPS) = 666667”, so I’m expecting 666667 sample/s - Use the ADC_SAR_IRQ the buffer 40 samples und then stop the interrupt - Transfer them via URAT The signal on Pin_2 is pulses with the frequency 666667 Hz, so far so good, cause I’m sampling with 666667 sample/s so now, how could I check, that every sample has been transferred without losing any of them, in other words, dose the interrupt routine as fast as the sample rate? I did this: (666667 sample/s)/ 40 samples = 16666,675 1/s If I had an input signal with frequency of 16666,675 Hz, the 40 samples should represent one period, but instead I get two periods -> the interrupt routine is as half fast as the sample rate Why??? How could I buffer high sample rate data in a variable? Hosam |
|
|
|
因为你所使用的CPU的数据传输到内存就增加ADC的时钟。第一次尝试应该48mhz和ADC的SPS 666666适。
为了获得更多的空间,我建议你去看看(了解到)的DMA。有一个ADC/DMA例子。 鲍勃 以上来自于百度翻译 以下为原文 Since you are using the CPU to transfer the data from ADC to RAM you should increase the CPU clock. First try should be 48MHz and an adaption of the ADC sps to 666666. To get more headroom, I would suggest you to have a look (and get acquainted to) DMA. There is an ADC / DMA example. Bob |
|
|
|
我找不到你的ADC中断例程。一个好的实践就是使用。
CysIrrStudio(),CysISR(),一个连接到EOC和ISRYSTARTEXT()的ISR组件。 前两个被记录在“系统参考GUDE”中,可以从Creator的帮助菜单中找到。 鲍勃 以上来自于百度翻译 以下为原文 I cannot find your interrupt routine for your ADC. A good practice is to use CY_ISR_PROTO(), CY_ISR(), an isr component connected to eoc and isr_StartEx(). The first two are documented in "System Reference Gude" to be found from Creator's Help-menu. Bob |
|
|
|
这是在AdcSARIA.Irq.c中,还附上PIC如何增加CPU时钟?
脉冲宽度调制 27.6 K 以上来自于百度翻译 以下为原文 It is in ADC_SAR_IRQ.c, see also attached pic How could i increase the CPU clock?
|
|
|
|
在工作区中有一个文件浏览器,接近顶部的后缀。cydwr,双
单击然后选择时钟选项卡,然后编辑时钟。 问候,Dana。 以上来自于百度翻译 以下为原文 In workspace explorer, there is a file close to top, suffix *.cydwr, double click that and then pick clocks tab, then edit clock. Regards, Dana. |
|
|
|
只有小组成员才能发言,加入小组>>
752个成员聚集在这个小组
加入小组2069 浏览 1 评论
1824 浏览 1 评论
3633 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
1760 浏览 6 评论
1509 浏览 1 评论
CY8C4025LQI在程序中调用函数,通过示波器观察SCL引脚波形,无法将pin0.4(SCL)下拉是什么原因导致?
507浏览 2评论
CYUSB3065焊接到USB3.0 TYPE-B口的焊接触点就无法使用是什么原因导致的?
357浏览 2评论
CX3连接Camera修改分辨率之后,播放器无法播出camera的画面怎么解决?
410浏览 2评论
357浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
854浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-22 02:21 , Processed in 1.138264 second(s), Total 85, Slave 78 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号