Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

If Bill Gates is the Devil then Linus Torvalds must be the Messiah. -- Unknown source


devel / comp.arch.embedded / Re: I2C - Master generates NAK on last byte of read from slave - why?

SubjectAuthor
* Re: I2C - Master generates NAK on last byte of read from slave - why?Tim Chantor
+- Re: I2C - Master generates NAK on last byte of read from slave - why?Tim Chantor
`- Re: I2C - Master generates NAK on last byte of read from slave - why?David Brown

1
Re: I2C - Master generates NAK on last byte of read from slave - why?

<506cac6f-c6c0-47a2-8121-28879ec2e827n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=714&group=comp.arch.embedded#714

  copy link   Newsgroups: comp.arch.embedded
X-Received: by 2002:a05:620a:754:: with SMTP id i20mr9510096qki.312.1636680164515;
Thu, 11 Nov 2021 17:22:44 -0800 (PST)
X-Received: by 2002:a25:6b4e:: with SMTP id o14mr12230707ybm.86.1636680163924;
Thu, 11 Nov 2021 17:22:43 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch.embedded
Date: Thu, 11 Nov 2021 17:22:43 -0800 (PST)
In-Reply-To: <48d2b1513dtonyw@ledelec.demon.co.uk>#1/1>
Injection-Info: google-groups.googlegroups.com; posting-host=96.227.142.33; posting-account=VeWasQoAAADN1j-Gl5CGJ8nr_P4FHgr3
NNTP-Posting-Host: 96.227.142.33
References: <36BB6032.2A71@micronetics-ces.com> <79gl3r$sop$1@owl.slip.net>
<48d21ef154tonyw@ledelec.demon.co.uk> <79trv8$gql$1@owl.slip.net> <48d2b1513dtonyw@ledelec.demon.co.uk>#1/1>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <506cac6f-c6c0-47a2-8121-28879ec2e827n@googlegroups.com>
Subject: Re: I2C - Master generates NAK on last byte of read from slave - why?
From: apweir...@gmail.com (Tim Chantor)
Injection-Date: Fri, 12 Nov 2021 01:22:44 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Tim Chantor - Fri, 12 Nov 2021 01:22 UTC

On Thursday, February 11, 1999 at 3:00:00 AM UTC-5, Tony Williams wrote:
> In article <79trv8$gql$1...@owl.slip.net>,
> Myron Tuttle <mtu...@slip.net> wrote:
> > That is correct. During the 9th bit the master sets SDA high
> > for a NAK. At this point the slave lets go of control of SDA.
> > Then the masster pulls SDA low, lets SCL go back high, waits
> > 5us and then lets SDA go high to generate the STOP. Remember
> > that the I2C bus can only assert a low. The highs are
> > generated by letting the pullup do it.
> Yes thank you. Useful things, newsgroups. :)
> --
> Tony Williams.

It is not exactly obvious why the i2c spec requires the NAK on the last byte of a read sequence.
There are two reasons, one directly related to bus state:

1) After a read ACK, a device will prepare to shift out the next byte. If the first bit of this byte is a
zero, the device could drive the bus while the host is attempting to signal a stop condition. This
would only happen if the device drove the next bit shortly after the clock's rising edge (the edge
that latches the ACK/NAK) instead of waiting for the the next falling edge. Strictly speaking, this
is not a violation of the protocol since the device knows when it has received the ACK/NAK, and
driving opposite the host ACK/NAK for part of a clock phase is not an electrical collision given
the open-collector implementation of the drivers. So, the host must NAK to indicate to the device
'I do not want to hear from you anymore,' clearing the way for a STOP condition.

2) If a device implements auto-increment of register address (or sub-address) on read, ACK on
last read can cause the device to falsely advance its internal register address - all depending on
the device's specific implementation. Usually not a big deal since the next read transaction can
reassert the register address.

Re: I2C - Master generates NAK on last byte of read from slave - why?

<533cce5b-4d2f-404d-a46f-eb0586b3365en@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=715&group=comp.arch.embedded#715

  copy link   Newsgroups: comp.arch.embedded
X-Received: by 2002:ad4:4ea6:: with SMTP id ed6mr11087042qvb.54.1636681041504;
Thu, 11 Nov 2021 17:37:21 -0800 (PST)
X-Received: by 2002:a25:244c:: with SMTP id k73mr12499465ybk.12.1636681041282;
Thu, 11 Nov 2021 17:37:21 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.mixmin.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch.embedded
Date: Thu, 11 Nov 2021 17:37:20 -0800 (PST)
In-Reply-To: <506cac6f-c6c0-47a2-8121-28879ec2e827n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=96.227.142.33; posting-account=VeWasQoAAADN1j-Gl5CGJ8nr_P4FHgr3
NNTP-Posting-Host: 96.227.142.33
References: <36BB6032.2A71@micronetics-ces.com> <79gl3r$sop$1@owl.slip.net>
<48d21ef154tonyw@ledelec.demon.co.uk> <79trv8$gql$1@owl.slip.net>
<48d2b1513dtonyw@ledelec.demon.co.uk> <506cac6f-c6c0-47a2-8121-28879ec2e827n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <533cce5b-4d2f-404d-a46f-eb0586b3365en@googlegroups.com>
Subject: Re: I2C - Master generates NAK on last byte of read from slave - why?
From: apweir...@gmail.com (Tim Chantor)
Injection-Date: Fri, 12 Nov 2021 01:37:21 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Tim Chantor - Fri, 12 Nov 2021 01:37 UTC

On Thursday, November 11, 2021 at 8:22:48 PM UTC-5, Tim Chantor wrote:
> On Thursday, February 11, 1999 at 3:00:00 AM UTC-5, Tony Williams wrote:
> > In article <79trv8$gql$1...@owl.slip.net>,
> > Myron Tuttle <mtu...@slip.net> wrote:
> > > That is correct. During the 9th bit the master sets SDA high
> > > for a NAK. At this point the slave lets go of control of SDA.
> > > Then the masster pulls SDA low, lets SCL go back high, waits
> > > 5us and then lets SDA go high to generate the STOP. Remember
> > > that the I2C bus can only assert a low. The highs are
> > > generated by letting the pullup do it.
> > Yes thank you. Useful things, newsgroups. :)
> > --
> > Tony Williams.
> It is not exactly obvious why the i2c spec requires the NAK on the last byte of a read sequence.
> There are two reasons, one directly related to bus state:
>
> 1) After a read ACK, a device will prepare to shift out the next byte. If the first bit of this byte is a
> zero, the device could drive the bus while the host is attempting to signal a stop condition. This
> would only happen if the device drove the next bit shortly after the clock's rising edge (the edge
> that latches the ACK/NAK) instead of waiting for the the next falling edge. Strictly speaking, this
> is not a violation of the protocol since the device knows when it has received the ACK/NAK, and
> driving opposite the host ACK/NAK for part of a clock phase is not an electrical collision given
> the open-collector implementation of the drivers. So, the host must NAK to indicate to the device
> 'I do not want to hear from you anymore,' clearing the way for a STOP condition.
>
> 2) If a device implements auto-increment of register address (or sub-address) on read, ACK on
> last read can cause the device to falsely advance its internal register address - all depending on
> the device's specific implementation. Usually not a big deal since the next read transaction can
> reassert the register address.

and.. regarding (1), above: even if the device waited for the next falling edge to drive out the next
[potentially low] bit, this can still be a problem because a host often issues a falling clock edge after
the ACK/NAK phase in order to prep the data line for STOP. Imagine that, after ACK/NAK, clock
is high and data is high. A STOP needs to affect a data low-to-high transition while clock is high. If
the host were to simply bring data low and then back high, it would actually be signaling a repeat
START followed by STOP. So, it would need to being clock low, then data low, then clock high,
then data high in order to avoid the unintended repeat START. It is this additional clock low
transition that invites a new, potentially low, data bit to be driven onto the bus.

Re: I2C - Master generates NAK on last byte of read from slave - why?

<smmeed$ldu$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=716&group=comp.arch.embedded#716

  copy link   Newsgroups: comp.arch.embedded
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.arch.embedded
Subject: Re: I2C - Master generates NAK on last byte of read from slave - why?
Date: Fri, 12 Nov 2021 20:14:21 +0100
Organization: A noiseless patient Spider
Lines: 19
Message-ID: <smmeed$ldu$1@dont-email.me>
References: <36BB6032.2A71@micronetics-ces.com> <79gl3r$sop$1@owl.slip.net>
<48d21ef154tonyw@ledelec.demon.co.uk> <79trv8$gql$1@owl.slip.net>
<48d2b1513dtonyw@ledelec.demon.co.uk>
<506cac6f-c6c0-47a2-8121-28879ec2e827n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 12 Nov 2021 19:14:21 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="41f6da1ec58c2d62b4ed23d2a8f0d64f";
logging-data="21950"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19xt+64TUKMJPQX6oHCm5m61wFvN6h7gAM="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Cancel-Lock: sha1:qni91/K/2loO/+n9uIhc4aKFZtk=
In-Reply-To: <506cac6f-c6c0-47a2-8121-28879ec2e827n@googlegroups.com>
Content-Language: en-GB
 by: David Brown - Fri, 12 Nov 2021 19:14 UTC

On 12/11/2021 02:22, Tim Chantor wrote:
> On Thursday, February 11, 1999 at 3:00:00 AM UTC-5, Tony Williams wrote:

<snip>

Please look at the dates above.

While it is good that you want to help the poster with an answer, it is
unlikely that he has been sitting quietly waiting for help for the last
22 years.

If you want to join this Usenet group (and I hope you do - it's been a
bit slow in recent times), I recommend you use a real Usenet client and
server. Thunderbird is free, and works on any system, and
news.eternal-september.org is a free server (there are many other
clients and servers if you prefer). Usenet works far better with a
decent client rather than Google's broken "Groups" interface. But if
you do use Google Groups, check the data of the posts you reply to!

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor