0% found this document useful (0 votes)
59 views

Microcontroller and Embeddes System - ARM Program Optimization 5

The document discusses various components of an embedded system including the core processor, memory, sensors, actuators, displays, motors, user interfaces, communication interfaces, embedded firmware, reset circuits, brown-out protection circuits, oscillators, and real-time clocks. It describes the purpose and basic functionality of these components.

Uploaded by

Remya Bharathy
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
59 views

Microcontroller and Embeddes System - ARM Program Optimization 5

The document discusses various components of an embedded system including the core processor, memory, sensors, actuators, displays, motors, user interfaces, communication interfaces, embedded firmware, reset circuits, brown-out protection circuits, oscillators, and real-time clocks. It describes the purpose and basic functionality of these components.

Uploaded by

Remya Bharathy
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

21CS43:

MICROCONTROLLER AND
EMBEDDED SYSTEMS
MODULE 4
Syllabus- Module 4 2

➢ Embedded System Components: ➢ Core of an Embedded System


o Embedded Vs General computing system o Types of processor/controller,

o Memory
o History of embedded systems
o Sensors,
o Classification of Embedded systems
o Actuators
o Major applications areas of embedded
o LED, 7 segment LED display
systems
o Stepper motor, Keyboard, Push button switch,
o Purpose of embedded systems. o Communication Interface (onboard and external types),

o Embedded firmware,

o Other system components.


EMBEDDED FIRMWARE 3

➢ Embedded firmware refers to the control algorithm (Program instructions) and


or the configuration settings that an embedded system developer dumps into the
code (Program) memory of the embedded system.
➢ There are various methods available for developing the embedded firmware.
1. Write the program in high level languages like Embedded C/C++ using an Integrated
Development Environment (IDE)[ IDEs are different for different processors]

2. Write the program in Assembly language using the instructions supported by your
application’s target processor/controller.
Embedded Firmware 4

➢ The instruction set for each family of processor/controller is different and the
program written in either of the methods should be converted into a processor
understandable machine code before loading it into the program memory.
➢ The process of converting the program written in either a high level language or
processor/controller specific Assembly code to machine readable binary code is
called ‘HEX File Creation’.
o If the program is written in Embedded C/C++ using an IDE, the cross compiler included
in the IDE converts it into corresponding processor/controller understandable ‘HEX File’.

o If you are following the Assembly language based programming technique, you can use
the utilities supplied by the processor/controller vendors to convert the source code into
‘HEX File’.
Embedded Firmware 5

➢ Two types of control algorithm design exist in embedded firmware development.


➢ The first type of control algorithm development is known as the infinite loop or
‘super loop’ based approach, where the control flow runs from top to bottom and
then jumps back to the top of the program in a conventional procedure.
o It is similar to the while (1) { }; based technique in C.

➢ The second method deals with splitting the functions to be executed into tasks
and running these tasks using a scheduler which is part of a General Purpose or
Real Time Embedded Operating System (GPOS/RTOS).
Other System Components 6

➢ Refer to the components/circuits/ICs which are necessary for the proper


functioning of the embedded system.
o Watchdog timer, Reset IC (or passive circuit), brown-out protection IC (or passive
circuit), etc. are examples of circuits/ICs which are essential for the proper functioning of
the processor/ controllers.

➢ Some of the controllers or SoCs integrate these components within a single IC


and doesn’t require such components externally connected to the chip for proper
functioning.
➢ Depending on the system requirement, the embedded system may include other
integrated circuits for performing specific functions, level translator ICs for
interfacing circuits with different logic levels, etc.
Reset Circuit 7

➢ The reset circuit is essential to ensure that the device is not operating at a voltage level
where the device is not guaranteed to operate, during system power ON.

➢ The reset signal brings the internal registers and the different hardware systems of the
processor/controller to a known state and starts the firmware execution from the reset
vector
o Normally from vector address 0x0000 for conventional processors/controllers.

o The reset signal can be either active high or active low.

➢ Since the processor operation is synchronized to a clock signal, the reset pulse should be
wide enough to give time for the clock oscillator to stabilize before the internal reset state
starts.
Reset Circuit 8
Reset Circuit 9

➢ The reset signal to the processor can be applied at power ON


through an external passive reset circuit comprising a Capacitor
and Resistor or through a standard Reset IC like MAX810 from
Maxim Dallas.
➢ Select the reset IC, based on the type of reset signal and logic level
(CMOS/TTL) supported by the processor/controller in use.
➢ Some microprocessors/controllers contain built-in internal reset
circuitry and they don't require external reset circuitry.
Brown-out Protection Circuit 10

➢ Brown-out protection circuit prevents the processor/controller from


unexpected program execution behaviour when the supply voltage to the
processor/controller falls below a specified voltage.

➢ It is essential for battery powered devices since there are greater chances
for the battery voltage to drop below the required threshold.
o The processor behaviour may not be predictable if the supply voltage falls below
the recommended operating voltage.

o It may lead to situations like data corruption.


Brown-out Protection Circuit 11

➢ A brown-out protection circuit holds the processor/controller in


reset state, when the operating voltage falls below the threshold,
until it rises above the threshold voltage.
➢ Certain processors/controllers support built in brown-out
protection circuit which monitors the supply voltage internally.
➢ If the processor/controller doesn't integrate a built-in brown-out
protection circuit, the same can be implemented using external
passive circuits or supervisor ICs.
Brown-out Protection Circuit 12

➢ The Zener diode DZ and transistor Q forms the heart of this circuit.

➢ The transistor conducts always when the supply voltage VCC is


greater than that of the sum of VBE and VZ (Zener voltage).

➢ The transistor stops conducting when the supply voltage falls below
the sum of VBE and VZ .
o Select the Zener diode with required voltage for setting the low threshold
value for VCC.

o The values of R1, R2, and R3 can be selected based on the electrical
characteristics of the transistor in use.

➢ Microprocessor Supervisor ICs like DS1232 from Maxim also provides


Brown-out protection.
Oscillator Unit 13

➢ A microprocessor/microcontroller is a digital device made up of digital


combinational and sequential circuits.
➢ The instruction execution of a microprocessor/controller occurs in sync
with a clock signal.
➢ The oscillator unit of the embedded system is responsible for generating
the precise clock for the processor.
➢ Certain processors/controllers integrate a built-in oscillator unit and
simply require an external ceramic resonator/quartz crystal for producing
the necessary clock signals.
Oscillator Unit 14
Oscillator Unit 15

➢ Certain devices may not contain a built-in oscillator unit and require the
clock pulses to be generated and supplied externally.
➢ The speed of operation of a processor is primarily dependent on the clock
frequency.
o However we cannot increase the clock frequency blindly for increasing the speed
of execution.

➢ The logical circuits lying inside the processor always have an upper
threshold value for the maximum clock at which the system can run,
beyond which the system becomes unstable and non functional.
Oscillator Unit 16

➢ The total system power consumption is directly proportional to

the clock frequency.


o The power consumption increases with increase in clock frequency.

➢ The accuracy of program execution depends on the accuracy of

the clock signal.


o The accuracy of the crystal oscillator or ceramic resonator is
normally expressed in terms of +/-ppm (Parts per million).
Real-Time Clock (RTC) 17

➢ Real-Time Clock (RTC) is a system component responsible for keeping track of time.

➢ RTC holds information like current time (In hours, minutes and seconds) in 12 hour/24
hour format, date, month, year, day of the week, etc. and supplies timing reference to the
system.

➢ RTC is intended to function even in the absence of power.

➢ RTCs are available in the form of Integrated Circuits from different semiconductor
manufacturers like Maxim/Dallas, ST Microelectronics etc.

➢ The RTC chip contains a microchip for holding the time and date related information and
backup battery cell for functioning in the absence of power, in a single IC package.

➢ The RTC chip is interfaced to the processor or controller of the embedded system.
Real-Time Clock (RTC) 18

➢ For Operating System based embedded devices, a timing reference is essential for
synchronising the operations of the OS kernel.

➢ The RTC can interrupt the OS kernel by asserting the interrupt line of the
processor/controller to which the RTC interrupt line is connected.
o The OS kernel identifies the interrupt in terms of the Interrupt Request (IRQ) number generated
by an interrupt controller.

o One IRQ can be assigned to the RTC interrupt and the kernel can perform necessary operations
like system date time updation, managing software timers, etc. when an RTC timer tick interrupt
occurs.

➢ The RTC can be configured to interrupt the processor at predefined intervals or to interrupt
the processor when the RTC register reaches a specified value (used as alarm interrupt).
Watchdog Timer 19

➢ A watchdog timer, or simply a watchdog, is a hardware timer for


monitoring the firmware execution and resetting the system
processor/microcontroller when the program execution hangs up.

➢ Depending on the internal implementation, the watchdog timer


increments or decrements a free running counter with each clock
pulse and generates a reset signal to reset the processor if the
count reaches zero for a down counting watchdog, or the highest
count value for an up counting watchdog.
Watchdog Timer 20
Watchdog Timer 21

➢ If the watchdog counter is in the enabled state, the firmware can write a zero
(for up counting watchdog implementation) to it before starting the execution of
a piece of code (which is susceptible to execution hang up) and the watchdog
will start counting.
➢ If the firmware execution doesn't complete due to malfunctioning, within the
time required by the watchdog to reach the maximum count, the counter will
generate a reset pulse and this will reset the processor.
➢ If the firmware execution completes before the expiration of the watchdog timer
you can reset the count by writing a 0 (for an up counting watchdog timer) to the
watchdog timer register.
Watchdog Timer 22
➢ Most of the processors implement watchdog as a built-in component and provides status
register to control the watchdog timer (like enabling and disabling watchdog functioning) and
watchdog timer register for writing the count value.
o Can be a built in watchdog timer, or an external watchdog timer IC circuit.

o The Microprocessor supervisor IC DS1232 integrates a hardware watchdog timer in it.

➢ The external watchdog timer uses hardware logic for enabling/disabling, resetting the
watchdog count, etc. instead of the firmware based 'writing' to the status and watchdog timer
register.

➢ In modern systems running on embedded OS, the watchdog can be implemented in such a way
that when a watchdog timeout occurs, an interrupt is generated instead of resetting the
processor.
o The interrupt handler for this handles the situation in an appropriate fashion.
PCB and Passive Components 23

➢ Printed Circuit Board (PCB) is the backbone of every embedded system.

➢ After finalising the components and the inter-connection among them, a schematic design is
created and according to the schematic, the PCB is fabricated.
o PCB acts as a platform for mounting all the necessary components as per the design requirement.

o Also it acts as a platform for testing the embedded firmware.

➢ Apart from the subsystems mentioned already, passive electronic components like resistor,
capacitor, diodes, etc. are also found on the board.
o They are the co-workers of various chips contained in the embedded hardware.

o They are very essential for the proper functioning of your embedded system.

o For example for providing a regulated ripple-free supply voltage to the system, a regulator IC and
spike suppressor filter capacitors are very essential.

You might also like