by Dilnoza Bobokalonova

This page is for my BareMetal practice using STM32F3 Discovery board. For HAL/BSP/LL work using STM32L4, please check out the following page:

P.S more notes shall be added soon. I’ve gotten pretty caught up with interviews so can’t wait to dive deep into more embedded soon!

Notes

<aside> 💡 AHB and APB are two common bus protocols used in embedded systems for interconnecting various hardware components within a microcontroller or system-on-chip (SoC). These protocols define how different modules and peripherals communicate with each other and with the CPU.

</aside>

  1. AHB (Advanced High-performance Bus): AHB is a high-performance bus protocol used to connect high-speed and critical modules within an embedded system. It is designed to provide efficient and high-bandwidth communication between different hardware components. AHB supports features like burst transfers, split transactions, and pipelining, which contribute to its high-performance capabilities. It's typically used to connect components that require fast data transfer rates and low-latency communication, such as memory controllers, DMA controllers, and high-speed interfaces.
  2. APB (Advanced Peripheral Bus): APB is a lower-performance bus protocol used to connect less critical and lower-speed peripherals to the CPU or other higher-speed buses like AHB. APB is designed for simplicity and lower power consumption, making it suitable for connecting peripherals that do not require high-speed data transfers. Examples of peripherals that might be connected using APB include GPIO (General Purpose Input/Output), timers, UARTs (Universal Asynchronous Receiver-Transmitters), and various control registers.

AHP buses are faster than the APB buses.

APB stands for Advanced Peripheral Bus and we sure see this again in the GPIO section and AHP stands for Advanced High Performance Bus, so.

An example is through the AHP bus, we can access a particular peripheral, which less clock cycles, so let's say there set in a design, this design hasn't got a feature, but in some microcontroller designs, you could have GPIOA connected to both AHB and APB.

So this means if you want to access GPIOA in two clock cycles, you go through AHB. But if you want to access it a bit slower, let's say in like six cycles, you can use the APB.

Peripherals in a computer system need buses like AHB (Advanced High-performance Bus) and APB (Advanced Peripheral Bus) for several reasons:

  1. Interconnection: Peripherals, such as sensors, memory controllers, and communication interfaces, need to communicate with the central processing unit (CPU) and other parts of the system. Buses provide a means for these components to exchange data and control signals.
  2. Resource Sharing: Multiple peripherals often share resources like memory and the CPU's attention. Buses help manage access to these shared resources, ensuring that data is transferred in an orderly and coordinated manner.
  3. Speed Matching: Different peripherals may operate at different speeds. For instance, a CPU typically operates at a much higher clock speed than a UART (Universal Asynchronous Receiver/Transmitter) used for serial communication. Buses can act as intermediaries, allowing slower peripherals to communicate with the faster CPU without the need for the CPU to slow down.
  4. Address Decoding: Buses help in address decoding, which means they determine which peripheral a particular data transfer is intended for. This ensures that data gets to the correct destination.
  5. Control and Synchronization: Buses often include control signals that help manage the flow of data and synchronization between various peripherals and the CPU. This includes signals for indicating when data is valid, acknowledging data transfers, and managing the state of peripheral devices.
  6. Power Efficiency: Buses can be designed to allow peripherals to enter low-power states when not in use. This power management is essential for energy-efficient operation in battery-powered devices.
  7. Scalability: Buses provide a scalable and modular approach to system design. You can add or remove peripherals without fundamentally changing the architecture, as long as they adhere to the bus specifications.