Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
05/03/05 06:27
Read: times


 
#92770 - ideas
Responding to: ???'s previous message
hi,

Jacek Bogusz said:
POWER FAIL causes interrupt which places the microcontroller into POWER DOWN mode. And it is working excellent, but... When 5V falls down (below approx.4.5V) TL7705 is generating RESET signal, which dissappears when voltage (5V line) is below 2.6V,

First of all, use TL7705b which has defined reset level for Vcc > 1V.


and the microcontroller powered from the battery, runs its application code from beginning.

Well, then just check the reset conditions. I mean that you should determine two cases: reset-after-power_on or reset_after_power_off. In the first case you should start your application; at the second case - just go sleep. Now about how to determine the cases.
I would do next way: when Power_fail signal comes on and MCU goes to Power_fail interrupt then just fill defined memory locations with some sequence, let say, four bytes 0x55, 0xAA, 0xCC, 0x33. Then enter power-down mode.
Now after reset, your program starts and check for this sequence. If the sequence is found then it means that this is reset_after_power_off case (MCU is powered with battery). Just clear the sequence with 0x00 and go to Power Down mode.
Another case: your code starts and does not find defined sequence. Then it means that this is reset-after-power_on case. So start your main application.

Some notes.

I strongly suggest to use MCU which has hardware flag called POF. Power-off flag helps you to check battery valid voltage range during power-down mode. The problem is that in power-down mode MCU keeps its RAM contents as long as Vcc is not below defined level. For example, Atmel says it is about 2V. If voltage comes below defined value then RAM contents is not defined any more. Most derivatives has POF which is set each time when Vcc is below min. required value.
It may be used next way: clear this flag before enter power-down mode. Check this flag after each reset. If the flag is set then it means that RAM content may not be considered as valid any more and you need with its initialization.

I suggest you to use other ways to keep your variables. Let say, there are many non-volatile solutions now. For example, if you do not need with many write cycles then it may be used either MCU with built-in EEPROM (like AT89S8252,8253 etc) or an external EEPROM. If you need with mach more write cycles then I would suggest something like serial FRAM, see here: http://www.ramtron.com/doc/Products/serial.asp
In both cases, you should check that 300 ms is enough time to save some data into non-volatile storage.

Regards,
Oleg

List of 24 messages in thread
TopicAuthorDate
Troubles in POWER DOWN mode            01/01/70 00:00      
   what's exactly the problem?            01/01/70 00:00      
      the problem...            01/01/70 00:00      
         that's bad...            01/01/70 00:00      
            you are right...            01/01/70 00:00      
               the problem            01/01/70 00:00      
                  A possible solution?            01/01/70 00:00      
                     on chip permanent storage            01/01/70 00:00      
                     caveat            01/01/70 00:00      
                        no caveat when done right            01/01/70 00:00      
                           79 ?            01/01/70 00:00      
                              oh well            01/01/70 00:00      
                           caveat            01/01/70 00:00      
                              non-caveats            01/01/70 00:00      
                  "1" when v.supervisor is not powered            01/01/70 00:00      
                     use open pin            01/01/70 00:00      
   ideas            01/01/70 00:00      
      your idea...            01/01/70 00:00      
         it seems to me,it is working...            01/01/70 00:00      
            please do not            01/01/70 00:00      
   I had an idea...            01/01/70 00:00      
      i tried this...            01/01/70 00:00      
         wow that's bad            01/01/70 00:00      
            i tried this...            01/01/70 00:00      

Back to Subject List