MSP430 Temperature Logger – Part 3

When running the data logger, I found that I ended up with a big hole in the data that I’ve been storing to flash.

Data Logging Hole

Data Logging Hole

The program is supposed to find the next available memory location for writing.


{
int i;

for (i = 0; i < INTS_TOTAL; i ++) { if (*(INFOE + i) == 0xffff) break; } if (i > INTS_TOTAL)
{
i = 0;
flash_erase(INFOE);
}
next_memory = i;
}

So what is going wrong?

I’ve come up with two possible theories as to the failure. The first idea is that the MSP430 is under powered when attempting to write to flash. The second idea is that the oscillator has not yet stabilized when writing to flash.

Using a voltmeter, I was able to determine that the MSP430 battery voltage was running low when this data was being collected; but why the hole in the data? This could be temperature related. As the temperature drops in the household, this would cause the battery voltage to drop as well. Is that enough to cause the hole? I’m not sure.

Possible solutions?

1) Move the logging event to occur later, as this may allow for the oscillator to stabilize before attempting to write to flash.

2) Ensure that the battery has the proper voltage. This could be done by checking battery voltage manually, or making the MSP430 use the built-in ADC to monitor the battery.

One thought on “MSP430 Temperature Logger – Part 3

  1. While the MSP430 definitely could be used for this application, I would recommend using analog circuitry. A simple comparator combined with a reference voltage could be used to test if a battery goes below a certain voltage.

Leave a Reply to Chupacabras Cancel reply

Your email address will not be published. Required fields are marked *