This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] CCS/TMS320F28377D:sprintf 需要良好的转换速度、并且速度非常慢

Guru**** 2487425 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/tools/code-composer-studio-group/ccs/f/code-composer-studio-forum/814927/ccs-tms320f28377d-sprintf-takes-for-good-to-convert-and-is-very-slow

器件型号:TMS320F28377D

工具/软件:Code Composer Studio

我使用 TMS320F28377驱动200MHz 频率下的电路。 我以20KHz 的中断频率控制电路,每50 u 秒 这意味着我有10、000个循环时间来做每件事。 我尝试在每次控制时通过 SCI 传输数据。 但是,sprintf()似乎需要很长时间才能使我的数据准备好传输。 我是否有任何方法可以更快地使用某些东西?   我每次都需要发送5个浮点数据。  

我的代码是:

sprintf (msg、"%4.1f、%4.1f、%.5F、%.3f、%6F、\n\r\n "、P_f、Q_f、Delta、V_abs、t_count);
scia_msg (msg);

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    遗憾的是、sprintf 是 TI 唯一的解决方案。  考虑在互联网上搜索浮 点到不带 sprintf 的 c 中的字符串

    谢谢、此致、

    乔治

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    谢谢你、George

    Sepehr