0
\$\begingroup\$

I got my firmware running on a MSP430FR596 and I want to add a condition on the FW (how long the FW has been running, or how many certain interrupts it has received) that if satisfied, the whole system should shut down without erasing the main memory.

The MCU is directly connected to the battery and disconneting it is not an option.

What is best to do here? Should I disable interrupt? Or there are better ways?

\$\endgroup\$
3
  • 2
    \$\begingroup\$ Disable interrupts, disable all possible clocks and go into a sleep mode. \$\endgroup\$ – filo Aug 4 '17 at 10:26
  • 3
    \$\begingroup\$ Should it ever wake up again? \$\endgroup\$ – CL. Aug 4 '17 at 11:09
  • \$\begingroup\$ @CL. yes, but under some special circumstances, for example after the battery is changed, by someone who can access it through RX, TX, SBWTDIO, SBWTCK, and such \$\endgroup\$ – Sina Aug 7 '17 at 7:57
4
\$\begingroup\$

You need to carefully think about two things: 'entering the off condition' and 'exiting from the off condition'.

The MSP430 family is famous for its versatile operating modes. And the Low Power Modes LPM3.5 or LPM4.5 are your friends. In these modes all clocks are off, CPU is off, so the whole MCU is almost literally off. In LPM4.5 you have current consumption 20nA!

Before you enter the LPM3.5 or LPM4.5 you should finish everything: disable interrupts, save all the necessary and sensitive information from RAM to FRAM (as RAM is not retained), and decide about the way you will wake your MCU in future (if needed at all). Typically it's done by I/O interrupt (and it will be your only enabled interrupt).

For more info:

  1. msp430fr5969 (SLAS704F) datasheet, especially chapter 6.3 "Operating Modes"
  2. MSP430FR58xx, MSP430FR59xx, and MSP430FR6xx Family User's Guide (SLAU367N), especially 1.4 "Operating Modes", but better to read the whole chapter 1 as it contains critical system information.
\$\endgroup\$
2
  • 1
    \$\begingroup\$ ...good choice in uC, as @GAttuso mentioned, the MSP series has a well designed sleep mode. And since you have the fram version, you need not concern yourself with write endurance to the non-volatile fram memory. I have used a similar chip, in a similar application, and was very pleased. If you want it to be completely off (and require a user to push a button to turn it back on), then investigate push-button power controller chips. Though getting any support circuitry to stay under 100nA can be tricky (and not require a electromechanical relay). \$\endgroup\$ – Chris Knudsen Aug 4 '17 at 15:30
  • \$\begingroup\$ Thanks for the detailed answer, since I cannot change the circuit much (and implement relays...) I guess this is my option. Can you also direct me to some resources on I/O interrupt, because eventually we want to wake the MCU on and see what it has stored through its lifetime (@ChrisKnudsen thanks to you too for confirming this and relating it to dannyf 's response) \$\endgroup\$ – Sina Aug 7 '17 at 8:00
1
\$\begingroup\$

that if satisfied, the whole system should shut down without erasing the main memory.

One approach is to use a relay. Once the condition is met, Dr energize that relay to cut power to the mcu.

If a relay is too expensive, light up an led or sound out a loud buzzer so a human can switch off the mcu.

A third approach is to short the power supply. That will cause the fuse to blow thus cutting out the mcu.

None of the other approached proposed shut down the mcu. They simply enter the mcu into low power modes. Not shutting it down

\$\endgroup\$
1
  • \$\begingroup\$ +1 These are really good general suggestions, however MSP430FRxxx series has a killer Low Power Modes with consumption negligible compared even to typical quiescent currents \$\endgroup\$ – Andrejs Gasilovs Aug 4 '17 at 15:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.