When we are talking about the program and its execution we will come up with addresses. All the variables, functions, arrays, etc like whatever we are using to write and execute a program all are saved in memory. Memory will be starting and ending with some memory address. The accessibility to these memories we can do only with memory addresses only. It will give the privilege to the programmer to make changes from a very base level.
It is the information about the data, where it is saved in memory. If you want the address of a variable
you can use the ’&’ address of the operator.
It is the ability of the variable to hold the address of another variable(Points to the address of another variable). The pointer is denoted ‘*’ Asteric symbol. One of the major advantages of the pointer is it will give direct access to the memory address of the variables, functions, arrays, strings, linked list etc..
The size of the pointer is depending upon the size of the memory. For eg, if the memory is 8-bit memory the pointer size will be 8 bit. If it is 16 bit then the pointer will be 16-bit memory.
Let us check an example program.
//integer variable definition
// pointer declaration
// Assigning the address of a to the pointer p.
Printf(“Value of integer a =%d”,a);
Printf(“Value of integer pointer p =%d”,p);
Printf(“Address of integer a =%d”,&a);
Printf(“Address of integer pointer p =%d”,&p);
Printf(“De-referenced value of integer pointer p =%d”,*p);
Top 10 Interview Questions in embedded system with Answers
Every one very curious about the interview questions because you don’t know what type of questions Recruiter will ask so our embedded training institute in Bangalore is offering top 10 questions for students who are eager to get a job in the embedded field. With Professional Training Institute, You can get embedded system training which is 100% practical based training so you can get a place soon. Here see top 10 interview question in the embedded system.
Top 10 Interview Questions by Embedded Training Institute in Bangalore
1) What is the use of the volatile keyword?
I will answer this question in three level
Beginner level (Fresher)
Volatile is the keyword used for optimization by the compiler during code compilation. We are conveying the message to the compiler “Hey look this pieces of code can be modified externally so don’t optimized this code associated with the current variable”
Int volatile vari=1;
Baudrate = 9600;
If we did not make “vari” as volatile then compiler will remove this while loop as the value of “vari” is not going to change anywhere in the program.
Mid-Level (Experience less than 5 years):
Volatile was mainly introduced for the compiler to help in decision taking for code optimization. Until we are using C as application programming there is no impact of Volatile keyword, but as soon as we start handling with Peripheral like timer, ADC, I2C, RTC, IO port, Interrupt service routines(ISRs) then volatile is a most important keyword.
I am sure many times/some time you may face any of below conditions
1) When optimization is off, the code works fine but as soon as optimization is on code give some random error. In some compiler, we are having a different level of optimization. Therefore, up to certain level code works beyond that code gives an error.
2) Sometimes as soon as we start using Interrupt then some random error is generating.
3) In multitasking, system individual task works correctly but multiple tasks together give a problem.
So now consider below example
“static volatile sig_atomic_t signo[_NSIG];”
Here word static is defining the scope of the variable, while word volatile is giving instruction to the compiler that doesn’t optimize the code.
Please note volatile does not control or change the storage class of variable. While static keyword controls the storage class.
Here we are saying that PORTA is defined at address 0x50, asking compiler not to optimized below code, at the same time by using const we are removing any by mistake writing by the user.
While (PORTA == 0xFF)
//do something here
If we did not make PORTA as the volatile compiler will optimized II while loop as he will think I while loop will never fail.
Const means if we write by mistake below the line.
PORTA= 0x55; – Compiler itself will give error.
Senior Level (More than 5 years):
A senior person can include few of above points and refer below advance information.
“An object that has volatile-qualified type may be modified in ways unknown to the implementation or have other unknown side effects. Therefore any expression referring to such an object shall be evaluated strictly according to the rules of the abstract machine.”
The line is taken from C-Open standard. Which clearly says that the volatile keyword should be implemented as an abstract machine. Which clearly means compiler can’t change anything, compiler need to convert C code as it is in
You can refer “ISO/IEC 9899: TC3” for more information.
2) Can a variable be both const and volatile?
This question is already answered above but in short discuss again.
The const keyword makes sure that the value of the variable declared as constant can’t be changed. This statement holds true in the scope of the full program. So if by mistake user tried to write on const variable compiler itself will give the error, and say read-only variable can’t change.
Since variable can’t change anywhere in the code the compiler will be tried to the optimized code associated with this variable, the compiler may think this code will not change in current
So the word volatile is the instruction to the compiler, look compiler although variable is not changing in current scope, it can change from any other unknown factors (Like IO operations, Switch operation, ISR, other Task etc.) so don’t optimize.
3) What is a static variable? Or what is a static keyword?
Both questions are look’s like same but they are different, let’s analyze carefully
What is a Static variable? Any variable we can analyze in two ways
A) The scope of static variable –
1) If the variable is defined in local scope (Means inside of any function, may be either main or any other function), then the scope of static variable will be within a function.
2) If a static variable is defined in global scope (Means not inside any function) then the scope of the variable will be within the file. In the same file, any function can use this variable.
B) Life of scope variable –
1) Life of static variable is throughout the program. No matter it is defined in the local scope or global scope.
Storage class of static variable is Data segment, not stack. Let’s understand this. All local variables are stored in the stack, the stack is RAM memory which is used for temporary storage, all local variable of the function is stored here STACK and once we exit from that function this memory get free. So it means once we exit from function all local
variable has died. But if we want to preserve our variable even after the exit from the function, so that when next time we enter into the same function we should get same old value, in this case, we can define a variable as a STATIC variable.
What is the static keyword in C?
To answer this question you to include all the above points and as well as this static keyword can be applied to function. When any function is defined static then the function will be available into the same file. Other files can’t use that function.
This property is used for when with the same name we have interface other functionality then we can make functions with static scope, and other files also can have a function with the same. While the wrapper function will call the local static function.
4) What is the difference between a global static variable and a global variable?
The scope of the global variable is throughout the program, while the scope of a static variable is within the file.
Life of both variables (static variable and global) is throughout the program. Here understand question carefully. Questions are asking global static variable. It means is variable is saved in the file scope. Within file any function can use that variable, this variable will not be available in any other files.
While global variable can be accessed through any file.
5) What is the difference between structure and union?
C language is having many system-defined data types like char, int, float, double, long etc. we are also having an array of the above data types, which will help us to save more than many variables in contiguous locations.
The interview you can start giving an answer from here – In practical we need a combination of above data types, few examples are
1) Collecting student information
2) Collecting patient information
3) CAR information to be saved. Like this many examples is possible.
If we save information in system-defined data types, it will be difficult to manage them as all those data will be saved in a different – different memory location. C language is having provision to save all required information one
place. It is called a user-defined data type.
Structure and union are user-defined data type which stored data collectively. See below example
unsinged int MemRead;
The structure will be saving all its parameters in memory like this
The structure will reserve memory for each of these elements; it will take 4 bytes each char will take 1 byte. The good part is all variable is stored in a contiguous memory location.
We can make a variable from a structure like this
Struct time today_time;
Union – as the name suggests it will be the union of all collected data into it. It means the total memory allocated to the union variable is the maximum size of the variable. See in below
unsinged int MemRead ;
So all three variable sec, min, hour will be saved into the same place. Many students ask us, what is the use of a union.
Structure and union together can make magic lets below example.
unsinged int MemRead;
Now see how this union will be seating into memory.
Now when we read from memory we can read like this
un_time.MemRead = 0x01020304;
while using we can use like this
if (un_time.st_time.day ==5)
Printf(“today is holiday\n”);
Printf(“today is working\n”);
So hope it making sense, a combination of union and structure is an amazing thing to use. This is most widely used in the embedded system, see our other post which is having details description of union and structure.
6) What is the function pointer, write delectation (prototype of the following function pointer)?
A function pointer is a variable, which can hold the address of the function. This is used in callbacks. Since C is sequential language. It processes one by one. However, for some cases, we may need to call a function based on conditions. In C a function pointer can only achieve this.
Declare a function pointer which will take two int pointer as input and return a char pointer
char * (*foo)(int *a, int *b);
Declare a function pointer, which will return the function pointer structure pointer and accepts one character and one integer.
struct school* (*foo)(char a, int b);
we can also have an array of structure pointers like this
so when we can use an array of function pointer like this
7) What is size of character, integer, integer pointer, character pointer?
The size of a character is 1 byte. Size of an integer is 4 bytes.
Size of integer pointer and character is 8 bytes on a 64-bit machine and 4 bytes on32-bit machine. Size of pointers does not depend upon the type of parameters, because pointer needs to save memory address, it does not matter what we are going to save them or from that address who many bytes we want. We just need to save the address.
8) What is interrupt latency?
Interrupt latency is the time required for an ISR responds to an interrupt. When interrupts occur in the embedded system, then the processor finishes current instruction, save the value of the program counter and jump to the required ISR. Sometime if the processor is busy and serving another interrupt then another interrupt may be pending till processor/controller is gets free from current ISR. Until that time another interrupt has to wait, this is the interrupt latency.
Interrupt latency should be as minimum as possible, otherwise, some very important action may miss, this delay in execution may cause some big impact on system performance.
9) How to reduce interrupt latency?
In order to reduce interrupt latency, while designing the system we should take a minimum time as possible in the ISR. We should divide our ISR into two part, The top half and bottom half. Top half should be very small and control should come out as soon as possible, normally in this section, we just copy the data, and generate some flags.
In the bottom half of ISR, we are executing out of ISR, we keep monitoring the flag signal sent by top half. Once execution is completed in bottom half we clear the flags and waits for next interactions from system or ISR.
With this method, we occupy very less time in the ISR. So other interrupts can be executed faster than previous, this reduces interrupt latency.
10)What is the dynamic memory allocation? Where we can use this?
The dynamic memory allocation is one of the best features in of C language. Let’s see in details,
In C language we are having many system-defined data types like int, char, float, double etc. Size of each one is fixed like it is 4 bytes, char is one byte, the float is 4 bytes etc.
We are also having user-defined data types like struct, union. Here we struct reserve memory for each of its elements while union reserve memory for the highest data types.
We can also make an array like int dates, it will reserve 100*4 = 400 bytes in the memory. The same way we can have struct school mycityschool. This will reserve size of memory = size of one structure * 50
All above data types reserve memory at the compile time. It means how much element we need we have decided at the time of compilation time itself. But in many practical conditions, we may not how many students will join today, or how many cars will be sold today, or how many patients will come today in the hospital.
So it means we can’t decide the size of at the time of compilation. We need to wait in real time use. Some need some method by which we can allocate memory on runtime. This type of memory allocation is called dynamic memory allocation.
An example is here:
Ptr = (int *) malloc (sizeof (int)*50). This malloc will reserve memory of total 4*50= 200 bytes into memory and return void pointer. Before using this we need to do typecast like (int *) and then we can use ptr memory of int array of 50 elements.
We can use malloc in run time to save any number of data we want, off-course memory should be available. What is the meaning of the above sentence?
It means the system is allocating memory from some reserved memory space this reserve memory space is called as HEAP memory. This is a section of memory which is used in dynamic memory allocation. Once use of memory is complete then we should make it free like this
Free (ptr); this will release memory to the system again and can be reused.
We are having one more point to discuss here. Malloc is just reserve memory, it won’t change contains memory. But in some application, we may need memory with initializing with 0 In that case either we reserve memory with the malloc and through memcpy we make the initialize with 0, Or we can use
Here we have to give two input one is a number of the element, size of each element.
Ptr =(int *) calloc (50, sizeof(int)); This will reserve 50*4 bytes and initialize withzero also.
Choose the Best Embedded Training Institute in Bangalore
We are a Professional Training Institute provides complete hands-on practical training in the embedded system, if you looking for embedded system training in Bangalore then choose us, as you go through our review and check what our old student is saying, they believe we are top embedded institute in Bangalore.
We are confident with our skill and capability, come and join our one-month free demo class we are sure you will fall in love with our teaching methods.
Syllabus of Embedded Systems Training in Bangalore
Professional training institute (PTI) is a Training organization, which is well known for providing quality education in advance fields such as Embedded System, C, Linux, CAN, Basic electronics, digital electronics, presently these are the hottest and best job-providing sectors. As the world changing fast, the technologies also changing day by day, we at professional training institute update our syllabus after every six months, we train the students according to the present using technologies in the industries.
We at Professional Training Institute train our student such a way that, it’s easy for them to work in industries as they will have good practical knowledge.
We at Professional Training Institute provide practical training such a way that our student getting an edge over others. Our main motto is to focus on practical and hands-on training to the student so that they are able to face any kind of interview in the embedded domain.
The Syllabus is Followed by Embedded Training Institute in Bangalore
This is 4-5 month course for B.E/B. Tech/MTech/ ME/ MCA/M. Sc Candidates Pre-final & Final Year with a background preferably Electronics, Electrical, Instrumentation or Computer science.
1. With this students will be handling their Mini & Final year project by themselves independently. If already completed engineering then this course will help to get job.
2. Our embedded training institute in Bangalore will provide 100% job assistance to our students. We give our full effort to get a job/place. We are having a dedicated team how is working with the placements.
3. Course Code:PTIESD0a – Comprehensive Embedded Systems Design Course is divided into following Major headings.
a) Basic Electronics and Digital Electronics. b) Basic C. c) Tools including S/W and H/W. d) Basic of Hardware Concepts. e) Basic Embedded. f) Advance C. g) Advance Embedded. h) Basic Linux. i) RTOS concepts. j) Linux Internal and Linux Device Drivers.
Details Description of Syllabus of Embedded Systems Courses in Bangalore
Basics of Electronics and Digital Electronic
Unit Objectives and Keywords
Resistors, Capacitors, Inductors.
Interpretation Data Sheet.
Half-Wave Rectifiers/ Full-Wave Rectifier.
Power Supply 3.3V,5.0V,12.0V, Voltage Regulators.
555 Timers in AS/MS/BS
Number System – Binary, Hex, Decimal,BCD System.
Addition/Subtraction of binary, 2’s complements.
Interconversion of number system.
Logic Gates – AND/OR/NOR/EXOR.
Filip-flop, Memory element.
Mux- De-Mux, Decoders.
Unit Objectives and Keywords
What is C?
Naming Conventions for C Variables
Printing and Initializing Variables
CHAPTER 2: SCOPE
The auto Specifier
The static Specifier
The register Specifier
The extern Specifier
The register Specifier
The extern Specifier
break and continue
Returning a Value or Not
Arguments and Parameters
Organization of C Source Files
Defining the Problem Space
A Programming Example
Bit Wise Operators
Bit Manipulation Functions
STRINGS & ARRAY
An Array as an Argument to a Function
POINTERS (PART 1)
Pointer Operators and Operations
Changing an Argument with a Function
String Functions with Pointers
Prototypes for String Parameters
Relationship Between an Array and a Pointer
The Pointer Notation *p++
Describing a Structure
Operations on Structures
Functions Returning Structures
Passing Structures to Functions
Pointers to Structures
Array of Structures
Functions Returning a Pointer to a Structure
typedef – New Name for an Existing Type
Tools Including S/W and H/W for Embedded Systems Training
Unit Objectives and Keywords
Making project in Keil.
Keil features/ tabs
Memory models in Keil.
Debugger setting in Keil.
Linker settings in Keil.
Introducing BBT – Baring Board Test.
Use of CRO.
What is Trigger?
How to do setting in CRO.
Measuring Voltage/current from CRO
What is Logic Analyzer
How to use Logic Analyzer
What is the use of a logic analyzer
For which protocol we can use a logic analyzer.
Soldering Iron/Heat GUN/
How to use Soldering Iron.
Precaution needs to take.
Basic Hardware Concepts of Professional Training Institute
Unit Objectives and Keywords
Designing Power supply
Design of power supply 5V.
Designing of 7 segment display
Study of 7 segment components
Designing Schematics of hardware
Hardware Design guidelines.
Important concepts during hardware Schematics design
Important concepts during hardware PCB lay-outing.
Active High/Active Low
Description of Active high and Active Low
Use of Ground Plan
Use of De-coupling capacitor
Use of TVS Diode
Components Torrance and Data
Component Torrance study.
Consideration during designing.
Basics of Embedded Systems
Unit Objectives and Keywords
Basic Concepts and Review
Buses – Address, Data, and Control
Interfacing memory & I/O devices
Programming ( Assembly)
Microcontroller Basic Concepts and Review
Interfacing memory & I/O devices
Programming ( Assembly)
Addition of two number.
Toggling Port with delay
Toggling Port with a timer.
Introduction of Interrupt.
Comparison interrupt and polling.
Communication with loopback.
Controlling LED with Switches.
Embedded C & Integrated Development Environment
Embedded C Programming
Induction of ARM Architecture
Difference between ARM9/ARM11
Different ARM concepts
The advantage of ARM.
Unit Objectives and Keywords
Structure and union
Combination of Structure and union.
Bit fields in Structure.
Pointers to structure and union.
The advantage of Structure and union
Microcontroller Basic Concepts and Review
Advantage/use of functions pointers.
Dynamic memory allocation
Opening A file
Closing a file
Writing some data in a file and reading back and printing.
The different mode in which file can be open and write.
Pre-requisites for the Embedded Training in Bangalore:
1. B.E/B. Tech/MTech/ ME/ MCA/M.Sc Candidates Pre-final & Final Year with a background preferably Electronics, Electrical, Instrumentation or Computer science.
Professional Training Institute – Embedded Systems Training Institutes in Bangalore
Our training method is different, our students get hands-on experience, they do experiments individually, which helps them to understand each part clearly like for example in embedded part we train them on UART protocol, we make them think and write a program for UART protocol, and we let them do communication between two devices using the UART protocol, by all these they will have good understanding of the UART protocol and they can easily use UART anytime in future. In this way, they get more interest to know about different technologies and we make them work and think.
We start our embedded system training from basic electronics, we teach the importance of electronics components, circuit design and we train them to design a power supply for different voltages. During c-programming classes we make our student think of the logic of each programmer, we never help them for write program, instead we help them to think and solve, this help them develop their logical skills and they can able to write any different programs.
We make student to discuss in class, and to give a seminar, which helps our students to develop the communication skills.
Embedded Systems Role in Automobiles with Applications
In today’s world, most electronic devices are based on Embedded Systems. Recently, In Automobiles also everything is used with the help of Embedded Systems only and all the mechanical systems in the Automobile has been completely replaced with the help of Embedded Devices. Nowadays, Automobiles making the complete use of Embedded System, where ever the Automobile system is depending purely on the Embedded Technology only. Ranging from Mp3 control to complex anti-lock brake control and Airbag systems controlling will be done by the
Embedded Systems in Automobile. Embedded systems have a huge variety of applications that vary from low to high-cost consumer electronics to industrial equipment, medical devices to weapon control systems, aerospace systems and entertainment devices to academic equipment, and so on. Embedded systems span all features of our present life. The applications of Embedded systems are shown below.
Telecommunication: Cellular phone, web camera, hub, router, IP Phone
Personal: Data organizer, iPhone, PDA, palmtop.
Today, a typical automobile on the road has computer controlled electronic systems, and the most
commonly used embedded systems in a vehicle includes,
Drive by wire
Adaptive cruise control
Anti-lock braking system
Tyre pressure monitor
In-vehicle entertainment system
Backup collision sensors
Heads up display
So, the automobile industry is completely replaced all the mechanical parts with the
Embedded Design. There is huge applications from embedded systems in Automobile and recently
trying to implement the Self driving system also it is very helpful to the physically handicapped
and Old age people.
For example, if you consider the Air bag system, it is an important safety device that provides an protection against accident. This system is works with the commands from the micro controller. If the sensors detects an accident, this micro controller operates the airbag system by operating alternator.
Embedded navigation systems, it is also an another advancement of the Embedded systems in automobiles in the navigational system using GPS system. This consist GPS receiver, a gyroscope, a DVD-ROM, map database, main controller and a display system. This will locate the live location of the vehicle and makes display the time estimated to the target place.
Satellite radio is an another application which provides radio service broadcast from satellites to automobiles. It is available by subscription and it is commercial free.
Adaptive cruise control is the another application, and it is useful to make driver less vehicle control in real-time by avoiding the accidents, this will be the better embedded products to be useful in the vehicles and this will allow the car to keep at the safe distance from the other vehicles. Each car has a laser transceiver or a microwave radar unit which is fixed in front of the car to find out the speed and distance of the any other vehicle in the pathway. This is works on the principle of Doppler Effect; it is nothing but change in frequency of the waves.
Embedded rain sensing system is the another application and this device will automatically detects the rain and it will automatically activates the windshield wiper. In this, an optical sensor is placed on small area of the front windshield glass (opposite to rear-view mirror). This optical sensor is placed at an angle to emit the infrared light which reads amount of light by it when the light is reflected back. This light is reflected in cases where the windshield is wet or dirty. Thus the optical sensor determines necessary speed and frequency of windshield wiper depends on reflected light into the sensor.
Drive by wire is an another application, where this system helps to replace the mechanical systems in automobiles with electronic systems using actuators and HMI(Human Machine interfaces) Components of the automobiles like belts, steering column, pumps, coolers, vacuum servos and master cylinders, hoses, intermediate shafts are eliminated.
Here, some of the major industries that help to develop these current trends in automobile industry
1. Atmel: Provides different controllers like ARM, 8051 Most of the body electronics, security, safety and automotive products are manufactured by them.
2. Texas Instruments: They provide different controllers, automotive control chips and DSPs to automobile industry.
3. Xilinx: Provides different CPLDs, FPGAs, and other application related cores for development of navigation systems, adaptive cruise control etc.
Silicon Providers, NxP, Analog devices, NEC, Renesas etc. are some other automobile industry. Now-a-days, there is huge openings on embedded systems with automobiles and every automobiles companies are replacing the embedded systems. So if any one want to growth your carrier in embedded Automobile so please join in good embedded System training institute. There is a top embedded training institute in Bangalore to provide the complete embedded system course. So, please join good embedded training institute and we are the Professional Training institute in Bangalore, we will provide you complete the Embedded system course in Automobiles.
Sensors and Embedded Systems in the Internet of Things
Embedded Systems and Sensors work together to be responsible for one of the most significant aspects of the IOT (Internet of Things). Helps to detect changes in the environment and an object.
Sensors are mainly used for the finding of changes in the logical and physical relationship of one object to another and the environment. Logical changes contain the presence or absence of an electronically perceptible entity, it may be location or activity. Physical changes may include light, temperature, pressure, motion, and sound.
The physical and logical changes are equally important within an IoT context. The Important different sensor types in an Industrial internet of things(IoT) context contains:
Pressure/ force sensor.
Ambient light or optical sensor.
Level/ flow sensor/leakage sensor.
Chemical/radiation /gas sensors.
Embedded system is an electronic device, its combination of both hardware and software, the embedded devices perform the specific task for which they are designed. Depending on the applications the embedded device may or may not be programmed.in our day to day life we will come across many embedded devices like mobile phones,
smart home controller, CD players, microwave oven and many more.
The embedded boards are supported by many different embedded controllers, which are developed using standard hardware and software units. Arduino is the most evolved embedded board, Arduino help to recognize the embedded system boards and it also used in the Internet of things. The Arduino architecture is a combination of embedded
Atmel controller family through particular hardware towards a board which has the built-in bootloader for plugs and run embedded applications.
In this modern world, embedded systems are most attracted devices due to some important factors like embedded devices are of very low cost. The power consumption is very low, the space consumption is very low so we can carry them easily. We can say Internet of thing is the device used transmit the information to people or from one device to other using the internet, the example of the internet of things are amazon echo, home automation, and security and many more.
It’s good to have knowledge of IoT and embedded system and its very good flat form to work, Internet of things have very good scope in the present world, we can say in future many IoT device will come which human life easier.so if anyone want to gain the knowledge in embedded system and want to have practical experience in it can join the professional embedded training institute in Bangalore.
The IoT demands a different set of microprocessors, drivers, batteries, peripherals, and operating systems than the conventional Embedded System used in general purpose computing systems. Conventional Embedded Systems are not proficient to deliver what the IoT is expecting from an embedded device networked in IoT and it brings great contests to develop or to transform the modern embedded system into an IoT enabled smart embedded system.
Basically, IoT is Embedded Systems and elegant substance coupled to the Internet with an exceptional IP address which can be communicated on the Internet. These compriseSensors external peripheral devices and actuators external peripheral devices. Internet of Things and devices of IoT are mix with embedded systems and smart things through the internet with different IP addresses which were used to discover and communicate.so you can learn more about IoT and embedded system through the embedded system training institute in Bangalore.