Info
此问题已关闭。 请重新打开它进行编辑或回答。
Automotive problem - Counting and saving
2 次查看(过去 30 天)
显示 更早的评论
Hi Everyone,
Back Ground: Currently working on a project, the goal is to control an automotive roof with state flow. As state flow allows for the use of simulink and matlab functions it can be very useful.
Before the roof can run its normal program it must initialise, this state allows for the counting of the steps to determine the size of the roof. The signals for the counting are provided by the hall sensor. The counting blocks have already been made, the counts however must be saved in the EEPROM.
Problem: Every time the subsystems counts, a value is written to the EEPROM. It is widely known the writing to an EEPROM must be limited. in this situation. 10 total counts equals to 10 x writing in the EEPROM.
Goal: I need to save the final value. Say i have 65 counts, I need to save the number 65 in the EEPROM and not 1,2,3,4,5...64, and finally overwrite all of those values with 65. I tried delays, and several array blocks but can't get it too work. Any ideas?
0 个评论
回答(1 个)
Torsten Knodt
2016-9-9
This depends on your interface to write to the EEPROM. Normally you would count in your RAM and trigger writing to the EEPROM in a final state. If you have no final state, you could introduce one which is activated based on a counting timeout. Keep in mind that EEPROMs are organized in blocks. The block with this variable could contain also other data. Usually it makes more sense to coordinate writing back values to EEPROM with other software components or writing them back e.g. before power loss. Also you should have backup blocks for the case you loose power during erasing or writing the EEPROM block. To my knowledge this is often done in the OS.
0 个评论
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!