OpenCores
URL https://opencores.org/ocsvn/neorv32/neorv32/trunk

Subversion Repositories neorv32

[/] [neorv32/] [trunk/] [docs/] [datasheet/] [soc_spi.adoc] - Diff between revs 65 and 66

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 65 Rev 66
Line 22... Line 22...
SPI is a synchronous serial transmission interface for fast on-board communications.
SPI is a synchronous serial transmission interface for fast on-board communications.
The NEORV32 SPI transceiver supports 8-, 16-, 24- and 32-bit wide transmissions.
The NEORV32 SPI transceiver supports 8-, 16-, 24- and 32-bit wide transmissions.
The unit provides 8 dedicated chip select signals via the top entity's `spi_csn_o` signal, which are
The unit provides 8 dedicated chip select signals via the top entity's `spi_csn_o` signal, which are
directly controlled by the SPI module (no additional GPIO required).
directly controlled by the SPI module (no additional GPIO required).
 
 
 
[NOTE]
 
The NEORV32 SPI module only supports _host mode_. Transmission are initiated only by the processor's SPI module
 
(and not by an external SPI module).
 
 
The SPI unit is enabled by setting the _SPI_CTRL_EN_ bit in the `CTRL` control register. No transfer can be initiated
The SPI unit is enabled by setting the _SPI_CTRL_EN_ bit in the `CTRL` control register. No transfer can be initiated
and no interrupt request will be triggered if this bit is cleared. Furthermore, a transfer being in process
and no interrupt request will be triggered if this bit is cleared. Furthermore, a transfer being in process
can be terminated at any time by clearing this bit.
can be terminated at any time by clearing this bit.
 
 
 
[IMPORTANT]
 
Changes to the `CTRL` control register should be made only when the SPI module is idle as they directly effect
 
transmissions being in-progress.
 
 
 
[TIP]
 
A transmission can be terminated at any time by disabling the SPI module
 
by clearing the _SPI_CTRL_EN_ control register bit.
 
 
The data quantity to be transferred within a single transmission is defined via the _SPI_CTRL_SIZEx_ bits.
The data quantity to be transferred within a single transmission is defined via the _SPI_CTRL_SIZEx_ bits.
The SPI module supports 8-bit (`00`), 16-bit (`01`), 24-
The SPI module supports 8-bit (`00`), 16-bit (`01`), 24-bit (`10`) and 32-bit (`11`) transfers.
bit (`10`) and 32-bit (`11`) transfers.
 
 
 
A transmission is started when writing data to the `DATA` register. The data must be LSB-aligned. So if
A transmission is started when writing data to the `DATA` register. The data must be LSB-aligned. So if
the SPI transceiver is configured for less than 32-bit transfers data quantity, the transmit data must be placed
the SPI transceiver is configured for less than 32-bit transfers data quantity, the transmit data must be placed
into the lowest 8/16/24 bit of `DATA`. Vice versa, the received data is also always LSB-aligned. Application
into the lowest 8/16/24 bit of `DATA`. Vice versa, the received data is also always LSB-aligned. Application
software should only actually process the amount of bits that were configured using _SPI_CTRL_SIZEx_ when
software should only actually process the amount of bits that were configured using _SPI_CTRL_SIZEx_ when
reading `DATA`.
reading `DATA`.
 
 
The SPI controller features 8 dedicated chip-select lines. These lines are controlled via the control register's
[NOTE]
_SPI_CTRL_CSx_ bits. When a specific _SPI_CTRL_CSx_ bit is **set**, the according chip-select line `spi_csn_o(x)`
The NEORV32 SPI module only support MSB-first mode. Data can be reversed before writing `DATA` (for TX) / after
goes **low** (low-active chip-select lines).
reading `DATA` (for RX) to implement LSB-first transmissions. Note that in both cases data in ` DATA` still
 
needs to be LSB-aligned.
[IMPORTANT]
 
Changes to the `CTRL` control register should be made only when the SPI module is idle as they directly effect
 
transmissions being in-progress.
 
 
 
[TIP]
[TIP]
The actual transmission length is left to the user: after asserting chip-select an arbitrary amount of
The actual transmission length is left to the user: after asserting chip-select an arbitrary amount of
transmission with arbitrary data quantity (_SPI_CTRL_SIZEx_) can be made before de-asserting chip-select again.
transmission with arbitrary data quantity (_SPI_CTRL_SIZEx_) can be made before de-asserting chip-select again.
 
 
[NOTE]
The SPI controller features 8 dedicated chip-select lines. These lines are controlled via the control register's
The NEORV32 SPI module only supports _host mode_. Transmission are initiated only by the processor's SPI module
_SPI_CTRL_CSx_ bits. When a specific _SPI_CTRL_CSx_ bit is **set**, the according chip-select line `spi_csn_o(x)`
(and not by an external SPI module).
goes **low** (low-active chip-select lines).
 
 
[NOTE]
[TIP]
The NEORV32 SPI module only support MSB-first mode. Data can be reversed before writing `DATA` (for TX) / after
The dedicated SPI chip-select signals can be seen as _general purpose_ outputs. These are intended to control
reading `DATA` (for RX) to provide LSB-first transmissions.
the accessed device's chip-select signal but can also be use for controlling other shift register signals
 
(like data strobe or output-enables).
 
 
 
 
**SPI Clock Configuration**
**SPI Clock Configuration**
 
 
The SPI module supports all _standard SPI clock modes_ (0, 1, 2, 3), which is via the two control register bits
The SPI module supports all _standard SPI clock modes_ (0, 1, 2, 3), which is via the two control register bits

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.