AMBA Protocol
AMBA Protocol
Listen Share
What is a Microcontroller ??
A microcontroller is a small computer on a single VLSI integrated circuit (IC)
chip. It comprises one or more CPUs (processor cores), as well as memory and
programmable input/output peripherals. To facilitate communication between
these internal components, a bus architecture is required. A Bus architecture
includes system bus which is address bus + data bus +control bus.
Now to interface all these functional blocks we need AMBA. AMBA is a System-on-
Chip (SoC) bus architecture commonly used in microcontrollers.
Definition of AMBA:
The ARM Advanced Microcontroller Bus Architecture (AMBA) is an open
standard on-chip interconnect specification for connecting and managing
AMBA Standards:
2. On the other hand, the APB is intended for low-bandwidth modules such as
UART (Universal Asynchronous Receiver-Transmitter), Timer, Keypad, and PIO
(Programmable Input/Output).
APB:
2. It facilitates the reading and writing of data between the bridge and the
peripherals.
3. In the architecture, the bridge functions as the master, while all the peripherals
act as slaves.
4. The APB employs the same signals for both read and write operations.
Following are the different versions of AMBA APB with each having slight
increased features than the previous:
1. PSELx: Slave selection signal, where ‘x’ represents the number of slaves.
The maximum width of signals in the APB is 32 bits.
4. PADDR and PWRITE: Address and control signals used to determine whether a
read or write operation should be performed on the bus. Typically, a value of 1
indicates a write operation, while 0 indicates a read operation. The address
signal indicates the specific location or register to be accessed.
6. PWDATA and PRDATA: Data buses with a width of 32 bits, used for transferring
data during read and write operations, respectively.
Operation:
1. idle
2. Setup
3. Access state
The diagram below depicts the Finite State Machine (FSM) of the three states in the
Advanced Peripheral Bus (APB):
1. IDLE: This is the default state of the APB. When a reset occurs, the bus enters
the IDLE state. In this state, the enable signal is set to 0, and no slave is selected,
resulting in no data transfer.
3. ACCESS: In the ACCESS state, the PENABLE signal is set to high. The address,
write_e, select, and write data signals must remain stable during the transition
from the SETUP to ACCESS state. The ACCESS state is controlled by the PREADY
signal. If PREADY is low (0), the bus remains in the same phase. If PREADY is
https://medium.com/@iamRadhaKulkarni/understanding-the-amba-protocol-apb-ahb-and-asb-explained-29cc68540113#:~:text=AMBA is a Syst… 5/18
3/4/24, 6:53 PM Understanding the AMBA Protocol: APB, AHB, and ASB Explained | by Radha Kulkarni | Medium
high (1) and no data transfer is involved, the bus returns to the IDLE state. If a
data transfer is required, the bus transitions back to the SETUP state for the next
transaction. Based on the PWRITE control signal, data is either read from or
written to the bus in this state. Any change in the PWRITE signal during this
transition can result in data loss.
Timing diagram:
The diagram below illustrates the timing diagram for an APB (Advanced Peripheral
Bus) Write transfer with no wait state:
In the diagram:
The period from T0 to T1 represents the IDLE state, during which no data
transaction occurs, and both the PSEL and PENABLE signals are low.
From T1 to T2, we enter the SETUP state where the address for the register is
checked, and the decision to read or write data is made based on the PWRITE
control signal. In this case, the PWRITE signal is set to 1, indicating a write
operation, and we also check the PSEL signal. The SETUP state is entered only when
PSEL is high. At this stage, PENABLE is still set to 0.
The period from T2 to T3 corresponds to the ACCESS state. Here, we set PENABLE to
1 and pay attention to the PREADY signal. The data from DATA1 will be stored or
written in ADDR1 only when both the PENABLE and PREADY signals are 1.
Now, let’s consider the diagram for a Write transfer with a wait state:
In this diagram, the transactions are similar to the previous one, with T0 to T1
representing the IDLE state, T1 to T2 as the SETUP state, and T2 to T3 as the ACCESS
state. The difference lies in the ACCESS state, where data transitions only when the
PREADY signal is 1. However, in this case, the PREADY signal is low (0), indicating
that no data transition occurs between T2 and T3. Therefore, T3 to T4 becomes an
extended ACCESS state where we wait for the PREADY signal to become high. This
period, during which the ACCESS state is extended while waiting for the PREADY
signal to transition the data from DATA1 to ADDR1, is referred to as a wait state
transfer. Subsequently, between T4 and T5, the PREADY signal becomes 1, and the
ACCESS state proceeds to transition the data, completing the operation within this
period.
3. The AHB supports the concepts of multiple masters and multiple slaves,
allowing for complex system configurations.
5. The AHB introduces several new features, including split transactions, single-
cycle bus master handovers, single-clock-edge operation, and wider data bus
configurations.
6. The diagram below depicts the AHB protocol and its various components,
including masters, slaves, address and control multiplexers, a read multiplexer,
a write multiplexer, an arbiter, and a decoder.
To gain control of the bus and initiate a data transfer, a master sends a request to the
arbiter. The arbiter grants access based on a prioritization scheme, ensuring that
masters with higher priority are given access first. The decoder receives the address
signal from the master and decodes it, generating slave select signals to identify the
intended recipient. The slave responds to the master using the HRESP signal. Once
the transfer is initiated, data is exchanged between the master and the slave.
Additionally, there are other AHB signals employed, such as HCLK (the clock signal
for the bus), HRESET (reset signal), HSELx (slave select signals for each slave), and
HREADY (a signal indicating the readiness of the slave to accept data).
On the other hand, the ASB (Advanced System Bus) is a simplified version of the
AHB, specifically designed for 16-bit and 32-bit systems. The ASB operates similarly
to the AHB, starting with a master requesting access to the bus from the arbiter.
Once the arbiter grants the request, the data transfer begins. The decoder decodes
the address placed on the bus and selects the appropriate slave. The slave responds
to the master, and the actual data transfer takes place. In the ASB, various signals
are utilized, including BCLK (bus clock signal), BnRes (bus reset signal), BTRAN
(transfer acknowledge signal), BWRITE (write signal), BERROR (error signal), and
DSELx (slave select signals for each slave), among others.
A high performance and low performance bus cannot be connected directly. So, a
compatible bridge such as AHB-APB or ASB-APB bus can be used.
1. Bandwidth: It is the rate at which data can be driven across the interface. or can
also be f=defined as number of bytes that can be transferred per second.
2. Latency: This is the delay between start and end of the data transfer. or can be
defined as how long does it take for data to go from memory to processor.
The efficiency of your interface will depend on the extent to which it achieves the
maximum bandwidth and zero latency.
Number of devices to be connected to the bus can also de one of the characteristics.
Uses of AMBA:
There are several significant benefits to using the AMBA (Advanced Microcontroller
Bus Architecture) standard. These benefits include:
https://medium.com/@iamRadhaKulkarni/understanding-the-amba-protocol-apb-ahb-and-asb-explained-29cc68540113#:~:text=AMBA is a Syst… 9/18
3/4/24, 6:53 PM Understanding the AMBA Protocol: APB, AHB, and ASB Explained | by Radha Kulkarni | Medium
In summary,
Open in app the AMBA standard offers benefits such as efficient IP reuse,
Sign up Sign in
Follow
Hello, I'm Radha Kulkarni, working at HCLTech. I share my knowledge of VLSI and electronics concepts
through my stories. Follow me if you like my content.
Radha Kulkarni