0% found this document useful (0 votes)
62 views8 pages

Lec 2 Layered Architecture

Uploaded by

Rana Hesham
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views8 pages

Lec 2 Layered Architecture

Uploaded by

Rana Hesham
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

This material is developed by IMTSchool for educational use only

All copyrights are reserved


Imagine having a source code file contains 10 thousands lines of
code. If you have a bug in this code, how complex is finding the
bug … ?

This is what’s called the Spaghetti Code, which is the code that
unstructured and difficult to maintain.

Software Architecture Definition


The software architecture is a structuring way used to define software elements and
relationships between them. In Embedded Systems we use a major type of software
architecture called Layered Architecture.

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

Program File Interface File

Header file contains the


C file contains the
prototypes of the functions
implementations of the
provided by the driver to be
functions provided by the driver
used by other SWCs that need
ex: DIO_prg.c
to use this driver
ex: DIO_int.h
Let’s Create the DIO driver for our Microcontroller Atmel AVR Atmega32
Any
questions
…?
www.imtschool.com

ww.facebook.com/imaketechnologyschool/

This material is developed by IMTSchool for educational use only


All copyrights are reserved

You might also like