Hi!
I looking for some advanced persons help!
I try to communicate to at24c128c EEPROM with msp430g2553 (launchpad).
I made the pull-up resistors as it is required and some of the mspware demos do some traffic on the lines, but those not for eeprom.
So, i took the slaa208 source and import it into a css6 project to see what it can do.
Actually it seems nothing!
There was a little error at compilation, but after correction it was looking fine.
When i started the program it seems stalled.
Then i hooked it up with oscilloscope, and all the lines was quite!
When i checked the debug, it seems it did not finished the first write cycle. It was hanging at "i2c stop condition"
in this function.
/*----------------------------------------------------------------------------*/
// Description:
// Byte Write Operation. The communication via the I2C bus with an EEPROM
// (2465) is realized. A data byte is written into a user defined address.
/*----------------------------------------------------------------------------*/
void EEPROM_ByteWrite(unsigned int Address, unsigned char Data)
{
unsigned char adr_hi;
unsigned char adr_lo;
while (UCB0STAT & UCBUSY); // wait until I2C module has
// finished all operations.
adr_hi = Address >> 8; // calculate high byte
adr_lo = Address & 0xFF; // and low byte of address
I2CBufferArray[2] = adr_hi; // Low byte address.
I2CBufferArray[1] = adr_lo; // High byte address.
I2CBufferArray[0] = Data;
PtrTransmit = 2; // set I2CBufferArray Pointer
I2CWriteInit();
UCB0CTL1 |= UCTXSTT; // start condition generation
// => I2C communication is started
__bis_SR_register(LPM0_bits + GIE); // Enter LPM0 w/ interrupts
UCB0CTL1 |= UCTXSTP; // I2C stop condition
while(UCB0CTL1 & UCTXSTP); // Ensure stop condition got sent
}
If you have any idea what happened, i would be glade to hear!