Hello!
What you are trying to do might be obvious for you, but it's not for an average reader.
At least it's not obvious to me.
So you are trying to communicate in I2C with something, but you don't say what it is
(therefore noone can verify how it works in the sensor documentation).
Your code comments don't allow to understand what you want to do.
TXData does not seem to be defined anywhere. Is it a 2274-specific parameter?
Why do you set it in your while loop and also in the interrupt routine?
If you use a loop and poll for the ACK, then you don't need interrupts.
And if you use interrupts, why not using MSP430's hardware loop? Enable
LPMx (verify which one in the docs) and enter sleep mode with interrupt
enable, that's usually the way to do it.
Beside this, your delay function looks funny. Why constantly assigning 1 to
P1 in your loop? What about assigning it once before the loop and resetting it
after the loop?
Now why setting P1DIR to 1 at various places and at each interrupt and delay?
Since you always set it to 1, it will never change after the first time, so you should
do this in the init phase and never touch it again.
You might want to try Texas Instruments' code. Everything has been tested.
And since many people get stuck with this trick: verify the components address
and try to shift it 1 bit to the left or to the right. Example: if the address is 50, try
A0 or 28.
Dora.
Addendum: if you could post formatted code, it would be more readable.