Hi,
I adapted the I2C master TI example code (http://coecsl.ece.illinois.edu/ge423/datasheets/MSP430Ref_Guides/Cexamples/MSP430G2xx3%20Code%20Examples/C/msp430g2xx3_uscib0_i2c_12.c) and initially everything was working ok, but when I got back after a few hours of break it stopped working, althought the code has not changed: the program execution stops on the __delay_cycles(4600) call line. I've confirmed it with P1.4 that I monitor on the logic analyzer.
The function that is disturbed is called from the main() and looks like:
void get_temperature_data() {
P1OUT |=BIT4; // <- brings high state on P1.4
PTxData = (unsigned char *)utTxData; // send control reg and temp reg
TXByteCtr = 2;
//Transmit process
Setup_TX(SLAVE_ADDR);
__delay_cycles(1000);
Transmit();
while (UCB0CTL1 & UCTXSTP); // Ensure stop condition got sent
P1OUT &=~BIT4; // <- still OK, it sets zero on this line
__delay_cycles(4600);
P1OUT |=BIT4; // <- does not set high level :( But if I comment the __delay_cycles in the line above out I can see that P1.4 is high
PTxData = (unsigned char*)msbData; // send control reg and temp reg
...
}
I supposed LPM0 occured during execution of __delay_cycles(4600), but I disabled all CPUOFF's from the code. Decreasing 4600 to for example 100 gives the same result as if there were no __delay_cycles() call.
Can you give me a hint what might be a problem here?
Best Regards,
tml