cancel
Showing results for 
Search instead for 
Did you mean: 

I2c with Nack peripherical

adelchi
Associate
Posted on February 24, 2011 at 11:05

I2c with Nack peripherical

7 REPLIES 7
smart2
Associate II
Posted on May 17, 2011 at 14:25

Not sure if it ''ll work but you can try it out.

/* I2C1 configuration*/

  I2C_InitStructure.I2C_Mode = I2C_Mode_I2C;

  I2C_InitStructure.I2C_DutyCycle = I2C_DutyCycle_2;

  I2C_InitStructure.I2C_OwnAddress1 = 0x28;

  I2C_InitStructure.I2C_Ack = I2C_Ack_Disable;

  I2C_InitStructure.I2C_AcknowledgedAddress = I2C_AcknowledgedAddress_7bit;

  I2C_InitStructure.I2C_ClockSpeed = I2C_CLOCK_SPEED;

  I2C_Init(I2C1, &I2C_InitStructure);

adelchi
Associate
Posted on May 17, 2011 at 14:25

It do not works, because 'I2C_Ack_Disable' disable the ACK from STM32 to peripheral.

I need to send data to peripheral , although the peripheral send me Nack.

Thanks!

Posted on May 17, 2011 at 14:25

''I have a i2c peripherical that can't send ACK''

 

Surerly the ACK is an essential part of the I2C protocol?

Therefore, if the peripheral can't send ACK, then it is not  an I2C peripheral?!

Posted on May 17, 2011 at 14:25

Surely the ACK is an essential part of the I2C protocol?

 

Therefore, if the peripheral can't send ACK, then it is not  an I2C peripheral?!

 

Or a cunning trick to avoid licencing the real protocol?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on May 17, 2011 at 14:25

''Or a cunning trick to avoid licencing the real protocol?''

In that case, it must not be called ''I2C'';  it would have to be called ''TWI'' or ''I2C-like'' or somesuch - but the name ''I2C'' may only be used for fully-conforming implementations.

mtaallah
Associate II
Posted on May 17, 2011 at 14:25

Hi,

can you post your code source.

thx.

ColdWeather
Senior
Posted on May 17, 2011 at 14:25

Try this:

1. Issue START,

2. Wait for SB,

3. Send ADDRESS, you'll receive NACK.

4. WAIT for AF, it will be set because of NACK. It ''replaces'' for your case the ADDR and TXE bits.

5. do

    reset AF,

    send your next byte,

    WAIT for AF set,

until all bytes sent

6. Issue STOP.