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...
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
Re: I2C Slave: how to generate NAck ?
Datasheet, section 10.3.1 and later will give you the answer
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.
Re: I2C Slave: how to generate NAck ?
Quote:
Originally Posted by
falingtrea
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.
Re: I2C Slave: how to generate NAck ?