完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
设备:16F1824xC8:V1.45 xC8用户指南(DS5000 02053H)在程序空间中的5.5.3变量:放置在程序存储器中的唯一变量是那些不是自动的并且已经合格的const。也就是说,静态变量和全局变量被放置在程序存储器中。如果是这样,PIC是否能够在运行时改变程序存储器的值?如果不是,我猜想全局和静态变量在整个运行期间都是不变的,它们被放置在程序存储器中,否则,在RAM中。
以上来自于百度翻译 以下为原文 device: 16F1824 XC8: v1.45 XC8 user guide(DS50002053H) in 5.5.3 Variable in Program Space: The only variables that are placed into program memory are those that are not auto and which have been qualified const. That is, the static and global variables are placed in program memory? If so, is it possible that PIC is able to change the value of Program memory in run-time? If it's not, my guess is that global and static variables which are unchanged during whole run-time duration are placed in Program memory, otherwise, in RAM. I just want to be ensured, thank you. |
|
相关推荐
2个回答
|
|
“哪些是合格的const”const char MySimple=42;
以上来自于百度翻译 以下为原文 "Which have been qualified const" const char MyConstant = 42; |
|
|
|
也就是说,静态变量和全局变量被放置在程序存储器中?你完全忽略了“合格的const”子句。没有(它可以通过EEPROM访问寄存器,但是它必须一次擦除32个字节的块,所以它不能用它来更新变量而不需要大量的开销),除非你告诉它,通过“const”限定符。
以上来自于百度翻译 以下为原文 That is, the static and global variables are placed in program memory? You totally ignored the "and which have been qualified const." clause. No (Well it can, via the EEPROM access registers, but it has to erase blocks of 32 bytes at a time, so it can't use this to update variables without a hell of a lot of overhead) Only if you tell it, via the "const" qualifier. |
|
|
|
只有小组成员才能发言,加入小组>>
5238 浏览 9 评论
2028 浏览 8 评论
1950 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3204 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2253 浏览 5 评论
776浏览 1评论
665浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
594浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
675浏览 0评论
575浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-22 23:39 , Processed in 1.218502 second(s), Total 79, Slave 62 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号