Chapter Two
Chapter Two
1
2.1 Architecture of Embedded System
Architecture of the Embedded System includes Sensor, Analog to Digital Converter, Memory,
Processor, Digital to Analog Converter, and Actuators etc. The below figure illustrates the
overview of basic architecture of embedded systems
:
Fig 2.3 Embedded system architecture block diagram
Embedded System Development Life Cycle (ESDLC):
Developing an embedded system mainly goes through the following development steps:
1. Requirement analysis 3. Design 5. Test 7. Maintenance
2. Examine 4. Develop 6. Deploy
Advantages of Embedded System :
Embedded systems are fast in performance.
These systems consumes less power
Small in shape and size.
These systems are so scalable and reliable.
Works on wide variety of sectors and environments.
Improve product quality and enhance performance.
Performs specific tasks without error.
Disadvantages of Embedded System :
Difficult to backup of embedded files.
Sometimes complex to develop.
Integration may be a problem.
Offer very limited resources for processing.
Troubleshooting may be difficult.
Maintenance may be a problem
2
2 .2 ARM Cortex M0+ Hardware Overview
The ARM (Advanced RISC Machines) Cortex-M0+ processor is the most energy-efficient Arm
processor available for constrained embedded applications. The Cortex-M0+ processor builds on
the very successful Cortex-M0 processor, retaining full instruction set and tool compatibility, while
further reducing energy consumption and increasing performance.
The exceptionally small silicon area, low power and minimal code footprint of Cortex-M0+ enables
developers to achieve 32-bit performance at an 8-bit price point, bypassing the step to 16-bit
devices. The Cortex-M0+ processor come with a wide selection of options to provide flexible
development.
4
Four channel Multi-Rate Timer (MRT) for repetitive interrupt generation at up to four programmable,
fixed rates.
Self Wake-up Timer (WKT) clocked from either the IRC, a low-power, low-frequency
internal oscillator, or an external clock input in the always-on power domain.
Windowed Watchdog timer (WWDT).
Analog peripherals:
One 12-bit ADC with up to 12 input channels with multiple internal and external trigger
inputs and with sample rates of up to 1.2 M samples. The ADC supports two independent
conversion sequences.
Serial peripherals:
One USART interface with pin functions assigned through the switch matrix and one
fractional baud rate generator.
Two SPI controllers with pin functions assigned through the switch matrix.
One I2C-bus interface. Supports Fast-mode Plus with 1 Mbit/s data rates on the open-drain
pins and listen mode.
Clock generation:
12 MHz internal RC oscillator trimmed to 1.5 % accuracy that can optionally be used as a
system clock.
Crystal oscillator with an operating range of 1 MHz to 25 MHz.
Programmable watchdog oscillator with a frequency range of 9.4 kHz to 2.3 MHz.
PLL allows CPU operation up to the maximum CPU rate without the need for a high-
frequency crystal. May be run from the system oscillator, the external clock input, or the
internal RC oscillator.
Clock output function with divider that can reflect all internal clock sources.
Power control:
Power consumption in active mode as low as 90 uA/MHz in low-current mode using the IRC
as the clock source.
Integrated PMU (Power Management Unit) to minimize power consumption.
Reduced power modes: Sleep mode, Deep-sleep mode, Power-down mode, and Deep power-
down mode.
Wake-up from Deep-sleep and Power-down modes on activity on USART, SPI, andI2C
peripherals.
Timer-controlled self wake-up from Deep power-down mode.
5
Power-On Reset (POR).
Brownout detects (BOD).
Embedded System is an electronic system or device which employs both hardware and software. A
processor or controller takes input from the physical world peripherals like sensors, actuators etc.,
processes the same through appropriate software and provides the desired output. Each
communicating entity should agree to some protocol to exchange information. Many different
protocols are available for embedded systems and are deployed depending upon the application
area.
Types of Communication Protocols in Embedded Systems
2.3.1 Parallel and Serial Communication
Parallel Communication
In parallel communication, all the bits of data are transmitted simultaneously on separate
communication lines. Transmission is fast however parallel communication is costly as because to
transmit n bit, n wires or lines are required. For this reason, they are usually use for shorter distance
transmission such as in printers and hard disks.
6
2.3.2 Serial Communication
For serial communication, the data bits are transmitted serially bit by bit on single communication
lines. They are hence less costly and can be used for long distance transmission such as in telephone
communications.
7
Data is transmitted in the form of packets where two devices communicate each other. Data packets
compose of 8 bits (byte) with LSB (Least Significant Bit) transmitted first.
Advantages USB Disadvantages USB
Fast and simple. Needs powerful master device.
It is of low cost. Specific drivers are required.
Plug and Play hardware.
8
Advantages of UART/ USART Disadvantages of UART/ USART
Clock signal is not required Doesn’t support multiple master slave functionality
Cost effective Baud rate of communicating UART should be within 10 bps
Uses parity bit for error detection
A. I2C Protocol
B. SPI Protocol
C. CAN Protocol
A. I2C Protocol
10
Advantages of SPI Communication Protocols
11
Advantages of CAN Communication Protocols
Automotive oriented
Bit complex protocol
The AVR (Alf Vegard RISC) microcontroller is based on the Advanced Reduced Instruction Set
Computer (RISC) architecture. ATmega32 microcontroller is a low power CMOS technology based
controller. Due to RISC architecture AVR microcontroller can execute 1 million of instructions per
second if cycle frequency is 1 MHz provided by crystal oscillator.
12
The CPU components are shaded blue.
The memory components are shaded green.
The clock components are shaded in orange.
The I/O components are shaded in purple
13
ATmega32 Highlights
Native data size is 8 bits (1 byte).
Uses 16-bit data addressing allowing it to address 216 = 65536 unique addresses.
Has three separate on-chip memories
2KB SRAM
8 bits wide
used to store data
1KB EEPROM
8 bits wide
used for persistent data storage
32KB Flash
16 bits wide
used to store program code
I/O ports A-D
Digital input/output
Analog input
Serial/Parallel
Pulse accumulator
14