通过 picscope SDK 进行 UART 解码
我正在使用picscope API对picscope 2205a进行编程,并且需要解码标准UART协议,但我在picscope SDK(ps2000aApi.h)中找不到任何用于解码UART帧的API。 picscope API 函数仅提供设置示波器和捕获数据的功能。 有没有办法实现UART解码? 谢谢你,
I'm working to use picoscope APIs for programming picoscope 2205a, and I need to decode standard UART protocol, but I couldn't find any API in picoscope SDK (ps2000aApi.h) for decoding UART frame.
picoscope API functions only provide the capability of setting up the scope and capturing data.
is there a way for UART decoding?
Thank you,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这里首先要提到的是,PicoScope 软件应用程序已经支持 UART 解码(这包括将 UART 帧的解码表导出到 csv 文件中),因此我建议检查这是否满足您的任何要求。即,您的应用程序采用包含 UART 帧序列的 csv 作为输入是否足够,或者是否需要实时解码?
有关 PicoScope 软件支持 UART 解码的更多信息,请参阅此处:https ://www.picotech.com/library/oscillscopes/rs-232-serial-protocol-decoding
您正在谈论的事实使用 SDK 编写自己的应用程序让我认为这还不够,但值得覆盖这个基础。
第二点是,PicoScope API 提供了用于设置捕获配置(即采样数、垂直范围、电压转换触发等)的挂钩,但目前不提供用于设置解码配置或访问解码帧的挂钩。
这最终意味着您必须在应用程序中使用自己的 UART 解码功能。为此,您需要:
从设备中提取模拟采样数据。有全面的在线帮助(在 PicoScope 网站和论坛上)可以指导您完成此过程。如果您使用 2205A,本 PicoScope 2000 程序员指南是一个良好的开始: https://www.picotech.com/download/manuals/picscope-2000-series-programmers-guide.pdf。
一旦获得了模拟采样数据,您最终就会希望以给定的比特率将信号转换为比特模式。这里有一个关于如何将 UART 信号分解为各个组成部分的好资源:https:// electronics.stackexchange.com/a/501854
希望有帮助!
The first thing to mention here is that the PicoScope software application already comes with support for UART decoding (this includes exporting a decoded table of UART frames into a csv file) so I recommend checking if this fulfils any of your requirements. i.e. would it be adequate for your application to take a csv containing a sequence of UART frames as an input or does it need to decode in real time?
See here for more information on PicoScope's software support of UART decoding: https://www.picotech.com/library/oscilloscopes/rs-232-serial-protocol-decoding
The fact that you are talking about writing your own application using the SDK leads me to presume that it's not adequate but it's worth covering that base.
The second point to make is that the PicoScope API provides hooks to setup a capturing configuration (i.e. samples/s, vertical ranges, triggering on voltage transitions etc) but it doesn't currently provide hooks to set decoding configurations or access decoded frames.
This ultimately means you will have to roll your own UART decoding functionality within your application. In order to do this you will need to:
Pull analog sampled data off the device. There is comprehensive help online (on the PicoScope website and forums) in order to guide you through this process. This PicoScope 2000 programmer's guide is a good start if you are using the 2205A: https://www.picotech.com/download/manuals/picoscope-2000-series-programmers-guide.pdf.
Once you have the analog sampled data you are then ultimately looking to convert a bit pattern from the signal at a given bit rate. Here's a good resource on how a UART signal is broken down into it's constituent parts: https://electronics.stackexchange.com/a/501854
Hope that helps!