hai this is my program in t his i am given data to eeprom from i2c master is Indata[6]= {0x00,0x03,0x05,0x07,0x09,0x11}; but i read data from eeprom is 37,38,39,0B,0C,0D what is the problem in this code.
#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "inc/hw_i2c.h"
#include "driverlib/i2c.h"
#include "driverlib/sysctl.h"
#include "driverlib/gpio.h"
#define GPIO_PB2_I2C0SCL 0x00010803
#define GPIO_PB3_I2C0SDA 0x00010C03
#define SLAVE_ADDRESS 0x54
int i;
unsigned char byte_rcv;
unsigned char Outdata[6];
void main(void)
{
unsigned short reg_address=0x000;
unsigned char Indata[6]= {0x00,0x03,0x05,0x07,0x09,0x11};
unsigned char Outdata[6]= {0x00,0x00,0x00,0x00,0x00,0x00};
SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN |SYSCTL_XTAL_16MHZ);
SysCtlPeripheralEnable(SYSCTL_PERIPH_I2C0);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
GPIOPinConfigure(GPIO_PB2_I2C0SCL);
GPIOPinConfigure(GPIO_PB3_I2C0SDA);
GPIOPinTypeI2CSCL(GPIO_PORTB_BASE, GPIO_PIN_2 );
GPIOPinTypeI2C(GPIO_PORTB_BASE, GPIO_PIN_3);
I2CMasterInitExpClk(I2C0_MASTER_BASE, SysCtlClockGet(), false);
I2CMasterEnable(I2C0_MASTER_BASE);
I2CMasterIntDisable(I2C0_MASTER_BASE);
I2CMasterSlaveAddrSet(I2C0_MASTER_BASE, SLAVE_ADDRESS, false);
I2CMasterDataPut(I2C0_MASTER_BASE,reg_address);
I2CMasterControl(I2C0_MASTER_BASE, I2C_MASTER_CMD_BURST_SEND_START);
while(I2CMasterBusy(I2C0_MASTER_BASE));
for(i=0; i < 6; i++)
{
I2CMasterDataPut(I2C0_MASTER_BASE,Indata[i]);
I2CMasterControl(I2C0_MASTER_BASE, I2C_MASTER_CMD_BURST_SEND_CONT);
while(I2CMasterBusy(I2C0_MASTER_BASE));
}
I2CMasterDataPut(I2C0_MASTER_BASE,Indata[i]);
I2CMasterControl(I2C0_MASTER_BASE, I2C_MASTER_CMD_BURST_SEND_FINISH);
while(I2CMasterBusy(I2C0_MASTER_BASE));
SysCtlDelay(SysCtlClockGet() / 500);
I2CMasterIntEnable(I2C0_MASTER_BASE);
I2CMasterIntDisable(I2C0_MASTER_BASE);
I2CMasterSlaveAddrSet(I2C0_MASTER_BASE, SLAVE_ADDRESS, false);
I2CMasterDataPut(I2C0_MASTER_BASE,reg_address);
while(I2CMasterBusy(I2C0_MASTER_BASE));
I2CMasterSlaveAddrSet(I2C0_MASTER_BASE, SLAVE_ADDRESS, true);
i=0;
I2CMasterControl(I2C0_MASTER_BASE, I2C_MASTER_CMD_BURST_RECEIVE_START);
while(I2CMasterBusy(I2C0_MASTER_BASE));
byte_rcv = I2CMasterDataGet(I2C0_MASTER_BASE);
Outdata[0] = byte_rcv;
for(i=1; i < 6; i++)
{
I2CMasterControl(I2C0_MASTER_BASE, I2C_MASTER_CMD_BURST_RECEIVE_CONT);
while(I2CMasterBusy(I2C0_MASTER_BASE));
byte_rcv = I2CMasterDataGet(I2C0_MASTER_BASE);
Outdata[i] = byte_rcv;
}
I2CMasterControl(I2C0_MASTER_BASE, I2C_MASTER_CMD_BURST_RECEIVE_FINISH);
while(I2CMasterBusy(I2C0_MASTER_BASE));
byte_rcv = I2CMasterDataGet(I2C0_MASTER_BASE);
Outdata [i] = byte_rcv;
I2CMasterIntEnable(I2C0_MASTER_BASE);
}