Lec 2 Layered Architecture
Lec 2 Layered Architecture
This is what’s called the Spaghetti Code, which is the code that
unstructured and difficult to maintain.
In the layered architecture the software is divided into small parts called software
components (SWC). Software components related to each other are organized in a
horizontal layer. Each layer is performing a specific role
Application APP
Layer System application
main
“Call Direction”
Hardware HAL Software related
Abstraction to any on board
Layer LCD Keypad Motor hardware element
“Call Direction”
Micro MCAL Software related to
Controller any peripheral inside
Abstraction DIO ADC UART the microcontroller
Layer
Advantages of Layered Architecture
1- Modularity
In a Layered architecture we separate the user application from the hardware drivers
from the microcontroller specific drivers.
2- Portability
Changing any part of the software part would change its layer only. For example, if we
need the same application with a new microcontroller, we shall only change the MCAL.
3- Reusability
Code could be easily reused in different applications and systems.
4- Maintainability
Debugging and Testing is now much easier in small parts of the software instead of
having a very long and complex one.
The Simplest driver consists of only 2 files
ww.facebook.com/imaketechnologyschool/