完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛扫一扫,分享给好友
|
你好,
我想使用UART用户模块。 我想把4字节的数据从PC发送到PSoC。 PSoC在接收时应该发送2字节的数据回来。 我将使用一个4字节数组的RX缓冲区和2字节数组的TX缓冲区。 当接收到4字节数据时,应该发生中断。 我怎样才能实现它 当做 多石的 以上来自于百度翻译 以下为原文 Hi , I want to use UART user module. I want to send 4 bytes of data from PC to PSOC. PSOC when receive should send 2 bytes of data back. I will use a 4 byte array for rx buffer and 2 byte array for tx buffer. When 4 bytes data is received interrupt should occur. How can i implement it regards Rocky |
|
相关推荐
2个回答
|
|
|
坦白地说,你不能。
由于PSoC 1中的中断与硬件有关,所以可以在每个字符的接收处产生中断。 我建议让输入字符的数量(检索和存储它们)之后,当你的tRESHOLD(或一个预定义的序列)到达时,你设置一个标志(一个全局变量),在你的主循环中检查,如果SET相应地反应(或者只是检查计数)。 快乐编码 鲍勃 以上来自于百度翻译 以下为原文 Frankly : you cannot. An Interrupt can be generated at the receive of EACH character since interrupts in PSoC 1 are related to hardware. I would suggest to have the number of incoming characters counted (after retrieving and storing them) and when your treshold (or a pre-defined sequence) is reached you set a flag (a global variable) that you inspect in your main-loop and, if set react accordingly (or just inspect the count). Happy coding Bob |
|
|
|
|
|
通常使用环形缓冲区,所有数据接收将在环形缓冲区中排队,主回路检查头和尾指针。
如果你知道字节总数是一个固定数,那么只需在接收字节数时进行解码,如果是正确的,然后将字节发送出去。 以上来自于百度翻译 以下为原文 I normally use a ring buffer, all data receive would be queue up in the ring buffer and the main loop inspect the head and tail pointer. if you know the total number of bytes is a fix number, then just do the decoding when the number of bytes received, and if that is correct then send the bytes out. |
|
|
|
|
只有小组成员才能发言,加入小组>>
786个成员聚集在这个小组
加入小组cyUSB3014一直显示2.1,不能到3.0情况,谁遇到过
7088 浏览 0 评论
2474 浏览 1 评论
2166 浏览 1 评论
4031 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
2073 浏览 6 评论
CY8C4025LQI在程序中调用函数,通过示波器观察SCL引脚波形,无法将pin0.4(SCL)下拉是什么原因导致?
7566浏览 2评论
CYUSB3065焊接到USB3.0 TYPE-B口的焊接触点就无法使用是什么原因导致的?
6114浏览 2评论
CX3连接Camera修改分辨率之后,播放器无法播出camera的画面怎么解决?
742浏览 2评论
710浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
7962浏览 2评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-2 05:32 , Processed in 0.492349 second(s), Total 44, Slave 37 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
1337