完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
你好,
我有一个问题是stm8L051F3是否可以执行/计算浮动操作, 请帮忙告诉我, 目前我无法用printf函数检查它,因为如果使用带有工具选项的库, 我的大小超过错误, 例子: float devided_Voltage = 0; float high_Voltage = 0; devided_Voltage =(float)(rawADValue / ADC_MAX_RESOLUtiON * ADC_MAX_INPUT); high_Voltage =(devided_Voltage *(RESISTER_R8 + RESISTER_R9))/ RESISTER_R9;谢谢。 #stm8l051f3 以上来自于谷歌翻译 以下为原文 Hello, I have a question as to whether stm8L051F3 can do/calculate the floating operation or not, please help to let me know it, currently I can't check it with printf function, because if using the library with tool option, I got the size over error, example : float devided_Voltage = 0; float high_Voltage = 0; devided_Voltage = (float)(rawADValue / ADC_MAX_RESOLUTION * ADC_MAX_INPUT); high_Voltage = (devided_Voltage * (RESISTER_R8 + RESISTER_R9)) / RESISTER_R9;thanks. #stm8l051f3 |
|
相关推荐
5个回答
|
|
我有一个问题是,是否可以做/计算浮动操作,...
那是什么 ? 还没有ST STM8william hill官网 吗? 从内存来看,我认为没有STM8有FPU,所以你需要使用浮点仿真。这需要一个合适的库,通常意味着几千字节。 以上来自于谷歌翻译 以下为原文 I have a question as to whether can do/calculate the floating operation or not, ... What is that ? Doesn't have ST a STM8 forum anymore ? From memory, I think no STM8 has a FPU, so you would need to use floating point emulation. That requires an appropriate library, and usually means a few kilobytes more. |
|
|
|
大多数微控制器都可以在软件中做浮点运算,甚至是40年前的8位微控制器。
如果空间不足,则库可能超出设备中的程序空间。使用更大的设备,或考虑使用其他方法,如定点和缩放。 也许系统支持ftoa() http://www.ars-informatica.ca/eclectic/ftoa-convert-a-floating-point-number-to-a-character-array-on-the-arduino/ 或者您可以缩放到整数并打印 float f = 12.345f; int i =(int)(f * 1000.0f); printf('%d。%03d n',i / 1000,i%1000); //为正值 以上来自于谷歌翻译 以下为原文 Most micro-controllers can do floating point in software, even the 8-bit ones from 40 year ago. If it runs out of space then likely the library exceeds the program space in your device. Use a bigger device, or consider using other methods, like fixed point and scaling. Perhaps the system supports ftoa() http://www.ars-informatica.ca/eclectic/ftoa-convert-a-floating-point-number-to-a-character-array-on-the-arduino/ Or you can scale to an integer and print float f = 12.345f; int i = (int)(f * 1000.0f); printf('%d.%03dn', i/1000, i%1000); // for positive values |
|
|
|
您好,AvaTar,
感谢快速回复, 我需要更多关于您的意见的信息,请帮助我告诉我并使用我的项目, 1.如何在库中使用浮点仿真?也许需要通过详细的例子来了解程序, 能否请您详细提供相关信息? 我正在使用IAR嵌入式工作台进行编译, 感谢你的支持, 谢谢。 以上来自于谷歌翻译 以下为原文 Hello, AvaTar, thankful for rapid reply, I need more information as to your opinion, please help to let me know it and to use for my project, 1. how can I use floating point emulation with library ? maybe need to know the procedure with detailed example, Could you please kindly help to provide the information in detail ? I am using IAR embedded workbench for compile, thankful for your support in advance, thanks. |
|
|
|
我需要更多关于您的意见的信息,请帮助我告诉我并用于我的项目,......
我想我无法帮助你,我不使用STM8,也没有STM8设备的IDE。 或者你使用另一个MCU,并错误拼写它的名字? 对于IAR,我会参考相当广泛的程序帮助/文档。 以上来自于谷歌翻译 以下为原文 I need more information as to your opinion, please help to let me know it and to use for my project, ... I think I can't help you, I don't work with the STM8, nor do I have an IDE for STM8 devices. Or do you use another MCU, and mis-spelled it's name ? For IAR, I would consult the quite extensive program help / documentation. |
|
|
|
STM8的所有编译器都带有软件浮点实现。它们都支持C float数据类型,但它们都不支持double或long double(参见
http://www.colecovision.eu/stm8/compilers.shtml ).IAR往往是标准合规性和实现完整性的更好的编译器之一,所以你不应该在功能上遇到任何问题。在优化速度时,IAR还具有最快的浮点实现(即获得比当前Cosmic,Raisonance或SDCC更高的Whetstone分数,再次看到 http://www.colecovision.eu/stm8/compilers.shtml ).Philipp 以上来自于谷歌翻译 以下为原文 All compilers for the STM8 come with a software floating-point implementation. They all support the C float datatype, but none of them support double or long double (see http://www.colecovision.eu/stm8/compilers.shtml ).IAR tends to be one of the better compilers when it comes to standard compliance and completeness of the implementation, so you shouldn't run into any problems functionality-wise. When optimizing for speed, IAR also has the fastest floating-point implementation (i.e. achieves higher Whetstone scores than current Cosmic, Raisonance or SDCC, see again http://www.colecovision.eu/stm8/compilers.shtml ).Philipp |
|
|
|
只有小组成员才能发言,加入小组>>
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
2807 浏览 1 评论
3259 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
1833 浏览 1 评论
3684 浏览 6 评论
6083 浏览 21 评论
对H747I-DISCO写程序时将CN2的st-link复用为usart1,再次烧录时无法检测到stlink怎么解决?
386浏览 2评论
STM32G474RE芯片只是串口发个数据就发烫严重是怎么回事?
477浏览 2评论
STM32处理增量式编码器Z信号如何判断中断是正转的还是反向转的?
307浏览 2评论
使用STM32F407VET6的USB2.0功能,发现ctl后芯片无数据返回,是什么原因可能导致的呢?
226浏览 2评论
用STM32G431开发工程,1.50版本的Package包文件无法输出项目工程
329浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-1-28 06:59 , Processed in 1.395741 second(s), Total 83, Slave 67 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (威廉希尔官方网站 图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号