Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
docn_292601
Level 2
Level 2
10 replies posted 10 sign-ins 5 replies posted

1.  i call the function  I2C_M_Start();

   

2.  write a data buf to eeprom:

   

          I2C_M_MasterWriteBuf(SLAVE_ADDR, buf, num, I2C_M_MODE_COMPLETE_XFER);
           
            /* Wait till write operation is complete*/
            while (!(I2C_M_MasterStatus() & I2C_M_MSTAT_WR_CMPLT))
            {
                ;
            }

   

            //the buf includes the address of eeprom memory.

   

3. write another data buf to eeprom:

   

            I2C_M_MasterWriteBuf(SLAVE_ADDR, anotherbuf, num1, I2C_M_MODE_COMPLETE_XFER);
           
            /* Wait till write operation is complete*/
            while (!(I2C_M_MasterStatus() & I2C_M_MSTAT_WR_CMPLT))
            {
                ;
            }

   

4.  i call the function  I2C_M_Stopt();

   

my question :

   

2 worked     3 did not work

   

when i commented 2,  the 3 woked.

   

maybe  i was wrong about the mode(now is I2C_M_MODE_COMPLETE_XFER).

0 Likes
8 Replies