This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Tool/software: Starterware
Hello, sir
I want to use "__persistent" to initialize variable to FRAM and stop to the value lose when power supply drop. the code is following
__persistent int xx = 0; __persistent unsigned char cc[10]= {0x0A}; int main(void) { WDTCTL = WDTPW | WDTHOLD; // Stop WDT P7OUT &= ~BIT0; // Clear P7.0 output latch for a defined power-on state P7DIR |= BIT0; P7OUT &= ~BIT1; // Clear P7.1 output latch for a defined power-on state P7DIR |= BIT1; for(unsigned char j= 0; j<10;j++) { if(cc[j] == j )
// LED0 blink {P7OUT ^= BIT0;} __delay_cycles(100000); } if(xx == 5) {
//LED1 open P7OUT |= BIT1; } xx =5; for(unsigned char i= 0; i<10;i++ ) { cc[i] = i; } }
After power failure ,I found that LED0 didn't blink and LED1 be lighten when the power supply again . I think the LED0 shoud blink when the power supply again . why?
the content of lnkmsp430fr6972.xcl is:
-Z(CONST)DATA16_P,DATA20_P=7000-FF7F -Z(DATA)DATA16_HEAP+_DATA16_HEAP_SIZE -Z(DATA)DATA20_HEAP+_DATA20_HEAP_SIZE
**Attention** This is a public forum