I2C Slave: how to generate NAck ?


Closed Thread
Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2008
    Posts
    13

    Default I2C Slave: how to generate NAck ?

    As you can see, who can remember (ref. old posts), I'm fighting (and loosing : with I2C.
    Now my HW seems to be ok. (if someone wants to know how just ask).
    I'm not able to generate a NACK (not using built in functions) so questions:
    1) Is true that I have to generate NACK at the last received byte? (source AN734 page 1)
    2) How can I do this ?

    My project is pic16f88 slave
    master send 8byte after sent master want read back 8byte and at the end of 8th byte if no nack from slave master reject data and give error.

    Please help me: I'm getting mad with this project...

  2. #2
    Join Date
    Aug 2011
    Location
    Virginia
    Posts
    6


    Did you find this post helpful? Yes | No

    Default Re: I2C Slave: how to generate NAck ?

    HI,

    In reading THE I 2C-BUS SPECIFICATION VERSION 2.1 JANUARY 2000, it appears that yes, you need to ACK. That is all I can throw into this.

    Toadman

  3. #3
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default Re: I2C Slave: how to generate NAck ?

    Datasheet, section 10.3.1 and later will give you the answer
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  4. #4


    Did you find this post helpful? Yes | No

    Default Re: I2C Slave: how to generate NAck ?

    Well as I read it, the only time a NACK is sent for valid data is when the Master is requesting a sequential read. The Master sends a NACK on the last read to say he is done. But there is no reason why the Master couldn't ACK the last read and then send a STOP. Also note that the NACK/ACK is sent by the master on a read, not the slave.
    Tim Barr

  5. #5
    Join Date
    Oct 2008
    Posts
    13


    Did you find this post helpful? Yes | No

    Default Re: I2C Slave: how to generate NAck ?

    Quote Originally Posted by falingtrea View Post
    Also note that the NACK/ACK is sent by the master on a read, not the slave.
    in an734 page1

    After the last data byte, a NACK is sent by the
    Slave to the Master to indicate that no more bytes
    should be sent. After the NACK pulse, the Master initiates
    the STOP condition to free the bus.

  6. #6
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default Re: I2C Slave: how to generate NAck ?

    Dave
    Always wear safety glasses while programming.

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts