Jump to content
43oh

I2C slave Status code not working TM4C1294XL


Recommended Posts

Hi,

 

I am trying to get the status from a I2C transmission. But the Wire.endTransmission() always returns a zero.

 

It is not a problem of the wire library, because I can find the same problem using code composer studio using the TI compiler as well with the Gnu Compiler.

 

On the osciloscope I can see that the Master sending, bit 9 has a nack, no bytes are send afterwards, so the cpu knows it isn'r right but the I2C Master Control/Status register only gives Idle(32), also ROM_I2CMasterErr returns a 0

 

 

I have tried:

 

 
uint8_t sendTxData(unsigned long cmd, uint8_t data) {
    delayUs(10);
    uint8_t error;
    HWREG(I2C7_BASE + I2C_O_MCS) = cmd;
    ROM_I2CMasterDataPut(I2C7_BASE, data);
    while(ROM_I2CMasterBusy(I2C7_BASE);
    error=ROM_I2CMasterErr(I2C7_BASE););
    return(error);
}
 
this returns 0x20 (idle)
 
and this
 
uint8_t sendTxData(unsigned long cmd, uint8_t data) {
    delayUs(10);
    uint8_t error;
    HWREG(I2C7_BASE + I2C_O_MCS) = cmd;
    ROM_I2CMasterDataPut(I2C7_BASE, data);
    error=1;
    while(error & 0x01){
     error= HWREG(I2C7_BASE + I2C_O_MCS) ;
    };
    return(error);
}
 
this returns 0x20 (idle)

 

and ofcourse:

 

error=Wire.endTransmission()

 this returns 0

 

 

but there is no slave on that adress! (as also can be seen on the scoop)

 

does any body have an idea. Or maybe a working I2C scanner for the connected lauchpad?

 

cheers,

 

John

 

 

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...