Skip to main content
adelchi
Associate
February 24, 2011
Question

I2c with Nack peripherical

  • February 24, 2011
  • 7 replies
  • 1277 views
Posted on February 24, 2011 at 11:05

I2c with Nack peripherical

    This topic has been closed for replies.

    7 replies

    smart2
    Visitor II
    May 17, 2011
    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);

    Andrew Neil
    Super User
    May 17, 2011
    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?!

    A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
    adelchi
    adelchiAuthor
    Associate
    May 17, 2011
    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!

    Andrew Neil
    Super User
    May 17, 2011
    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.

    A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
    Tesla DeLorean
    Guru
    May 17, 2011
    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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
    ColdWeather
    Senior
    May 17, 2011
    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.

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

    Hi,

    can you post your code source.

    thx.