cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 4 MCU

KySa_4592371
New Contributor

CY8CMBR3108を使用して近接センサを1個実装しています。

データシート(文書番号: 001-92218 Rev. *C)の32頁「読み出し動作」について教えて下さい。

最終読み出しデータに対し、ホストはNAKを返すように記載がありますが、

NAKを返さない場合(ACK応答)は何が起きますか?

0 Likes
Reply
1 Solution
Yugandhar
Moderator
Moderator

Hi,

While Master is reading the data from the slave, at the end of every byte of data, the master sends an ACK to the slave, letting the slave know that it is ready for more data. When the master has received the number of bytes it is expecting, it sends a NACK, signaling to the slave to halt communications and release the bus. The master follows this up with a STOP condition.

I2C_read.PNG

So the host should send NACK as per the I2C protocol. Else the protocol is violated and the slave may result in going to undetermined state.

Thanks

Ganesh

View solution in original post

0 Likes
Reply
2 Replies
Yugandhar
Moderator
Moderator

Hi,

While Master is reading the data from the slave, at the end of every byte of data, the master sends an ACK to the slave, letting the slave know that it is ready for more data. When the master has received the number of bytes it is expecting, it sends a NACK, signaling to the slave to halt communications and release the bus. The master follows this up with a STOP condition.

I2C_read.PNG

So the host should send NACK as per the I2C protocol. Else the protocol is violated and the slave may result in going to undetermined state.

Thanks

Ganesh

View solution in original post

0 Likes
Reply
KySa_4592371
New Contributor

Thank you.
I understand.

0 Likes
Reply