Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Sic transit discus mundi -- From the System Administrator's Guide, by Lars Wirzenius


devel / comp.arch.embedded / Re: SPI Quad Serial Flash: two "quad" modes?

SubjectAuthor
* SPI Quad Serial Flash: two "quad" modes?pozz
+- Re: SPI Quad Serial Flash: two "quad" modes?Grant Edwards
`* Re: SPI Quad Serial Flash: two "quad" modes?David Brown
 `* Re: SPI Quad Serial Flash: two "quad" modes?pozz
  +- Re: SPI Quad Serial Flash: two "quad" modes?David Brown
  `- Re: SPI Quad Serial Flash: two "quad" modes?Don Y

1
SPI Quad Serial Flash: two "quad" modes?

<u0i2vg$3idod$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.arch.embedded
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From: pozzu...@gmail.com (pozz)
Newsgroups: comp.arch.embedded
Subject: SPI Quad Serial Flash: two "quad" modes?
Date: Tue, 4 Apr 2023 22:57:21 +0200
Organization: A noiseless patient Spider
Lines: 25
Message-ID: <u0i2vg$3idod$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 4 Apr 2023 20:57:20 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="9293a914f85084e2b0a5468d395104d7";
logging-data="3749645"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/eiTpjxKu7WAkspC4vUWTBnr8ZaZdbFio="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.9.1
Cancel-Lock: sha1:T6MSGJeWuWjttBHBXe9crQvy2bs=
 by: pozz - Tue, 4 Apr 2023 20:57 UTC

I'm studying datasheet of SST26VF080A. It's a SPI Quad Flash memory in
standard 8 pin package.

I'm not sure I correctly understood the quad mode. It appears to me two
quad modes are supported: SPI Quad mode (IOC=1 in Configuration
Register) and SQI mode (after sending Enable Quad I/O command).

For example, after setting IOC bit in Configuration Register I can use
SQOR command (SPI Quad Output Read) to output data from SIO[3:0] pins.

A similar behaviour can be obtained after enabling SQI mode (sending
EQIO=Enable Quad I/O mode) and using High-Speed Read command (0x0B).

What is the difference? I think the difference is only in the data
transmitted by the SPI master: opcode byte, address bytes and dummy
bytes. In the first case, they are transmitted serially on a single
signal (SI/SIO0); in SQI mode, they are transmitted serially on 4
signals (SIO[3-0]). The behaviour on data transmitted by the serial
Flash should be exactly the same: they are transmitted on the 4 signals
SIO[3-0].

Is my understanding correct?

I think the penalty of the first Quad mode respect the SQI mode is very
small.

Re: SPI Quad Serial Flash: two "quad" modes?

<u0ibtd$ei1$2@reader2.panix.com>

  copy mid

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

  copy link   Newsgroups: comp.arch.embedded
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!panix!.POSTED.localhost!not-for-mail
From: inva...@invalid.invalid (Grant Edwards)
Newsgroups: comp.arch.embedded
Subject: Re: SPI Quad Serial Flash: two "quad" modes?
Date: Tue, 4 Apr 2023 23:29:49 -0000 (UTC)
Organization: PANIX Public Access Internet and UNIX, NYC
Message-ID: <u0ibtd$ei1$2@reader2.panix.com>
References: <u0i2vg$3idod$1@dont-email.me>
Injection-Date: Tue, 4 Apr 2023 23:29:49 -0000 (UTC)
Injection-Info: reader2.panix.com; posting-host="localhost:::1";
logging-data="14913"; mail-complaints-to="abuse@panix.com"
User-Agent: slrn/1.0.3 (Linux)
 by: Grant Edwards - Tue, 4 Apr 2023 23:29 UTC

On 2023-04-04, pozz <pozzugno@gmail.com> wrote:
> I'm studying datasheet of SST26VF080A. It's a SPI Quad Flash memory in
> standard 8 pin package.
>
> I'm not sure I correctly understood the quad mode. It appears to me
> two quad modes are supported: SPI Quad mode (IOC=1 in Configuration
> Register) and SQI mode (after sending Enable Quad I/O command).
>
> [...]
>
> [...] I think the difference is only in the data transmitted by the
> SPI master: opcode byte, address bytes and dummy bytes. In the first
> case, they are transmitted serially on a single signal (SI/SIO0); in
> SQI mode, they are transmitted serially on 4 signals (SIO[3-0]).

That sounds right -- that's how I remember it.

> The behaviour on data transmitted by the serial Flash should be
> exactly the same: they are transmitted on the 4 signals SIO[3-0].
>
> Is my understanding correct?

I think so.

> I think the penalty of the first Quad mode respect the SQI mode is
> very small.

For things like a bootloader which sends one read command and then
shifts out many KB of data, the difference is not noticable. You might
be able to see a difference if you do a lot of large writes. or a lot
of very small reads.

--
Grant

Re: SPI Quad Serial Flash: two "quad" modes?

<u0k5go$3umru$2@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.arch.embedded
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.arch.embedded
Subject: Re: SPI Quad Serial Flash: two "quad" modes?
Date: Wed, 5 Apr 2023 17:52:56 +0200
Organization: A noiseless patient Spider
Lines: 41
Message-ID: <u0k5go$3umru$2@dont-email.me>
References: <u0i2vg$3idod$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 5 Apr 2023 15:52:56 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="44a5ed1923b6ba21b3565d3ccd62575c";
logging-data="4152190"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Y92I7maWe5IdvYNrWw0bBQ6eVul1lWqk="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
Thunderbird/60.6.1
Cancel-Lock: sha1:DNw796kbzPMfsgKFznjd8DLPRn8=
In-Reply-To: <u0i2vg$3idod$1@dont-email.me>
Content-Language: en-GB
 by: David Brown - Wed, 5 Apr 2023 15:52 UTC

On 04/04/2023 22:57, pozz wrote:
> I'm studying datasheet of SST26VF080A. It's a SPI Quad Flash memory in
> standard 8 pin package.
>
> I'm not sure I correctly understood the quad mode. It appears to me two
> quad modes are supported: SPI Quad mode (IOC=1 in Configuration
> Register) and SQI mode (after sending Enable Quad I/O command).
>
> For example, after setting IOC bit in Configuration Register I can use
> SQOR command (SPI Quad Output Read) to output data from SIO[3:0] pins.
>
> A similar behaviour can be obtained after enabling SQI mode (sending
> EQIO=Enable Quad I/O mode) and using High-Speed Read command (0x0B).
>
> What is the difference? I think the difference is only in the data
> transmitted by the SPI master: opcode byte, address bytes and dummy
> bytes. In the first case, they are transmitted serially on a single
> signal (SI/SIO0); in SQI mode, they are transmitted serially on 4
> signals (SIO[3-0]). The behaviour on data transmitted by the serial
> Flash should be exactly the same: they are transmitted on the 4 signals
> SIO[3-0].
>
> Is my understanding correct?

Yes.

In SPI Quad mode, /data/ is send 4 bits per clock (or twice that, for
double data rate pins). In SQI mode, /everything/ is sent 4 bits at a time.

>
> I think the penalty of the first Quad mode respect the SQI mode is very
> small.

It all depends on your clock speeds, your mix of reads and writes, your
wait states, the length of your transfers, etc. If you are doing big
transfers then there will be little difference since most clocks are
data anyway. For lots of small transfers with few wait states, SQI will
make a bigger difference.

(And if you are doing big data transfers, you might also want to enable
double data rate on the pins, if your hardware supports it.)

Re: SPI Quad Serial Flash: two "quad" modes?

<u12vo8$2j706$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.arch.embedded
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From: pozzu...@gmail.com (pozz)
Newsgroups: comp.arch.embedded
Subject: Re: SPI Quad Serial Flash: two "quad" modes?
Date: Tue, 11 Apr 2023 08:46:32 +0200
Organization: A noiseless patient Spider
Lines: 57
Message-ID: <u12vo8$2j706$1@dont-email.me>
References: <u0i2vg$3idod$1@dont-email.me> <u0k5go$3umru$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 11 Apr 2023 06:46:32 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="62c1b56048673bd0e87445ddd2fba773";
logging-data="2726918"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+gPBrlMVJujaDyrOgbHD9i0whqCuWaIuc="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.9.1
Cancel-Lock: sha1:BF7yOnnECpDMDJtrTi4nS9Ci/HQ=
In-Reply-To: <u0k5go$3umru$2@dont-email.me>
 by: pozz - Tue, 11 Apr 2023 06:46 UTC

Il 05/04/2023 17:52, David Brown ha scritto:
> On 04/04/2023 22:57, pozz wrote:
>> I'm studying datasheet of SST26VF080A. It's a SPI Quad Flash memory in
>> standard 8 pin package.
>>
>> I'm not sure I correctly understood the quad mode. It appears to me
>> two quad modes are supported: SPI Quad mode (IOC=1 in Configuration
>> Register) and SQI mode (after sending Enable Quad I/O command).
>>
>> For example, after setting IOC bit in Configuration Register I can use
>> SQOR command (SPI Quad Output Read) to output data from SIO[3:0] pins.
>>
>> A similar behaviour can be obtained after enabling SQI mode (sending
>> EQIO=Enable Quad I/O mode) and using High-Speed Read command (0x0B).
>>
>> What is the difference? I think the difference is only in the data
>> transmitted by the SPI master: opcode byte, address bytes and dummy
>> bytes. In the first case, they are transmitted serially on a single
>> signal (SI/SIO0); in SQI mode, they are transmitted serially on 4
>> signals (SIO[3-0]). The behaviour on data transmitted by the serial
>> Flash should be exactly the same: they are transmitted on the 4
>> signals SIO[3-0].
>>
>> Is my understanding correct?
>
> Yes.
>
> In SPI Quad mode, /data/ is send 4 bits per clock (or twice that, for
> double data rate pins).  In SQI mode, /everything/ is sent 4 bits at a
> time.

Ok, now suppose you would like to work in SQI mode. During startup you
send the Enable SQI command over a single data line (MOSI). From now on,
you can send SQI commands using 4 data lines even for command code byte
(two clocks).

However you can't be sure at startup the Flash is in normal SPI mode.
This happens when you power up the board, but it's not true when the MCU
resets itself (for example, for watchdog).

What could be the initialization process to bring the SPI Flash in SQI
mode at startup, without knowing if it is already in SQI mode or not?

>> I think the penalty of the first Quad mode respect the SQI mode is
>> very small.
>
> It all depends on your clock speeds, your mix of reads and writes, your
> wait states, the length of your transfers, etc.  If you are doing big
> transfers then there will be little difference since most clocks are
> data anyway.  For lots of small transfers with few wait states, SQI will
> make a bigger difference.
>
> (And if you are doing big data transfers, you might also want to enable
> double data rate on the pins, if your hardware supports it.)

What do you mean with DDR here?

Re: SPI Quad Serial Flash: two "quad" modes?

<u13ct9$2jc2a$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.arch.embedded
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.arch.embedded
Subject: Re: SPI Quad Serial Flash: two "quad" modes?
Date: Tue, 11 Apr 2023 12:31:04 +0200
Organization: A noiseless patient Spider
Lines: 72
Message-ID: <u13ct9$2jc2a$1@dont-email.me>
References: <u0i2vg$3idod$1@dont-email.me> <u0k5go$3umru$2@dont-email.me>
<u12vo8$2j706$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 11 Apr 2023 10:31:05 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="22b76096fb402042beebc8c1f2bbd923";
logging-data="2732106"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1//7u6LOMhHmkrDrsINJP4Ge7D2xx2OrGQ="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.7.1
Cancel-Lock: sha1:Uwz9818tjVP3HN9NiKbBkeupel0=
Content-Language: en-GB
In-Reply-To: <u12vo8$2j706$1@dont-email.me>
 by: David Brown - Tue, 11 Apr 2023 10:31 UTC

On 11/04/2023 08:46, pozz wrote:
> Il 05/04/2023 17:52, David Brown ha scritto:
>> On 04/04/2023 22:57, pozz wrote:
>>> I'm studying datasheet of SST26VF080A. It's a SPI Quad Flash memory
>>> in standard 8 pin package.
>>>
>>> I'm not sure I correctly understood the quad mode. It appears to me
>>> two quad modes are supported: SPI Quad mode (IOC=1 in Configuration
>>> Register) and SQI mode (after sending Enable Quad I/O command).
>>>
>>> For example, after setting IOC bit in Configuration Register I can
>>> use SQOR command (SPI Quad Output Read) to output data from SIO[3:0]
>>> pins.
>>>
>>> A similar behaviour can be obtained after enabling SQI mode (sending
>>> EQIO=Enable Quad I/O mode) and using High-Speed Read command (0x0B).
>>>
>>> What is the difference? I think the difference is only in the data
>>> transmitted by the SPI master: opcode byte, address bytes and dummy
>>> bytes. In the first case, they are transmitted serially on a single
>>> signal (SI/SIO0); in SQI mode, they are transmitted serially on 4
>>> signals (SIO[3-0]). The behaviour on data transmitted by the serial
>>> Flash should be exactly the same: they are transmitted on the 4
>>> signals SIO[3-0].
>>>
>>> Is my understanding correct?
>>
>> Yes.
>>
>> In SPI Quad mode, /data/ is send 4 bits per clock (or twice that, for
>> double data rate pins).  In SQI mode, /everything/ is sent 4 bits at a
>> time.
>
> Ok, now suppose you would like to work in SQI mode. During startup you
> send the Enable SQI command over a single data line (MOSI). From now on,
> you can send SQI commands using 4 data lines even for command code byte
> (two clocks).
>
> However you can't be sure at startup the Flash is in normal SPI mode.
> This happens when you power up the board, but it's not true when the MCU
> resets itself (for example, for watchdog).
>
> What could be the initialization process to bring the SPI Flash in SQI
> mode at startup, without knowing if it is already in SQI mode or not?

Connect the processor reset and the Flash reset.

Failing that, I suspect you'll find that if you try to send the SPI code
for enable SQI mode while you are already in SQI mode, you'll not do any
harm.

>
>
>>> I think the penalty of the first Quad mode respect the SQI mode is
>>> very small.
>>
>> It all depends on your clock speeds, your mix of reads and writes,
>> your wait states, the length of your transfers, etc.  If you are doing
>> big transfers then there will be little difference since most clocks
>> are data anyway.  For lots of small transfers with few wait states,
>> SQI will make a bigger difference.
>>
>> (And if you are doing big data transfers, you might also want to
>> enable double data rate on the pins, if your hardware supports it.)
>
> What do you mean with DDR here?

Double data rate - data pin changes on both rising and falling edges of
the clock. Many QSPI flash chips support it.

Re: SPI Quad Serial Flash: two "quad" modes?

<u13i5g$2jvdc$2@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.arch.embedded
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From: blockedo...@foo.invalid (Don Y)
Newsgroups: comp.arch.embedded
Subject: Re: SPI Quad Serial Flash: two "quad" modes?
Date: Tue, 11 Apr 2023 05:00:47 -0700
Organization: A noiseless patient Spider
Lines: 98
Message-ID: <u13i5g$2jvdc$2@dont-email.me>
References: <u0i2vg$3idod$1@dont-email.me> <u0k5go$3umru$2@dont-email.me>
<u12vo8$2j706$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 11 Apr 2023 12:00:50 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="5d828fbe4d36158efd1f52b91a034052";
logging-data="2751916"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19sVWQPSMavWTl0LeYH/2Qi"
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.2.2
Cancel-Lock: sha1:+ztPJLYBaYWVApZf2hpzNIMPmDA=
Content-Language: en-US
In-Reply-To: <u12vo8$2j706$1@dont-email.me>
 by: Don Y - Tue, 11 Apr 2023 12:00 UTC

On 4/10/2023 11:46 PM, pozz wrote:
> Ok, now suppose you would like to work in SQI mode. During startup you send the
> Enable SQI command over a single data line (MOSI). From now on, you can send
> SQI commands using 4 data lines even for command code byte (two clocks).
>
> However you can't be sure at startup the Flash is in normal SPI mode. This
> happens when you power up the board, but it's not true when the MCU resets
> itself (for example, for watchdog).

This is the bane of all devices that have "modes"; how do you know that the
I/O pins that you've "programmed" to be outputs are actually outputs, NOW?
Or, that any device requiring a multicycle transaction is in the state
where it is expecting the first of those cycles to be issued, next, in time?

I've found it prudent to have an entry point in the code (called "RESET")
that is treated as an adjective and verb:
- the system is *in* the reset state
- reset the system *to* that state

This ensures that any assumptions one can make for a *device* coming out of
(hardware) RESET apply any time the code executes from that point.

The device can reach that point:
- through the normal PoR process
- through a watchdog or other sentinel
- through a random crash
- as a result of panic()

I usually (start) write this as one of the first pieces of production
code as it gives me a chance to think about how the hardware "comes up"
(you have to think about EVERYTHING, not just the CPU/MCU itself) and
whether or not that can pose problems after deployment (e.g., what if
the motors aren't guaranteed to be stopped, at this point in time?)

It also gives you an idea of those parts of your hardware interface
that need to be atomic, accessed via monitors, etc. Esp if two
different active entities (e.g., two threads, a thread and an ISR, etc.)
can compete for the device "in some yet unforeseen scenario".

> What could be the initialization process to bring the SPI Flash in SQI mode at
> startup, without knowing if it is already in SQI mode or not?

Again, applies to every aspect of a system that has modes (embedded state).

You look at the device and posit the different possible "states" that
the interface may be in; then figure out which assumptions can allow you
to unambiguously drive the interface to a particular state from which
behavior is reliable. E.g., you may opt to put the device in the
"wrong" state (temporarily) if only because getting it *there* may be
easier to guarantee... then, deliberately transitioning from "there"
to wherever you'd ultimately like it to be.

E.g., multicycle interfaces often abort their sequences if a read occurs
when a write is expected (or, might be encountered). So, assuming a
read to be "safe" (for that particular device/situation), you do one or
more reads (discarding the data, if necessary) before you start the
multicycle *write* sequence.

Consider a video LUT. Often, you have to write the address of the
location of interest *within* the LUT to the device before you can
read or write. If you think the device is waiting for this "specify
address" portion of its interface cycle and send "0x44" to it
(because you want to access the 0x44th entry) but, instead, it was
already in the "address specified, waiting for read/write" mode,
then your 0x44 will clobber some "random" (as in, "location that you
can't predict" because you don't know what address had been specified
prior to your barging in on the interaction) location.

And, your subsequent "here's the data that I want to write" will,
instead, be interpreted as the next *address* that you want to access
thereby perpetuating the dyssynchrony.

OTOH, if you had done a *read* operation and knew that this would
reset the little state machine inside the LUT to "waiting for
next address", then that throw-away action can serve to get the
interface back into lock-step with the code (assuming you don't wedge
it later).

The pisser is that you have to come up with a strategy that will
work for any device that might be placed in that role (as the
design evolves).

>>> I think the penalty of the first Quad mode respect the SQI mode is very small.
>>
>> It all depends on your clock speeds, your mix of reads and writes, your wait
>> states, the length of your transfers, etc.  If you are doing big transfers
>> then there will be little difference since most clocks are data anyway.  For
>> lots of small transfers with few wait states, SQI will make a bigger difference.
>>
>> (And if you are doing big data transfers, you might also want to enable
>> double data rate on the pins, if your hardware supports it.)
>
> What do you mean with DDR here?

Instead of a cycle being defined by a rising (falling) "clock" edge, it is
defined by rising *and* falling edges. So, you get twice the throughput
for a given "cycle" (without having to double the "clock" frequency).

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor