MSP430 GPIO behaviour on power off

brownoutgpiomsp430reset

I have a simple circuit which contains an MSP430 connected to a DAC8551. I'm using PORT1 so have implemented a bit-banging approach instead of using the USCI module (bad, I know).

I've noticed a strange phenomenon with my logic analyser. In steady state operation, I observe whatever value I'm sending to the DAC as expected. When I switch the power off, I sometimes get another value, in particular I get 4784 (0x12B0).

Once I switch off the supply I expect Vcc to drop from 3.3V to below the minimum 1.8V after some period of time, potentially causing a BOR and then to shut-off completely. I can't explain why I would consistantly observe '4784' on pin 1.1 in the last transmission before Vcc goes to 0. The relevant code in my code to transmit to the DAC is below.

for (i=8; i!=0; i--){clkDAC();}
//clk in don't care bits
for (i=16; i!=0; i--){  // Set MSB first
    if(value & 1<<(i-1)){
        P1OUT |= BIT1;
    }
    else{
        P1OUT &= ~BIT1;
    }
    clkDAC();
}

Any help appreciated.

Edit:

I've noticed that I was getting the same problem at the very beginning of my transmission, and I fixed that by adding a delay in my init_clk function, apparently the processor can't go straight into operating at 16 Mhz until Vcc rises past a certain threshold. I believe the same effect was happening when I switched the power off. I'm still interested in why it was always a particular value though.

Best Answer

There are a few voltage levels you need to maintain.

  • VCC(Start) or V(Min), the lowest that clock operations can happen. This is the voltage that the Power On Reset circuit operates at. It's 0.7 * V(B_IT-), typically 1 Volt. The MSP430 should be in POR reset at that time.

  • V(B_IT-), the Brown Out Reset circuit trigger voltage. Typically 1.35 Volts. Any quick drops below this voltage triggers the BOR reset.

  • V(B_IT+) or Vhys(B_IT-), the BOR circuit hysterics value. Minimum voltage after power drops to the BOR trigger, in which the BOR timer starts. It will be held in reset up to 2 milliseconds after it rises past this. Typically 150mV above V(B_IT-). V(B_IT-) + Vhys(B_IT-) should be ≤ 1.8V Max.

  • V(Min), the Minimum Operating Voltage. This is 1.8V. Anything below this is undefined/bad. Between V(Min) and V(B_IT-), you have no idea what is happening.

  • Vcc(MhzMin) for Your Clock speed. Not all clock speeds are supported at all VCC voltages. For example, 3.3V is the minimum for 16 mHz. If VCC drops below this, undefined/bad, again.

In practice, the MSP will keep running until somewhere in the 1.35 to 1.7 volt section, badly, until the BOR threshold is passed. You can't rely on any data at this point. But if your clock is too high, then the Vcc(MhzMin) is the real threshold.

Then you have to consider the same voltage ranges for the DAC you are using. It will have its own screwy thresholds for proper operation, and for undefined/bad but still operating ranges.