Embedded – Interview Questions


What is Embedded System?

  • Embedded system is combination of software + hardware.
  • Example : Air-Conditioner, Washing machine, TV, Mobile phone, etc.

 

 


What is the need for an infinite loop in Embedded systems?

Embedded systems need infinite loops for repeatedly processing/monitoring the state of the program

  • Example:  While(Boolean True) OR for(;;); { //Code }
  • For e.g.
    • Customer care Telephone systems where in a pr-recorded audio file is played in case the dialer is put on hold..
    • Also circuits being responsible for indicating that a particular component is active/alive during its operation by means of LED’s.

 


What is the use of #progma  keyword

  • This is a  pr-processor directive that can be used to turn on or off certain features.
  • It is of two types #pragma startup  , #pragma exit  and #pragma warn  .
    • #pragma startup allows us to specify functions called upon program startup.
    • #pragma exit  allows us to specify functions called upon program exit.

 


How are macros different from inline functions?

Macros :

  • Its used for when the set of instruction/function/task repeatedly run again&  again. Macros is defined by #define macro_name
  • Example : Add the two numbers using macros #define add(a,b) (a+b) , Here the add is the macro name perform the two number addition functionality.
  • The major disadvantage of macros is that they are not really functions and the usual error checking and stepping through of the code does not occur.

Inline :

  • Inline functions are expanded whenever it is invoked rather than the control going to the place where the function is defined and avoids all the activities such as saving the return address when a jump is performed. Saves time in case of short codes.
  • Example :

  • Inline is just a request to the compiler and it is upto to the compiler whether to substitute the code at the place of invocation or perform a jump based on its performance algorithms.

 


What is the use of bit wise operators in embedded system?

  • The bit-wise shift operators are used to move all of the operand left or right a given number of times.

 

 


Explain interrupt latency and how can we decrease it?

  • Interrupt latency basically refers to the time span an interrupt is generated and it being serviced by an appropriate routine defined, usually the interrupt handler.
  • External signals, some condition in the program or by the occurrence of some event, these could be the reasons for generation of an interrupt.
  • Interrupts can also be masked so as to ignore them even if an event occurs for which a routine has to be executed.
  • Following steps could be followed to reduce the latency
    • ISRs being simple and short.
    • Interrupts being serviced immediately
    • Avoiding those instructions that increase the latency period.
    • Also by prioritizing interrupts over threads.
    • Avoiding use of inappropriate APIs.

 


Of the 128-byte internal RAM how many bytes are bit addressable?

  • Only 16 bytes of the 128 bytes of RAM are bit addressable.
  • The bit addressable RAM locations are 20H to 2FH.
  • They are addressed as 0 to 127 (decimal) or 00 to 7F.
  • Also the internal RAM locations 20 to 2FH are both byte and bit addressable.
  • These 16 bytes can be by single bit instructions using only direct addressing mode.

 


Significance of watchdog timer in Embedded Systems.

  • Watchdog timer is basically a timing device that is set for predefined time interval and some event should occur during that time interval else the device generates a time out signal.
  • One application where it is most widely used is when the mobile phone hangs and no activity takes place, in those cases watchdog timer performs a restart of the system and comes to the rescue of the users.
  • It is used to reset to the original state whenever some inappropriate events take place such as too many commands being given at the same time or other activities that result in malfunctioning of the GUI. It is usually operated by counter devices.

 


Difference Between Mutex and Semaphore

  • MutexMutexes are typically used to serialise access to a section of  re-entrant code that cannot be executed concurrently by more than one thread. A mutex object only allows one thread into a controlled section, forcing other threads which attempt to gain access to that section to wait until the first thread has exited from that section
  • SemaphoreA semaphore restricts the number of simultaneous users of a shared resource up to a maximum number. Threads can request access to the resource (decrementing the semaphore), and can signal that they have finished using the resource (incrementing the semaphore)

 


Difference between Harvard and Von Neumann computer architectures

  • There are basically two types of digital computer architectures. The first one is called Von Neumann architecture and later Harvard architecture was adopted for designing digital computers.

Von Neumann Architecture:

 


 What is MicroController ?

 


What is the work of compiler?

Compiler – Source code to Binary code


What is called 8,16,32,64 Bit microcontrollers?

  • 8Bit Operations

  What is SPIFFS?

  • SPIFFSSerial Peripheral Interface Flash File System

What is configuration management?

 It is a system Engineering process for establishing and maintaining consistency of a products performance, functional and  physical attributes with its requirements, design and optional information throughout its life . See more

  • SCM (Software Configuration Management)
  • HCM (Hardware Configuration Management)

 

Refer Website :