Let us assume that 12 hour timer is generated through timer interrupt code. The time starts the moment the PIC starts or at some button press. What happens if the uC resets? The time also starts from 0. If you make sure that power to uC will not fail or uC will not reset then you can use software timer.
How many times will he write to eeprom. Once a minute or once every 5 minutes. What will happen to the life of eeprom?.
...In a traffic light system, the bulb or leds are operated in a sequence...
How many times will he write to eeprom. Once a minute or once every 5 minutes. What will happen to the life of eeprom?.
If counter storage during power failure is a design requirement, it makes more sense to use a low cost RTC ( such as 1307 ) to keep counting, instead save last value at EEPROM, once during blackout event, the system will not be able to increment timer anymore.
+++
In a real time situation that is if the system will be use on the road and not student prototype project; make use of external RTC to keep time. When ever the system reset predefine values are reloaded in ram, and not in the eeprom. However, if the system is having an input menu to change time event ( that is programmable traffic type) then eeprom can be use to store time event.
Meanwhile, I have experience in traffic and road system design, and at least two of my design is being used on the road, and a lot of prototype design as well.
...he his only doing a school project...let's guide him to improve in his programming skills...
also suggest if anyone having the better idea for that project
thank you very much sir for your reply
it is good idea to save counter in EEPROM
but how we can know that for how much time the power is not there because that time also required to add to previously stored count
there must some provision that counter should remain on even if power to uC is interpreted
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?