Assignment 2 Embedded System (2) Update
Assignment 2 Embedded System (2) Update
Assignment 2 Embedded System (2) Update
1. How does the processor, RAM, ROM and I/O units organized?
2. What is the significance of ARM processor?
-----Advanced RISC Machine (ARM) Processor is considered to be family of Central Processing Units
that is used in music players, smartphones, wearables, tablets and other consumer electronic
devices.
The architecture of ARM processor is created by Advanced RISC Machines, hence name ARM. This
needs very few instruction sets and transistors. It has very small size. This is reason that it is perfect
fit for small size devices. It has less power consumption along with reduced complexity in its
circuits.
They can be applied to various designs such as 32-bit devices and embedded systems. They can even
be upgraded according to user needs.
The main features of ARM Processor are mentioned below
1. Multiprocessing Systems –
ARM processors are designed so that they can be used in cases of multiprocessing
systems where more than one processors are used to process information. First AMP
processor introduced by name of ARMv6K had ability to support 4 CPUs along with its
hardware.
3. Memory Management –
ARM processor has management section. This includes Memory Management Unit and
Memory Protection Unit. These management systems become very important in
managing memory efficiently.
4. Thumb-2 Technology –
Thumb-2 Technology was introduced in 2003 and was used to create variable length
instruction set. It extends 16-bit instructions of initial Thumb technology to 32-bit
instructions. It has better performance than previously used Thumb technology.
6. Pipelining –
Processing of instructions is done in parallel using pipelines. Instructions are broken
down and decoded in one pipeline stage. The pipeline advances one step at a time to
increase throughput (rate of processing).
Large number of registers –
Large number of registers are used in ARM processor to prevent large amount of memory
interactions. Registers contain data and addresses. These act as local memory store for all
operations
4. What is a thread?
---- A thread on the other hand is defined as “a semi-independent program segment that
executes within a process”. For embedded software developers working with microcontrollers, a
process is essentially the entire application that runs on the system. A thread is then a small
program that has a specific function and purpose within the overall application. Threads tend to
be lower level than tasks and have minimal overhead.
6. What is an exception?
--- Exceptions and interrupts are unexpected events which will disrupt the normal flow of
execution of instruction(that is currently executing by processor). An exception is an unexpected
event from within the processor. Interrupt is an unexpected event from outside the process.
7. What is meant by a pipe?
--- A pipe is simply a set of storage locations, each big enough to hold a single data item of user-
defined byte length, access to which is controlled so that it may be safely utilized by multiple
tasks.
Still wondering where can you find embedded systems? Whether you work in a restaurant, office,
health practice, factory or other environment, your workplace is full of systems that are built with
embedded devices, like elevators, printers, routers and point of sale systems. In brief, they can be
found everywhere in our society — from vehicles and EV charging stations to vending machines,
lottery ticket systems and digital signage to sophisticated medical equipment.
Here are some of the reasons why embedded systems are becoming prevalent across the globe:
• They are small, fast, and powerful computers used in many devices and equipment we use
daily.
• They guarantee the performance of real-time applications.
• They are responsible for the completion of a task within a specified time limit, such as rapid
graphics processing and artificial intelligence processing.
Additionally, embedded modules are becoming more sophisticated and powerful all the time,
and are increasing in graphics performance and edge compute capabilities, giving embedded
developers the tools to bring high-performance market-driven products to market.
Concept The pipe is the Unix IPC form to provide a Message Queue is a System VIPC
1 flow of information in one direction. form to store a list of messages.
Creation A pipe can be created using pipe() A message queue is created using
function which returns two file msgget() function which returns a
2 descriptors, one is for reading and another queue identifier.
is for writing.
Data Data can be fetched in FIFO, First In First Data can be fetched in any order.
4 Fetching Out manner.
Priorities Priorities are not present in pipes. A message can have a priority by
5 attaching a priority number to
type(s) of the message(s).
Receiver For a pipe to function, sender and receiver In a message queue, a writer
processes should be present to wait for process can write a message and
6
messages to be written and read in a pipe. exit. A reader process can read a
message later.
Persistence A pipe is deleted from the system if there A message queue remains active in
7 is no linked receiver/sender process is the system until explicitly deleted by
present. some process.
Message A pipe message size can be up to 4096 A message queue message size can
8 Size Bytes. be up to 8192 Bytes.
USB is a polled bus, where the host initiates all data exchanges.
Transactions
1. The token packet is the header defining the transaction type and direction, the device
address, and the endpoint.
2. Data is transferred in a data packet.
3. The final status of the transaction is acknowledges in the handshake packet.
Pipe Model
In a transaction, data is transferred either from the USB Host to an USB Device or vice-versa. The
transfer direction is specified in the token packet that is sent from the USB Host. Then, the source
sends a data packet or indicates it has no data to transfer. In general, the destination responds with a
handshake packet indicating whether the transfer was successful.
Packet Model
Packets
Packets could be thought of as the smallest element of data transmission. Each packet transmits an
integral number of bytes at the current transmission rate. Packets start with a synchronization pattern,
followed by the data bytes of the packet, and concluded with an End-of-Packet (EOP) signal. All USB
packet patterns are transmitted least significant bit first. Before and after the packet, the bus is
in idle state.
12. Critically investigate about the utility of context, interrupt latency and interrupt service deadline
in the field of embedded systems.
13. Describe properly about interrupt-servicing mechanism. What do you mean by nonmaskable
and maskable interrupts?
14. State and explain about the design challenges faced during the design process of an embedded
system.
15. What is a serial port?
----. In computing, a serial port is a serial communication interface through which information
transfers in or out sequentially one bit at a time. This is in contrast to a parallel port, which
communicates multiple bits simultaneously in parallel.
In this transmission, users have to wait till Here, users do not have to wait for the
the transmission is complete before getting completion of transmission in order to get
5. a response back from the server. a response from the server.
----- The Universal Serial Bus standard has been extremely successful. USB ports and cables are used
to connect hardware such as printers, scanners, keyboards, mice, flash drives, external hard drives,
joysticks, cameras, monitors, and more to computers of all kinds, including desktops, tablets,
laptops, netbooks, etc.
In fact, USB has become so common that you'll find the connection available on nearly any
computer-like device such as video game consoles, home audio/visual equipment, and even in many
automobiles.
Before USB, many of those devices would attach to a computer over serial and parallel ports, and
others like PS/2.
Many portable devices, like smartphones, eBook readers, and small tablets, use USB primarily for
charging. USB charging has become so common that it's now easy to find replacement electrical
outlets at home improvement stores with USB ports built in, negating the need for a USB power
adapter.
21. What do you mean by the buses for networking of serial devices and buses for networking of
parallel devices?
22. With neat diagram show how parallel port interfacing can be done with touch screen.
23. With the help of block Diagram, establish CPU Interfacing With data and program Memory In PIC
microcontroller.
24. What is the advantage and disadvantage of of disabling interrupts from during the running of a
critical section of a process?
25. How does use of a counting semaphore differ from a mutex? Comment also about the
application process of counting semaphore.
----
Parameters Semaphore Mutex
Mechanism It is a type of signaling mechanism. It is a locking mechanism.
Data Type Semaphore is an integer variable. Mutex is just an object.
The wait and signal operations can modify It is modified only by the process that
Modification
a semaphore. may request or release a resource.
If no resource is free, then the process If it is locked, the process has to wait.
Resource requires a resource that should execute The process should be kept in a queue.
management wait operation. It should wait until the This needs to be accessed only when
count of the semaphore is greater than 0. the mutex is unlocked.
There are the scenarios in which more than one processes need to execute in critical section
simultaneously. However, counting semaphore can be used when we need to have more than one
process in the critical section at the same time.
The programming code of semaphore implementation is shown below which includes the structure of
semaphore and the logic using which the entry and the exit can be performed in the critical section.
In this mechanism, the entry and exit in the critical section are performed on the basis of the value of
counting semaphore. The value of counting semaphore at any point of time indicates the maximum
number of processes that can enter in the critical section at the same time.
A process which wants to enter in the critical section first decrease the semaphore value by 1 and then
check whether it gets negative or not. If it gets negative then the process is pushed in the list of blocked
processes (i.e. q) otherwise it gets enter in the critical section.
When a process exits from the critical section, it increases the counting semaphore by 1 and then checks
whether it is negative or zero. If it is negative then that means that at least one process is waiting in the
blocked state hence, to ensure bounded waiting, the first process among the list of blocked processes
will wake up and gets enter in the critical section.
The processes in the blocked list will get waked in the order in which they slept. If the value of counting
semaphore is negative then it states the number of processes in the blocked state while if it is positive
then it states the number of slots available in the critical section.
GCC contains support for many languages (C, C++, Fortran, to name but a few). It's highly portable, and
widely used, and tends to produce good code. It can also be used as a cross-compiler (compiling for a
system other than the one running GCC).
It's the default compiler choice for most Unix-type systems because most vendors don't bother to
write their own compilers anymore - GCC is just too good for general use.
Under Windows, Microsoft's own dev tools are often preferred because they get support for new
technologies quicker.
In high-performance programming environments (and some embedded environments) you may want
a compiler that's more highly tuned to the chip/system in question.
34. Explain the importance of the following declarations for real time application model: static,
volatile and interrupt in embedded C.
35. What is System-on-Chip (SoC) and IrDA?
---. A system on a chip, also known as an SoC, is essentially an integrated circuit or an IC that
takes a single platform and integrates an entire electronic or computer system onto it. It is,
exactly as its name suggests, an entire system on a single chip. The components that an SoC
generally looks to incorporate within itself include a central processing unit, input and output
ports, internal memory, as well as analog input and output blocks among other things. Depending
on the kind of system that has been reduced to the size of a chip, it can perform a variety of
functions including signal processing, wireless communication, artificial intelligence and more.
The Infrared Data Association (IrDA) is an industry-driven interest group that was founded in
1994[1] by around 50 companies. IrDA provides specifications for a complete set of protocols for
wireless infrared communications, and the name "IrDA" also refers to that set of protocols. The
main reason for using the IrDA protocols had been wireless data transfer over the "last one
meter" using point-and-shoot principles. Thus, it has been implemented in portable devices such
as mobile telephones, laptops, cameras, printers, and medical devices. The main characteristics
of this kind of wireless optical communication are physically secure data transfer, line-of-
sight (LOS) and very low bit error rate (BER) that makes it very efficient.
36. What is validation?
--- Validation is the “determination of the correctness of the final program or software produced
from a development project with respect to the user needs and requirements.
42. Why the new age microcontrollers are smarter than the older ones?
43. Make a classification of PIC microcontrollers on the basis of internal structures.
44. What are the different memory options available for PIC microcontrollers?
--- PIC memory organization divided into 3 types of memories: Program Memory, Data Memory,
and Data EEPROM.
45. Which is the entity controlling (scheduling) the transitions from one state to another in a task?
--- Schedulers are responsible for transferring a process from one state to the other.
50. Any application based embedded software of a given system is built up after selecting an
appropriate programming languge. What are the criterias of choosing the appropriate
programming language?
51. Analyse the feature in C that makes it popular high level language for an embedded system.
---- Although not originally designed for embedded software development, the C language allows
a range of programming styles from high-level application code down to direct low-level
manipulation of hardware registers. As a result, C has become the most popular programming
language for embedded systems today.
52. Why do you break a program into header files, configuration files, modules and function?
53. Why do you use an infinite loop in embedded software? Explain with proper justification.
----- Infinite loops are used in embedded systems so as to repeat the task required to be performed by
the system. By this the embedded system designed remains functional through out its usage.
Personal computers have an operating system and once the program is executed, It returns control on
the operating system, where as on the other hand Embedded systems do not have an operating
system and therefore we cannot let the control fall out of the program.
56. What is the difference between serial port and parallel port?
------
Serial Key
Ports
Purpose Serial Port is used for serial data Parallel Port is used for parallel
1
transmission. data transmission.
Redundancy Bottom-Up model is better suited as Top-down model has high ratio
it ensures minimum data of redundancy as the size of
3
redundancy and focus is on re- project increases.
usability.
Serial Key
Ports
No. Of Wires Wire connections to serial port are No. of wires that are connected
4 quiet less as compared to parallel to parallel port are quiet high as
port. compared to serial port.
Basic Principle Flip-flop utilizes an edge triggering approach. Latch follows a level triggering approach.
Clock Signal The clock signal is present. The clock signal is absent.
Designed You can design it using Latches along with a You can design it using Logic gates.
Using clock.
Sensitivity Flip-flop is sensitive to the applied input and Latches are sensitive to the applied input
the clock signal. signal- only when enabled.
Operating It has a slow operating speed. It has comparatively fast operating speed.
Speed
Classification You can classify a flip-flop into a synchronous A user cannot classify the Latch this way.
or asynchronous flip-flop.
Even if your chip is ARM and you have MB of RAM, 1 Gbit data rate from a CMOS camera chip can max
you out pretty fast. The best example that comes to mind is processing image flow on ARM9
processor.
I have coded a consumer thread function that would run multiple consumers in order to process large
amount of data without draining RAM. I can see lots of uses of re-entrant functions in protocol stacks
in the embedded , personal computer, and server world.
In my case, I could split a large data pieces into smaller pieces and use the same thread call as 8
consumers. RAM consumption and memory manipulation on smaller data pieces had a significantly
smaller footprint.
My bottle neck was IO on both sides of the re-entrant function(s). Having multiple consumers enabled
me to have IO going pretty much non-stop. While one consumer is processing data, another consumer
is using IO read/write calls.
---- Polymorphism in C++ allows us to reuse code by creating one function that's usable for multiple
uses. We can also make operators polymorphic and use them to add not only numbers but also
combine strings. This saves time and allows for a more streamlined program.
62. State the utilities and features of JAVA that makes it a highly useful high level language for an
embedded system in many network related applications.
63. Each process or task has an endless loop in preemptive scheduler. How does the control of
resources transfer from one task to another?
64. What do you understand by throwing an exception? Evaluate the exception function handling
during execution of a routine.
---- The object, called an exception object, contains information about the error, including its
type and the state of the program when the error occurred. Creating an exception object
and handing it to the runtime system is called throwing an exception.
65. Examine about the uses of hardware and software assigned priorities in an interrupt
mechanism.
---- Hardware interrupts are used by devices to communicate that they require
attention from the operating system. Internally, hardware interrupts are
implemented using electronic alerting signals that are sent to the processor from an
external device, which is either a part of the computer itself, such as a disk
controller, or an external peripheral.
A software
interrupt
is caused either by an exceptional condition in the processor itself, or a special instruction in the
instruction which causes an
interrupt
when it is executed. The former is often called a trap or exception and is used for
errors or events occurring during program executions that are exceptional enough
that they cannot be handled within the program itself.