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!