完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我使用的是带有8MHz晶振的SPC560D30L3。初始化设置如下,
1. IDF = 1 2. NDIV = 48 3. ODF = ODF_DIV8 我已将串行配置为38400波特,缓冲区为16个字节。我试图从PC发送一个7字节的帧(使用超级终端或类似的终端实用程序)。我观察到的是我只接收7个中的2个字节 - 第一个和最后一个,在字节之间丢失。问题是什么?是否缺少任何设置? 收到的两个字节是正确的,因此我对波特率设置毫无疑问。我对么?我尝试了不同的波特设置,但观察结果相同。可能是什么问题呢? 通过选择配置 - >标识 - >电路板标识符和电路板名称为“SPC56D_DISCOVERY”和“STMicroelectronics SPC56D Discovery”与“通用SPC56D电路板”的值相比,配置是否存在差异?我观察到两种设置的默认时钟设置不同。第一个提供XOSC时钟为16MHz,通用提供为8MHz。是否有任何配置更改?为什么会这样? 您在这方面的最早帮助将受到高度赞赏。提前致谢。 麦克风。 以上来自于谷歌翻译 以下为原文 I am using SPC560D30L3 with 8MHz crystal. The initialisation settings are as below, 1. IDF = 1 2. NDIV = 48 3. ODF = ODF_DIV8 I have configured the serial for 38400 baud with buffer for 16 bytes. I am trying to send a frame of 7 bytes from PC (using hyperterminal or similar terminal utility). What I have observed is I am receiving only 2 bytes out of 7 - the first and last, in between bytes are lost. What is the problem? Are any setting missing? The two bytes received are correct, hence I have little doubt for baud setting. Am I correct? I tried different baud settings but same observations. What could be the problem? Is there any difference in configuration by selecting the Configuration->Identification->Board Identifier and Board Name as 'SPC56D_DISCOVERY' and 'STMicroelectronics SPC56D Discovery' as against the value 'generic SPC56D board'? I have observed that default clock settings differ between the two settings. First one gives XOSC clock as 16MHz and generic gives as 8MHz. Are there any configuration changes? Why these are so? Your earliest help in this regard will be highly appreciated. Thanks in advance. Mike. |
|
相关推荐
6个回答
|
|
你好迈克,
ST网站不提供Minimodule(D系列) 它是一个主板+一个Minimodule +设备(在这种情况下为D)。 与发现板相比价格不一样。 发现板的默认配置为16MHz(DISCOVERY) 关于你的问题,也许最好的事情是通过char扫描字符char chnReadTimeout(& SD1,& car,1,TIME_INFINITE); 你能举个例子说明你的申请吗? 我们将努力找到根本原因。 最好的祝福 二万 以上来自于谷歌翻译 以下为原文 Hello Mike , Minimodule (D Family) is not provided in ST Web site it is a motherboard + a Minimodule + the device (D in this case). not the same price comparing to a discovery board. the default configuration for a discovery board is 16MHz (DISCOVERY) About your issue , maybe the best thing is to scan the character char by char chnReadTimeout(&SD1, &car, 1, TIME_INFINITE); Could you give me an example of your application ? We will try to find the root cause. Best Regards Erwan |
|
|
|
你好迈克,
1-该函数将数据从通道读入缓冲区。如果数据不可用,则调用线程被挂起。 对于TIME_INFINITE选项,您需要创建一种检测损坏帧的方法。 2-它是数据中止吗? 你试过sdp-> linflexp-> UARTSR.R = SPC5_UARTSR_RMB? 你有一个你的申请的例子吗? 3-时间是超时前的滴答数 * @param [in] time操作超时前的滴答数, *允许以下特殊值: * - @a TIME_IMMEDIATE立即超时。 * - @a TIME_INFINITE没有超时。 最好的祝福 二万 以上来自于谷歌翻译 以下为原文 Hello Mike , 1- The function reads data from a channel into a buffer. If the data is not available then the calling thread is suspended. For the option TIME_INFINITE , you need to create a way to detect a broken frame. 2- Is it a Data Abort ? Did you try sdp->linflexp->UARTSR.R = SPC5_UARTSR_RMB ? Have you got an example of your application ? 3- Time is the number of ticks before the timeout * @param[in] time the number of ticks before the operation timeouts, * the following special values are allowed: * - @a TIME_IMMEDIATE immediate timeout. * - @a TIME_INFINITE no timeout. Best Regards Erwan |
|
|
|
你好,Erwan,
1. SPC5_UARTSR_RMB看起来工作正常。它与DRF一起设置但未收到帧。可能是什么原因? 2.我尝试将read API用于单字节,仅当我收到SOF时,我使用for循环来读取没有字节(这里是7个字节),每次读取单个字节。但这也表现出相同的行为。 我尝试将延迟从100减少到25(波特是38400)。它看起来主循环延迟,它的工作原理,但当我只是删除延迟时,我收到完整的帧,但错误的值。它与高波特率值有关吗? 你说只有两个值允许API的'time'参数。如何使用已知时间的自定义值? 谢谢你的帮助。 麦克风。 以上来自于谷歌翻译 以下为原文 Hello Erwan, 1. The SPC5_UARTSR_RMB looks to be working correct. It is getting set along with DRF but the frame is not received. What could be the reason? 2. I tried using read API for single byte as well, only thing when I receive SOF, I used a for loop for no of bytes to read (here 7 bytes), each time reading single byte. But this also shows same behaviour. 3. I tried reducing the delay from 100 to 25 (baud is 38400). It looks that with delay in main loop, it works but when I simply remove the delay I receive complete frame but with wrong values. Is it related to high baud rate value? 4. You said only two values allowed for 'time' parameter for API. How about using a custom value of known time? Thanks for your help. Mike. |
|
|
|
你好,
我正在等待对上述查询的回复。请回复。 我看到来自SPC5Studio的少量库文件出现以下错误。对于串行通信的上述观察是否是因为这些错误? 符号'bool'无法解析serial.c / ECU / components / portable_spc5_hal_component / lib / src第204行语义错误 符号'NULL'无法解析serial.c / ECU / components / portable_spc5_hal_component / lib / src第149行语义错误 类型'size_t'无法解析serial.c / ECU / components / portable_spc5_hal_component / lib / src第50行语义错误 在此先感谢您的帮助。 麦克风。 以上来自于谷歌翻译 以下为原文 Hello, I am waiting for replies to above queries. Please respond. I am seeing following errors for few library files from SPC5Studio. Whether above observations for serial communication is because of these errors? Symbol 'bool' could not be resolved serial.c /ECU/components/portable_spc5_hal_component/lib/src line 204 Semantic Error Symbol 'NULL' could not be resolved serial.c /ECU/components/portable_spc5_hal_component/lib/src line 149 Semantic Error Type 'size_t' could not be resolved serial.c /ECU/components/portable_spc5_hal_component/lib/src line 50 Semantic Error Thanks in advance for your help. Mike. |
|
|
|
你好迈克,
您使用的是哪个版本的SPC5Studio? Os-Less或Chibios? 动态调试很困难。 我会为你建造一个原型。 1)你能给我一个代码示例吗? 如果是私人的,您可以通过我的私人电子邮件地址发送给我。 2)3)你能尝试通过char恢复char吗? ............ 38400不是高利率值。 4) 您可以在API中自定义您的价值。时间是超时前的滴答数。 最好的祝福 二万 以上来自于谷歌翻译 以下为原文 Hello Mike , which version of SPC5Studio do you use ? Os-Less or Chibios ? It is difficult to debug on the fly. i will build a prototype for you. 1) could you send me an example of your code ? if it is private you can send me on my private email address. 2) 3) Could you try to recover char by char ?
............
38400 is not a high rate value. 4) you can customize your value in the API. Time is the number of ticks before the timeout. Best regards Erwan |
|
|
|
抱歉耽搁了 ;-)
这是CDT问题,您应该在CDT环境中包含include目录hightec gcc。 我们有一个更改请求,可以自动将此包含添加到默认环境中 最好的祝福 二万 以上来自于谷歌翻译 以下为原文 Sorry for the delay ;-) it is CDT Issue , you should include the include directories hightec gcc in your CDT Environment. We have a change request to add automatically this inclusion in the default environment Best regards Erwan |
|
|
|
只有小组成员才能发言,加入小组>>
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
2646 浏览 1 评论
3209 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
1784 浏览 1 评论
3613 浏览 6 评论
5991 浏览 21 评论
940浏览 4评论
1317浏览 4评论
在Linux上安装Atollic TRUEStudio的步骤有哪些呢?
585浏览 3评论
使用DMA激活某些外设会以导致外设无法工作的方式生成代码是怎么回事
1304浏览 3评论
1362浏览 3评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-26 14:09 , Processed in 1.263725 second(s), Total 89, Slave 72 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号