0% found this document useful (0 votes)
151 views7 pages

Embedded Firmware

Embedded firmware refers to the control algorithm and configuration settings that are programmed into an embedded system. It can be developed using high-level languages or assembly code and compiled into machine code. Embedded systems require components like a reset circuit, brown-out protection, oscillator, and real-time clock to function properly.

Uploaded by

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

Embedded Firmware

Embedded firmware refers to the control algorithm and configuration settings that are programmed into an embedded system. It can be developed using high-level languages or assembly code and compiled into machine code. Embedded systems require components like a reset circuit, brown-out protection, oscillator, and real-time clock to function properly.

Uploaded by

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

 Embedded Firmware

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. It is an un-avoidable part of an embedded system. There are various
methods available for developing the embedded firmware. They are listed below.

(a) Write the program in high level languages like Embedded C/C++ using an Integrated
Development Environment (The IDE will contain an editor, compiler, linker, debugger, simulator,
etc. IDEs are different for different family of processors/controllers. For example, Keil micro
vision3 IDE is used for all family members of 8051 microcontroller, since it contains the generic
8051 compiler C51).

(b) Write the program in Assembly language using the instructions supported by your application’s
target processor/controller.

The instruction set for each family of processor/controller is different and the program written in
either of the methods given above should be converted into a processor understandable machine
code before loading it into the program memory.

 The process of converting a program written in a high-level language or processor-specific


assembly code into machine-readable binary code is called 'HEX File Creation'.

 The methods used for HEX File Creation may differ depending on the programming
techniques used.

 If the program is written in Embedded C/C++ using an Integrated Development Environment


(IDE), the cross-compiler included in the IDE converts it into a corresponding
processor/controller understandable HEX File.

 If the programmer is using an Assembly language-based programming technique, they can


use utilities provided by the processor/controller vendors to convert the source code into a
HEX File.

 Third-party tools are also available, which may be free of cost, for this conversion.
1. Reset Circuit:

Figure 1: RC based reset circuit

 The reset circuit is necessary to ensure that electronic devices do not operate at a
voltage level where they may not function correctly during system power ON.
 The reset signal puts the internal registers and different hardware systems of the
processor/controller in a known state and starts firmware execution from the reset
vector.
 The reset vector is typically located at vector address 0x0000 for conventional
processors/controllers, but it can be relocated to a different address for
processors/controllers supporting a bootloader.
 The reset signal can be either active high or active low, depending on the processor's
requirements.
 The processor operates synchronously with a clock signal, so the reset pulse must be
wide enough to allow the clock oscillator to stabilize before the internal reset state
begins.
 The reset signal can be applied at power ON through an external passive reset circuit
composed of a capacitor and resistor or through a standard Reset IC like MAX810
from Maxim Dallas.
 The selection of the reset IC should be based on the type of reset signal and logic
level (CMOS/TTL) supported by the processor/controller in use.
 Some microprocessors/controllers have built-in internal reset circuitry and do not
require external reset circuitry.
 Figure 1 shows a resistor capacitor-based passive reset circuit for active high and low
configurations.
 The reset pulse width can be adjusted by changing the resistance value R and
capacitance value C of the circuit.
2. Brown-out Protection Circuit:

Figure 2: Brown-out protection circuit with Active low output

 Brown-out protection circuit is used to prevent unexpected program execution


behavior of a processor/controller when the supply voltage falls below a certain
level.
 It is particularly important for battery-powered devices since the battery voltage may
drop below the required threshold.
 If the supply voltage falls below the recommended operating voltage, the behavior of
the processor/controller may not be predictable, and it may lead to situations like
data corruption.
 The brown-out protection circuit holds the processor/controller in a reset state when
the operating voltage falls below the threshold until it rises above the threshold
voltage.
 Some processors/controllers have built-in brown-out protection circuitry that
monitors the supply voltage internally.
 If the processor/controller does not have built-in brown-out protection circuitry, an
external passive circuit or supervisor IC can be used to implement it.
 The figure 2 illustrates a brown-out circuit implementation using a Zener diode and
transistor for a processor/controller with active low reset logic.
 The Zener diode Dz and transistor Q form the heart of this circuit. The transistor
conducts when the supply voltage V cc is greater than the sum of V BE and Vz (Zener
voltage) and stops conducting when the supply voltage falls below the sum of V BE and
Vz.
 The Zener diode's voltage is selected to set the low threshold value for Vcc.
 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 Dallas also provide Brown-
out protection.

3. Oscillator Unit:

Figure 3: Oscillator circuitry using quartz crystal and quartz crystal oscillator

 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.
 Certain processors/controllers integrate a built-in oscillator unit and simply require
an external ceramic resonator/quartz crystal for producing the necessary clock
signals.
 Quartz crystals and ceramic resonators are equivalent in operation, however they
possess physical difference.
 A quartz crystal is normally mounted in a hermetically sealed metal case with two
leads protruding out of the case.
 Certain devices may not contain a built-in oscillator unit and require the clock pulses
to be generated and supplied externally.
 Quartz crystal Oscillators are available in the form of chips and they can be used for
generating the clock pulses in such cases.
 The speed of operation of a processor is primarily dependent on the clock frequency.
 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.
 The total system power consumption is directly proportional to the clock frequency.
 The power consumption increases with an increase in clock frequency.
 The accuracy of program execution depends on the accuracy of the clock signal.
 The accuracy of the crystal oscillator or ceramic resonator is normally expressed in
terms of +/-ppm (Parts per million).
 Figure 3 illustrates the usage of quartz crystal/ceramic resonator and external
oscillator chip for clock generation.

4. Real-Time Clock (RTC):


 Real-Time Clock (RTC) is responsible for keeping track of time in an embedded
system.
 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 as Integrated Circuits (ICs) 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.
 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.
 The OS kernel identifies the interrupt in terms of the Interrupt Request (IRQ) number
generated by an interrupt controller.
 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 an
alarm interrupt).

5. Watchdog timer:
Figure 4: Watchdog timer for fi rmware execution supervision

 In desktop Windows systems, 'Ctrl + Alt + Del' can be used to come out of an
abnormal situation, but this is not available in embedded systems.
 Embedded systems have a watchdog timer to monitor the firmware execution and
reset the system processor/microcontroller if the program execution hangs up.
 The watchdog timer is a hardware timer that 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.
 The firmware can write a zero to the watchdog timer register before starting the
execution of a piece of code that is susceptible to execution hang up, and the
watchdog will start counting. If the firmware execution doesn't complete within the
time required by the watchdog to reach the maximum count, the counter will
generate a reset pulse and reset the processor.
 Most processors have a built-in watchdog timer and provide a status register to
control the watchdog timer and a watchdog timer register for writing the count
value. If the processor doesn't contain a built-in watchdog timer, an external
watchdog timer IC circuit can be used.
 The Microprocessor supervisor IC DS1232 integrates a hardware watchdog timer in
it.
 In modern systems running on embedded operating systems, the watchdog can be
implemented in such a way that when a watchdog timeout occurs, an interrupt is
generated instead of resetting the processor.
 The interrupt handler for the watchdog timeout situation handles the situation in an
appropriate fashion.
 Figure 4 illustrates the implementation of an external watchdog timer based
microprocessor supervisor circuit for a small scale embedded system.

6. Role of PCB in embedded systems


 Printed Circuit Board (PCB) is a crucial component of every embedded system.
 Once the components and interconnections are finalized, a schematic design is
created, and the PCB is fabricated accordingly.
 The PCB serves as a platform for mounting all the necessary components required for
the design.
 The PCB also serves as a platform for testing the embedded firmware.
 Along with the critical subsystems, passive electronic components like resistors,
capacitors, diodes, etc., can also be found on the board.
 These passive components are essential for the proper functioning of the embedded
system.
 For instance, a regulator IC and spike suppressor filter capacitors are necessary for
providing a regulated, ripple-free supply voltage to the system.

You might also like