完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
嗨,大家好,
我来自PIC的背景,我刚刚开始尝试与皮质M3和PSoC的部分工作。我一直在试图弄清楚如何获得一个8位变量的值到8个I/O引脚。我在“PSoC5架构”标题为“ADC输出寄存器到组件引脚”,但它没有深入到足以让我理解它(触发ISR)??用EMIF吗??)此外,我还看到了很多例子,说明如何将一个位值移到端口引脚,而不是如何移动一个字节宽的值。 有人能告诉我,在下面的代码片段中,我需要哪些代码来将ADC输出值发送到部分的物理引脚? 包括: 设备; 无效 { AdcDeligy11StiX(); ()uTIN ADCJOUT;/*启动ADC转换*/ADCJ-DELSIGLY1SART转换(); { { ADCJOUT=ADCJI DELSIGLY1GETRESULT8(); 对于(;;)如果(ADCJ-Delsig1IsIsEnto皈ic(ADCJ-DelsiGy11ReTurnStIftStand))/ /什么来这里获得端口引脚的值?? } } } /*文件结束* 我知道这可能很简单,我会拍拍自己的额头说:“呸!!就像Homer Simpson,当我看到它是怎么做的,但现在我被卡住了!^) 谢谢大家的帮助!! 爱立信 以上来自于百度翻译 以下为原文 Hi All, I come from a PIC background and am just now starting to try and work with Cortex M3 and PSOC parts. I have been trying to figure out how to get the value of an 8 bit variable to 8 I/O pins. I read the post in "PSOC5 Architecture" titled "ADC output register to component pins", but it didn't go into depth enough for me to understand it (trigger an ISR??, use EMIF??). Also I've seen plenty of examples of how to move one bit values to a port pin, but not how to move a byte wide value. Could someone please tell me what lines of code I would need in the following code snippet to send the ADC output value to physical pins on the part? #include void { ADC_DelSig_1_Start(); main() uint8 ADC_Out; /* Start the ADC conversion */ ADC_DelSig_1_StartConvert(); { { ADC_Out = ADC_DelSig_1_GetResult8(); for (;;) if (ADC_DelSig_1_IsEndConversion(ADC_DelSig_1_RETURN_STATUS)) // What goes here to get value to port pins?? } } } /* END OF FILE */ I know this is probably really simple and that I'll be slapping myself in the forehead saying "DOH!!!" like Homer Simpson when I see how it's done, but right now I'm stuck! :^) Thanks for any and all help!! EricM |
|
相关推荐
4个回答
|
|
|
欢迎来到PSOCS的迷人世界!
有几种将8位值发送到端口引脚的方法,虽然这是“PIC思维”,而不是“PSoC思维”。 在PSoC世界你通常使用的通信接口和其他设备,你可以看到并行接口不在PC世界的一对夫妇的原因。 使用控制登记模块,连接到引脚给你最好的控制甚至能够DMA将释放CPU。 得到的ADC值和设置控制登记是最简单的方法。 在“系统参考指南”(帮助>;系统参考)你可以得到的信息,如何设置一个完成端口。 啊,顺便说一下,PSoC4有一个臂M0,而不是M3。 和:使用函数”创建工作捆绑”你可以把一个完整的项目在这里,所以我们可以看看。 鲍勃 以上来自于百度翻译 以下为原文 Welcome in the fascinating world of PSoCs! There are several methods for sending an 8-bit value to port-pins, although this is "PIC-thinking" and not "PSoC thinking". In PSoC world you usually use a communication interface to talk to another device, as you can see the parallel interface disapeared from the PC-world for a couple of reasons. Using a control register module that is connected to the pins gives you the best control and even is capable of DMA which would free the CPU. Getting the ADC-value and setting the control-register is the easiest way. In the "System Reference Guide" (Help -> System Reference) you can get informations on how to set a complete port. Ah, and by the way: The PSoC4 has got an ARM m0, not m3. And: using the function "Create workspace Bundle" you can attach a complete project here, so that we all can have a look at. Bob |
|
|
|
|
|
该AP注释讨论了GPIO,从引脚创建逻辑端口,并写入。
对他们来说。 HTTP://www. CyPress?COM/?RID=57571 AN723 正如你在PSoC 4论坛上发布的,但是呼叫PSoC 5。如果你 打算使用PSoC 4,其中没有Delsig,只有SAR。但是你可以 SAR也一样。 最后,可以使用DMA(带有DMA向导)在后台传输此数据。 W/O干预。在CREATOR中有一些示例项目来实现这一点。 问候,Dana。 以上来自于百度翻译 以下为原文 This ap note discusses GPIO, creating logical ports out of pins, and writing to them. http://www.cypress.com/?rID=57571 AN72383 Just as an aside you posted in PSOC 4 forum, but called out PSOC 5. If you are intending to use PSOC 4 there is no DelSig in it, only a SAR. But you can do the same with the SAR. Lastly you can use DMA (with DMA wizard) to transfer this data in the background w/o intervention. There are example projects in Craetor to do this. Regards, Dana. |
|
|
|
|
|
谢谢鲍伯和丹娜这么快就回到我身边。我知道我把PSoC4和PSoC5部分混合在我原来的帖子里。这只是一个快速的测试,因为我刚刚开始。最初,我启动了基于PSoC5的项目,我现在把它转移到PSoC4,因为我刚刚得到了一个先驱板。
虽然你们提到的大多数参考资料似乎都在谈论单针I/O,但是使用寄存器的方法似乎是有效的。显然,我还有很多需要学习的地方。 再次感谢你的帮助!!!! 爱立信 以上来自于百度翻译 以下为原文 Thanks Bob and Dana for getting back to me so quickly. I was aware of the fact I'm mixing PSOC4 and PSOC5 parts in my original post. This was just a quickly thrown together test since I'm just starting. Initially I started the project based on the PSOC5 and I'm now moving it to the PSOC4 since I just got a Pioneer board to play with. Although most of the reference material you both mentioned only seems to talk about single pin I/O, the approach of using a register seems to work. Clearly though, I have a LOT to learn. Thanks again for your help!!! EricM |
|
|
|
|
|
埃里克,我特别张贴的AP笔记有逻辑端口创建
您选择的宽度,以及API /寄存器声明要写入它。 问候,Dana。 以上来自于百度翻译 以下为原文 Eric, the ap note I posted specifically has logical port creation of width you choose, and APIs / register declarations to write to it. Regards, Dana. |
|
|
|
|
只有小组成员才能发言,加入小组>>
786个成员聚集在这个小组
加入小组cyUSB3014一直显示2.1,不能到3.0情况,谁遇到过
7241 浏览 0 评论
2482 浏览 1 评论
2175 浏览 1 评论
4037 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
2082 浏览 6 评论
CY8C4025LQI在程序中调用函数,通过示波器观察SCL引脚波形,无法将pin0.4(SCL)下拉是什么原因导致?
7725浏览 2评论
CYUSB3065焊接到USB3.0 TYPE-B口的焊接触点就无法使用是什么原因导致的?
6283浏览 2评论
CX3连接Camera修改分辨率之后,播放器无法播出camera的画面怎么解决?
751浏览 2评论
725浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
8119浏览 2评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-8 23:20 , Processed in 1.401770 second(s), Total 79, Slave 62 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
465