完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
嗨,
我正在使用STEVAL-IHM041V1演示板来开发我自己的应用程序。 mcu 是STM8S103F3P6。我检查了EEPROM位置以验证EEPROM是否读/写 当+ 5V稳定时,它们很好。但是我试图保存最后的数据时遇到问题 断电后设置为EEPROM。 EEPROM写入正在发生 在+ 5V降至3V以下(BOR电压)之前。但它没有用,我没有得到 电路板再次上电后,最后从EEPROM读取保存的数据。为什么?有没有人 遇到类似的问题? 以上来自于谷歌翻译 以下为原文 Hi, I am using the STEVAL-IHM041V1 demo board to develop my own application. The mcu is STM8S103F3P6. I checked the EEPROM locations to verify that the EEPROM read/write are fine when the +5V is stable. But I have problem trying to save the last data settings to EEPROM after the power has been removed. The EEPROM write is happening before the +5V drops below 3V(BOR voltage). But it didn't work and I didn't get the last saved data from EEPROM read once the board is powered up again. Why? Does anyone experience similar problem? |
|
相关推荐
2个回答
|
|
你好,
使用EEPROM时,MCU需要时间来实现写操作。 您可以使用相同的测试进行测试,但在切断电源之前增加50 ms吗? 添加电容以帮助MCU实现操作。 此外,通过在一个部分中写入数据+校验和+时间戳来使用冗余。 例如:对于10字节数据,我使用2个字节作为校验和,4个字节作为时间戳。所以每次保存需要16个字节。我使用EEPROM的64字节部分,我在循环模式下使用了4个以上的位置。我从未丢失过所有数据。 以上来自于谷歌翻译 以下为原文 Hello, When the EEPROM is used, the MCU need time to realize the write. Can you test, with the same test, but adding 50 ms before you cut the power supply ? Add capacitor to help the MCU to realize the operation. Also, use the redundancy by write your data + checksum + timestamp in a section. For example : For 10 bytes data, I use 2 bytes for checksum and 4 bytes for timestamp. So I need 16 bytes for each save. I use 64 bytes section of EEPROM and I have than 4 locations that I used in circular mode. I never lost all my data. |
|
|
|
Sebastien B,
感谢您的回复!我找到了EEPROM读/写问题的原因。编写EEPROM需要比我想象的要长很多,所以我的看门狗会重置cpu。数据表说写4个字节需要6mS,但我的测试表明了这一点 1MHz CPU时钟需要20mS。无论如何,它现在正在运作。谢谢! 山姆 以上来自于谷歌翻译 以下为原文 Sebastien B, Thanks for your reply! I found the cause of my EEPROM Read/Write problem. It takes a lot longer than I think to write the EEPROM so my Watchdog resets the cpu. The datasheet says it takes 6mS to write 4 bytes but my tests showed it takes 20mS at 1MHz CPU clock. Anyway, it is working now. Thanks! Sam |
|
|
|
只有小组成员才能发言,加入小组>>
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
1955 浏览 1 评论
2673 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
1557 浏览 1 评论
3113 浏览 6 评论
5551 浏览 21 评论
532浏览 4评论
944浏览 4评论
在Linux上安装Atollic TRUEStudio的步骤有哪些呢?
349浏览 3评论
使用DMA激活某些外设会以导致外设无法工作的方式生成代码是怎么回事
911浏览 3评论
868浏览 3评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-6-26 14:58 , Processed in 1.323334 second(s), Total 48, Slave 42 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191