|
NetBurner 3.5.8
PDF Version |
Classes | |
| struct | EBI_CS_cfg_t |
| Configuration structure for an External Bus Interface (EBI) chip select. More... | |
Enumerations | |
| enum | EBI_CS_BusWidth_t { EBI_BUS_WIDTH_8 = 0 , EBI_BUS_WIDTH_16 = 1 } |
| Data bus width configuration for External Bus Interface. More... | |
| enum | EBI_CS_ByteAccess_t { EBI_BYTE_ACCESS_SELECT = 0 , EBI_BYTE_ACCESS_WRITE = 1 } |
| Byte access mode for 16-bit bus configurations. More... | |
| enum | EBI_CS_NWait_t { EBI_NWAIT_DISABLED = 0 , EBI_NWAIT_FROZEN = 2 , EBI_NWAIT_READY = 3 } |
| NWAIT signal configuration for bus cycle extension. More... | |
| enum | EBI_CS_WrMode_t { EBI_WRITE_MODE_NCS = 0 , EBI_WRITE_MODE_NWE = 1 } |
| Write control signal selection. More... | |
| enum | EBI_CS_RdMode_t { EBI_READ_MODE_NCS = 0 , EBI_READ_MODE_NRD = 1 } |
| Read control signal selection. More... | |
Functions | |
| void | ConfigureEBI_CSPin (int csNum) |
| Configure the I/O pin for a given Chip Select for the external data bus. | |
| void | ConfigureEBI_NWRPin () |
| Configure the I/O pin for the active low write/read (NWR) bus signal. | |
| void | ConfigureEBI_NRDPin () |
| Configure the I/O pin for the active low read (NRD) bus signal. | |
| void | ConfigureEBI_CS (uint32_t csNum, const EBI_CS_cfg_t &&cfg) |
| Configure the given Chip Select for the external data bus (rvalue reference version). | |
| void | ConfigureEBI_CS (uint32_t csNum, const EBI_CS_cfg_t &cfg) |
| Configure the given Chip Select for the external data bus (lvalue reference version). | |
Variables | |
| uint8_t | EBI_CS_cfg_t::ncs_rd_setup |
| uint8_t | EBI_CS_cfg_t::nrd_setup |
| uint8_t | EBI_CS_cfg_t::ncs_wr_setup |
| uint8_t | EBI_CS_cfg_t::nwe_setup |
| uint8_t | EBI_CS_cfg_t::ncs_rd_pulse |
| uint8_t | EBI_CS_cfg_t::nrd_pulse |
| uint8_t | EBI_CS_cfg_t::ncs_wr_pulse |
| uint8_t | EBI_CS_cfg_t::nwe_pulse |
| uint16_t | EBI_CS_cfg_t::nrd_cycles |
| uint16_t | EBI_CS_cfg_t::nwe_cycles |
| uint8_t | EBI_CS_cfg_t::tdf_cycles |
| EBI_CS_BusWidth_t | EBI_CS_cfg_t::busWidth |
| EBI_CS_ByteAccess_t | EBI_CS_cfg_t::byteAccess |
| EBI_CS_NWait_t | EBI_CS_cfg_t::nWait |
| EBI_CS_WrMode_t | EBI_CS_cfg_t::wrMode |
| EBI_CS_RdMode_t | EBI_CS_cfg_t::rdMode |
Supported Platforms: MODM7AE70
The Microchip SAME70 EBI peripheral is a parallel communication port that can only operate in "host" mode to communicate with "slave" devices. The EBI peripheral consists of a set of up to 16 data signals, up to 24 address signals and up to 10 different control signals. Some of the benefits of using the EBI bus are that it has high performance in both throughput and latency. It is directly memory mapped to the processor so it is very easy to use in software once configured. The downsides are mostly that it has many signals which will greatly complicate hardware designs and increase the size of external peripheral chips.
The EBI peripheral is highly configurable to fit the specifications of many types of external devices.
A consequence to this high configurablity is that there are many timing parameters which makes configuration
complicated. The NetBurner examples specify a conservative set of timing parameters with the goal of being compatible with a wide range of peripherals such as FPGAs, CPLDs, buffers, latches displays, flash memory and SRAM. Once successful communication is obtained with the slave target device, these default settings should be refined to increase the performance to match the device you are interfacing with.
Advanced EBI functionality is currently not supported by this examples or this driver. Advaced functionality includes interfacing with SDRAM or NAND memories. Page mode, burst operations and scrambling functionality are all not currently configurable via this driver.
In most applications you will only need to verify the last 5 parameters meet your peripheral requirements: bus width (8 or 16), byte Access 16-bit mode only), timing parameters, read mode (chip select or read signal) and write mode (chip select or write signal).
There are 3 sources of information that are very useful for understanding the EBI:
The EBI supports Chip Selects as well as Read and Write signals to interface with peripherals. The basic procedure for configuring the bus is:
Configure the desired chip select using the ConfigureEBI_CS()function. Note that when enabling the EBI, the MODM7AE70 module requires all three chip selects (NCS0, NCS02, NCS03) to be assigned as chip selects. Addtionally the NRD signal must also be configured for NRD bus operation. All of these signals are used for controlling the enable/direction logic of the external bus buffer hardware - they cannot use their alternate functions. Each chip select has a predefined fixed 16MB address range ( MODM7AE70 Memory Map). The NetBurner API supplied predefined base address variables to make access easier as demonstrated in the EBI examples:
In this way you can do a bus write with code such as (please refer to EBI examples for latest code):
| enum EBI_CS_BusWidth_t |
#include <ebi.h>
Data bus width configuration for External Bus Interface.
Specifies the data bus width for communication with external devices on the EBI. The bus width must match the physical connection and capabilities of the external device connected to the chip select.
| Enumerator | |
|---|---|
| EBI_BUS_WIDTH_8 | 8-bit data bus width (D0-D7) |
| EBI_BUS_WIDTH_16 | 16-bit data bus width (D0-D15) |
| enum EBI_CS_ByteAccess_t |
#include <ebi.h>
Byte access mode for 16-bit bus configurations.
Controls how 8-bit accesses are handled when the bus is configured for 16-bit mode. This setting determines which control signal (chip select or write enable) is used to select the high or low byte during 8-bit transfers on a 16-bit bus.
Expand for Example Usage
| Enumerator | |
|---|---|
| EBI_BYTE_ACCESS_SELECT | Use chip select signal to access individual bytes on 16-bit bus. |
| EBI_BYTE_ACCESS_WRITE | Use write enable signal to access individual bytes on 16-bit bus. |
| enum EBI_CS_NWait_t |
#include <ebi.h>
NWAIT signal configuration for bus cycle extension.
Controls how the external NWAIT signal is used to extend read/write cycles when interfacing with slow external devices. The NWAIT signal allows external devices to insert wait states, extending the access time as needed.
This is commonly used with:
Expand for Example Usage
| enum EBI_CS_RdMode_t |
#include <ebi.h>
Read control signal selection.
Determines which signal controls read operations from external devices on the EBI. This setting affects how read cycles are generated and controlled.
Expand for Example Usage
| Enumerator | |
|---|---|
| EBI_READ_MODE_NCS | Read controlled by chip select (NCS) assertion. |
| EBI_READ_MODE_NRD | Read controlled by read enable (NRD) signal. |
| enum EBI_CS_WrMode_t |
#include <ebi.h>
Write control signal selection.
Determines which signal controls write operations to external devices on the EBI. This setting affects how write cycles are generated and controlled.
Expand for Example Usage
| Enumerator | |
|---|---|
| EBI_WRITE_MODE_NCS | Write controlled by chip select (NCS) assertion. |
| EBI_WRITE_MODE_NWE | Write controlled by write enable (NWE) signal. |
| void ConfigureEBI_CS | ( | uint32_t | csNum, |
| const EBI_CS_cfg_t && | cfg ) |
#include <ebi.h>
Configure the given Chip Select for the external data bus (rvalue reference version).
Configures an External Bus Interface (EBI) chip select with the specified timing and control parameters. This overload accepts an rvalue reference, allowing efficient configuration with temporary configuration objects.
This function sets up all timing parameters (setup, pulse, hold times), control signal modes, bus width, and wait state configuration for the specified chip select line.
| csNum | The EBI Chip Select number to configure (typically 0-3, platform-dependent). |
| cfg | Rvalue reference to the configuration structure. The configuration is moved into the function, making this efficient for temporary configuration objects. |
Expand for Example Usage
| void ConfigureEBI_CS | ( | uint32_t | csNum, |
| const EBI_CS_cfg_t & | cfg ) |
#include <ebi.h>
Configure the given Chip Select for the external data bus (lvalue reference version).
Configures an External Bus Interface (EBI) chip select with the specified timing and control parameters. This overload accepts an lvalue reference, allowing configuration with existing configuration objects that may be reused.
This function sets up all timing parameters (setup, pulse, hold times), control signal modes, bus width, and wait state configuration for the specified chip select line.
| csNum | The EBI Chip Select number to configure (typically 0-3, platform-dependent). |
| cfg | Const reference to the configuration structure. The configuration is copied, allowing the original to be reused for other chip selects. |
Expand for Example Usage
| void ConfigureEBI_CSPin | ( | int | csNum | ) |
#include <ebi.h>
Configure the I/O pin for a given Chip Select for the external data bus.
This function configures the GPIO pin associated with a specific chip select line on the External Bus Interface (EBI). The chip select pin is configured for proper timing and electrical characteristics to control external memory or peripheral devices connected to the data bus.
| csNum | The chip select number to configure (typically 0-3 depending on platform). Valid range depends on the specific NetBurner platform being used. |
Expand for Example Usage
| void ConfigureEBI_NRDPin | ( | ) |
#include <ebi.h>
Configure the I/O pin for the active low read (NRD) bus signal.
This function configures the GPIO pin for the NRD (Not Read) signal on the External Bus Interface (EBI). The NRD signal is an active-low control signal that indicates when the bus is performing a read operation from an external device.
Expand for Example Usage
| void ConfigureEBI_NWRPin | ( | ) |
#include <ebi.h>
Configure the I/O pin for the active low write/read (NWR) bus signal.
This function configures the GPIO pin for the NWR (Not Write) signal on the External Bus Interface (EBI). The NWR signal is an active-low control signal that indicates when the bus is performing a write operation to an external device.
Expand for Example Usage
| EBI_CS_BusWidth_t EBI_CS_cfg_t::busWidth |
Data bus width configuration.
Specifies whether the external device uses 8-bit or 16-bit data transfers. Must match the physical connection and device capabilities.
| EBI_CS_ByteAccess_t EBI_CS_cfg_t::byteAccess |
Byte access mode for 16-bit bus configurations.
Controls how 8-bit accesses are handled on a 16-bit bus. Only relevant when busWidth is set to EBI_BUS_WIDTH_16.
| uint8_t EBI_CS_cfg_t::ncs_rd_pulse |
NCS (Chip Select) pulse width during read operations, in clock cycles. Defines how long the chip select remains asserted during a read.
Formula: NCS pulse length = (256 × ncs_rd_pulse[6] + ncs_rd_pulse[5:0]) clock cycles
Range: 0-63 standard (0-16319 with extended bit)
| uint8_t EBI_CS_cfg_t::ncs_rd_setup |
NCS (Chip Select) setup time for read operations, in clock cycles. Defines the time from CS assertion to read signal assertion.
Formula: NCS setup length = (128 × ncs_rd_setup[5] + ncs_rd_setup[4:0]) clock cycles
Range: 0-63 standard (0-8063 with extended bit)
| uint8_t EBI_CS_cfg_t::ncs_wr_pulse |
NCS (Chip Select) pulse width during write operations, in clock cycles. Defines how long the chip select remains asserted during a write.
Formula: NCS pulse length = (256 × ncs_wr_pulse[6] + ncs_wr_pulse[5:0]) clock cycles
Range: 0-63 standard (0-16319 with extended bit)
| uint8_t EBI_CS_cfg_t::ncs_wr_setup |
NCS (Chip Select) setup time for write operations, in clock cycles. Defines the time from CS assertion to write signal assertion.
Formula: NCS setup length = (128 × ncs_wr_setup[5] + ncs_wr_setup[4:0]) clock cycles
Range: 0-63 standard (0-8063 with extended bit)
| uint16_t EBI_CS_cfg_t::nrd_cycles |
Total read cycle length in clock cycles.
The total read cycle length is the complete duration of a read operation, equal to the sum of setup, pulse, and hold times for NRD and NCS signals.
Formula: Read cycle length = (nrd_cycles[8:7] × 256 + nrd_cycles[6:0]) clock cycles
Range: 0-127 standard (0-32639 with extended bits)
Calculation: nrd_cycles = ncs_rd_setup + ncs_rd_pulse + hold_time
| uint8_t EBI_CS_cfg_t::nrd_pulse |
NRD (Read Enable) pulse width, in clock cycles. Defines how long the read enable signal remains asserted.
Formula: NRD pulse length = (256 × nrd_pulse[6] + nrd_pulse[5:0]) clock cycles
Range: 0-63 standard (0-16319 with extended bit)
| uint8_t EBI_CS_cfg_t::nrd_setup |
NRD (Read Enable) setup time, in clock cycles. Defines the delay from CS assertion to read enable assertion.
Formula: NRD setup length = (128 × nrd_setup[5] + nrd_setup[4:0]) clock cycles
Range: 0-63 standard (0-8063 with extended bit)
| EBI_CS_NWait_t EBI_CS_cfg_t::nWait |
NWAIT signal mode for bus cycle extension.
Configures how the external NWAIT signal is used to extend read/write cycles for slow devices. Commonly used with flash memory or variable-speed peripherals.
| uint16_t EBI_CS_cfg_t::nwe_cycles |
Total write cycle length in clock cycles.
The total write cycle length is the complete duration of a write operation, equal to the sum of setup, pulse, and hold times for NWE and NCS signals.
Formula: Write cycle length = (nwe_cycles[8:7] × 256 + nwe_cycles[6:0]) clock cycles
Range: 0-127 standard (0-32639 with extended bits)
Calculation: nwe_cycles = ncs_wr_setup + ncs_wr_pulse + hold_time
| uint8_t EBI_CS_cfg_t::nwe_pulse |
NWE (Write Enable) pulse width, in clock cycles. Defines how long the write enable signal remains asserted.
Formula: NWE pulse length = (256 × nwe_pulse[6] + nwe_pulse[5:0]) clock cycles
Range: 0-63 standard (0-16319 with extended bit)
| uint8_t EBI_CS_cfg_t::nwe_setup |
NWE (Write Enable) setup time, in clock cycles. Defines the delay from CS assertion to write enable assertion.
Formula: NWE setup length = (128 × nwe_setup[5] + nwe_setup[4:0]) clock cycles
Range: 0-63 standard (0-8063 with extended bit)
| EBI_CS_RdMode_t EBI_CS_cfg_t::rdMode |
Read control signal selection.
Determines which signal (NCS or NRD) controls read operations from the external device.
| uint8_t EBI_CS_cfg_t::tdf_cycles |
Data Float time - number of clock cycles for the external device to release the data after the rising edge of the read controlling signal.
This represents the time the external device needs to tri-state its outputs after a read operation completes. The SMC always provides one full cycle of bus turnaround after this TDF period.
Valid range: 0-15 clock cycles
| EBI_CS_WrMode_t EBI_CS_cfg_t::wrMode |
Write control signal selection.
Determines which signal (NCS or NWE) controls write operations to the external device.