Hey folks,
We are developing a project using the MSP430F5438 chip that will be used on delivery trailers. Between deliveries, the unit will be powered off. In the instance that the driver may fail to save the delivery data before turning off the power, or a power failure occurrs during a delivery, I need to save the delivery data in flash and recover it on subsequent powerup. We have a capacitor to alow some time for shutdown. Also, since we need to maintain power to the RTC, I go into LMP3 after writing data to flash. We have a watch battery to run the processor in LPM3. It has been going fairly smoothly so far. My save and recover routines work, and I detect powerup using DIO and cause a reset. The reset procedure tests a flag in flash and restores delivery data if flag is set. We have done some timing tests with oscope and it takes < 1ms to save data to flash.
The problem is that as long as jtag is connected when supply voltage is turned off the data is saved, but if I turn off power with jtag removed, the data is not saved. If I turn off supply voltage with jtag attached, allowing the data to be saved, then remove jtag, wait, then turn on supply voltage, the saved data is restored correctly.
We know that our current problem is that I am detecting supply voltage problem using A/D which I am reading at 2Hz. This is too slow. Before we go to adding hardware to monitor the supply voltage and cause a DIO interrupt to signal time to save data to flash, I wanted to get the group's opinions on this. Is this the best way to do this?
It has also been proposed to try to use the supply voltage monitor in the power management module to detect supply voltage loss but I wonder if there would be time to then save data to flash. Also moving the battery to the vcore side of the PMM regulator... I'm basically a software weinie who knows just enough about hardware to get into trouble. What are your high level thoughts on this? How do you handle this?
Thanks,
Mike Raines