You are on page 1of 53

ANNA UNIVERSITY OF TECHNOLOGY COIMBATORE B.E. (Electronics and Communication Eng g.

.) VII Semester R2008 Regulation EMBEDDED SYSTEMS (2 Marks - Question Bank) Prepared By Prof. N.SHANMUGASUNDARAM Professor & Head, Department of ECE, VIDYAA VIKAS COLLEGE OF ENGINEERING AND TECHNOLOGY, TRICHENGODE, NAMAKKAL DISTRICT TAMIL NADU - 637214. Email: raja_ns@rediffmail.co m

Embedded Systems-QB EMBEDDED SYSTEMS UNIT I ARCHITECTURE OF EMBEDDED SYSTEMS 9 Categories of Embedded Systems-Specifi cations of Embedded systems-Resent trends in Embedded Systems-Hardware Architect ure-Software Architecture-Communication software-Process of generation of execut able image-development/testing tools. UNIT II PROGRAMMING FOR EMBEDDED SYSTEMS 9 Getting the most of C-data types-manipulating bits in memory and I/O ports-acce ssing memory mapped I/O devices structures-variant access-mixing C to assembly-r egister usage-use of addressing options-instruction sequencing procedure call an d return-parameter passing retrieving parameters memory management-scope-automat ic allocation-static allocation-dynamic allocation shared memory-recognizing sha red objects-reentrant functions-accessing shared memory device drivers- producti vity tools. UNIT III HARDWARE PLATFORM 9 PIC microcontroller- Architecture of PI C 16c6x/7x- FSR- Reset action- Oscillatory connectionMemory organization- Instru ctions- Addressing modes- I/O ports- Interrupts-Timers- ADCAssembly language pro gramming. UNIT IV REAL-TIME OPERATING SYSTEM CONCEPTS 9 Architecture of the Kern el-task and task scheduler-Interrupt Service Routines- Semaphores-MutexMailboxes -Message Queues-Event Registers-Pipes-Signals-Timers-Memory Management Priority Inversion Problem UNIT V REAL-TIME OPERATING SYSTEM TOOLS AND CASE STUDIES 9 Use of C/OS-II- Case study of coding for an Automatic Chocolate Vending Machine usin g MUCOS RTOS- Case study of an Embedded system for an Adaptive Cruise Control Sy stems in a Car- Case study of an Embedded Systems for a Smart Card. TOTAL: 45 TU TORIAL : 15 TEXT BOOKS: 1. K.V.K.K.Prasad Embedded /Real-Time Systems: Concepts, Design and P rogramming Dream tech, 2003. 2. Ajay V Deshmukh Microcontroller Theory and Applica tions Tata McGraw Hill 2005 REFERENCES: 3. Raj Kamal Embedded Systems Architecture Programming and Design 2/e TMH, 2008 4. David E Simon An Embedded Software Primer Pearson Education 2003 5. Daniel 5.W Lewis, Fundamentals of Embedded Software Pear son Education- 2001 6. Peatman Designing with PIC Micro Controller, Pearson 2003 2 NSS, VVCET - 2011

Embedded Systems-QB UNIT I ARCHITECTURE OF EMBEDDED SYSTEMS 1. Define Embedded System. An embedded system is one that has computer hardware with software embedded on it and designed for a specific task. An embedded syste m can be defined as a computing device that does a specific focused job. Applica tions such as the air conditioner, VCD player, printer, fax machine, etc. are so me of the examples of embedded system. Each of these applications will have a pr ocessor and special hardware to meet the specific requirement of the application along with embedded software that is executed by the processor for meeting that specific requirement. 2. List application areas of Embedded Systems. Various application areas of embe dded systems are... Consumer appliances Office automation Industrial automation Medical electronics Computer networking Telecommunication Wireless technologies Instrumentation Security Finance 3. What are the different categories of embedded system? Based on the functional ity and performance requirements, embedded systems can be categorized as Stand-a lone embedded systems. Eg. AC, Oven, CD player, TV. Real-time systems. Eg. Aircr aft control, Missile & Satellite control Networked Information appliances. Eg. W eather monitoring system Mobile Devices. Eg. PDAs, Smart phones. 4. What are the classifications of Embedded system? Based on complexity of hardw are and software, size and capability, the embedded systems are classified as fo llows. Small scale Embedded System Medium scale Embedded System Sophisticated Em bedded System. 3 NSS, VVCET - 2011

Embedded Systems-QB 5. Give examples for Small, Medium & sophisticated scale emb edded systems. Small Scale Embedded System Automatic chocolate vending machine S tepper motor controller for a robotics system Washing or cooking system Multitas king toys Medium Scale Embedded System Computer Networking Systems Entertainment systems Embedded firewall / Router Signal tracking system Sophisticated Scale E mbedded System Embedded system s for wireless LAN & for convergent technology de vices. Security products & high speed network security, gigabit rate encryption rate products Embedded system for real time video & speech 6. List the specialties of embedded systems. As compared to desktop computers, work stations or mainframes, embedded systems have many specialties. Developers need to keep these specialties in mind while designing embedded systems. They are, Re liability Performance Power consumption Cost Size Limited user interface Softwar e upgradation capability 7. List the factors to be considered while evaluating the processor for embedded sy stem. Clock Speed Width and Number of Registers Width of Data and Address bus In ternal RAM & ROM Interrupt lines On-chip peripherals such as Timers, UART, ADC, DAC, etc. 8. What are the hardware components of embedded systems? Processor Memory Timers & Interrupt Controller Serial/Parallel Ports Input devices, Interfacing/Driver cir cuits Output Interfacing/Driver circuits Power supply, Reset & Oscillator circui ts. 4 NSS, VVCET - 2011

Embedded Systems-QB 9. Define processor. A processor is a IC, which is capable o f performing an arithmetic or logical operation on a given data as per the comma nd given to it. 10. Compare CISC and RISC processor. CISC: Complex Instruction Set Computer (CISC) A im of designing CISC processor is to reduce the software complexity by increasin g the complexity of the processor architecture. CISC has large no of instruction s. With less instructions, a task can be performed and hence, the memory require ment in less. No. of registers are available in CISC processor is very less. Eg. Intel x86 family and Motorola 68000 series processors. RISC: Reduced Instructio n Set Computer (RISC) RISC has limited no. of instructions and hence, complex op eration is carried out through sequence of more simple instructions. Large numbe r of registers is required in RISC processor. Another important feature of RISC processor is pipelined instruction execution. Embedded systems generally use RIS C processor. Eg. ARM, ATMEL, AVR, MIPS, Microchips PIC family processors, Power P C and Sun SPARC processor. 11. What are the three processor architectures in embedded systems? Von-Neuman Archi tecture: This architecture has common memory for both data and program codes. 5 NSS, VVCET - 2011

Embedded Systems-QB Harvard Architecture: In this architecture, there are separa te memories blocks, one is program memory and the other is data memory. Program memory stores only instructions and data memory stores only data. Two pairs of d ata buses are used between CPU and the memory blocks. Super Harvard Architecture: The super Harvard architecture (SHARC) is a slight, but significant modification of the Harvard architecture. In Harvard architectur e, the data memory is accessed more frequently than the program memory. Therefor e, in SHARC, provision has been made to store some secondary data in the program memory to balance the load on both memory blocks. 12. What is Microcontroller? A microcontroller is a single IC with a processor and s everal other on-chip peripherals such as RAM, ROM, Comm. Ports, TIMERS, ADC/DAC, etc. Compact size of microcontroller suits the requirements for embedded system s and hence widely used in most of the embedded applications. 13. What are the functional blocks of a microcontroller? The functional circuits of a microcontroller are, Processor internal RAM for Data & stack Timers & Watc hdog timer ROM / PROM / EPROM External Memories Interfaces I/O Ports Control & I nterfaces / Drivers Serial UART communication port 14. What are the features of DSP? A DSP provides fast, discrete-time, signal process ing instructions. It has very large instruction word (VLIW) processing capabilit ies, it processes Single Instruction Multiple Data (SIMD) instructions fast, and it processes Discrete Cosine Transformations (DCTs) and inverse DCTs (IDTs) fas t. 6 NSS, VVCET - 2011

Embedded Systems-QB 15. What is GPP & ASIP? GPP: A processor from a number of fa milies of processors, microcontroller, embedded processors and DSPs having a gen eral purpose instruction set and readily available compilers to enable programmi ng in a high level language is called a General Purpose Processor (GPP). ASIP: A processor designed for specific application on a VLSI chip is called an Applica tion Specific Instruction Processor. 16. What is ASSP? Application Specific System Processor is a processing unit for spe cific tasks, foe e.g. Image compression and that is integrated through the buses with the main processor in an embedded system. 17. What is System-On-Chip? A complete system on a single VLSI chip that comprises o f all needed analog as well as digital circuits in it. For example, mobile phone . 18. What are the various forms of system memories? Internal RAM Internal ROM / PROM /EPROM External RAM External ROM / PROM Internal & External Caches Hybrid memory such as E2PROM, NV-RAM or flash memory 19. List the important sensors and transducers. Temperature Sensors. Eg. AD22100, AD 22103, DS18B20 Light Sensors. Eg. TAOS TSL250R Accelerometers. Eg. ADXL 150/250 Pressure Sensors. Eg. MPXA 6115A Microphone and Speakers Video camera and Monito r 20. List the important types of Displays. Light Emitting Diode (LED) Liquid Crystal Display (LCD) Thin Film Transistor (TFT) Display Organic Light Emitting Diode (O LED) 21. List the important Serial communication protocols. Inter-integrated Circuit (I2C ) Serial Peripheral Interface (SPI) Universal Serial Bus (USB) Controller Area N etwork (CAN) 7 NSS, VVCET - 2011

Embedded Systems-QB 22. List the important communication interfaces used in embe dded systems. Serial interface using RS232 Serial interface using RS422/RS485 Un iversal Serial Bus (USB) Infrared Ethernet Wireless interface using IEEE 802.11 (WLAN) Bluetooth ZigBee IEEE 802.15.4 23. Define interrupt handler. It is a unit that handles the processor operations ari sing out of an interrupt from a source. 24. What is watchdog timer? It is a timer which resets the processor in case the pro gram gets struck for an unexpected time, with the help of timeout signal. 25. What is reset circuit and power-up reset? The reset circuit activates for a fixe d period and then deactivates. It helps the processor to start the processing of instructions from a starting address. Power-up reset vector also provides a sta rting address which is different from that provided by a reset circuit. 26. What are the different categories of embedded operating system? Operating system used in embedded system can be broadly divided into the following categories No n-real-time embedded operating system Real-time operating system Mobile/handheld operating system 27. List the different categories of OS. Single-tasking OS (MS-DOS) Multi-tasking OS (WINSOWS XP) Single-user OS (MS-DOS) Multi-user OS (UNIX) Command-driven OS (MS -DOS) GUI-based OS (WINDOWS XP) 28. List the functions of OS. Task management Memory management I/O management Provi ding service to applications Providing proper user interface that hides underlyi ng hardware 8 NSS, VVCET - 2011

Embedded Systems-QB 29. What is Kernel? Kernel is a program with functions for m emory allocation and deallocation, task scheduling, inter process communication, effective management of shared memory access by using the signals, exception ha ndling signals, Semaphores, queues, mailboxes etc. 30. Define RTOS. Real Time Operating System is software for real-time programming, s cheduling of tasks, management of resources like memory, devices, etc. to meet t ime deadlines in embedded systems. 31. List the special requirements in RTOS for embedded systems. Reliability Multi-ta sking with time constraints Interrupt Latency control Small footprint Support di skless systems Portability Scalability Support for standard API 32. What is ROM image? The final stage software is also called ROM image, because ju st as an image is a unique sequence and arrangement of pixels, embedded software is also a unique placement and arrangement of bytes for instructions and data. 33. What are the steps required for converting assembly language into a ROM image? A ssembler Linker Loader Locator & Device Programmer 9 NSS, VVCET - 2011

Embedded Systems-QB 34. What is the use of code optimizer? Code optimizer is use d in the conversion of high level language into a ROM image for optimizing the c ode before linking. What is Compiler? Compiler is a software tool that converts a high level program (written using programming languages like C, C++, Java, and so on) into an object code. What is Assembler? Assembler is a software tool tha t converts an assembly program (written using mnemonics of a processor, i.e., in struction set of a specific processor) into an object code. 35. 36. 37. What is meant by context switching? The mechanism of storing the current status of CPU registers in a stack to run other task is known as context switching. 38. What is meant by Inter-task communication? Tasks may need to exchange data among themselves to synchronize the tasks in an application. This is known as Inter-t ask communication. The techniques used for ITC are Signals, Semaphores, Mailboxe s, Queues, Pipes and Event flags. What is meant by cross platform development? T he process of developing machine codes for a specific processor of an embedded s ystem from a high level / assembly level program written on a PC (with different processor) using various software tools is called cross platform development. L ist the various hardware development / testing tools. : Measures current, voltag e, continuity of connections Digital Multimeter Logic Analyzer : Checks the timi ng of the signals Oscilloscope : Analyze the waveforms in time domain Spectrum A nalyzer : Analyze the waveforms in frequency domain 39. 40. 41. List the various software development / testing tools. OS Development Suite Cros s-platform Development tools (IDE) ROM Emulator EPROM Programmer Instruction Set Simulator (ISS) In-Circuit Emulator (ICE) 42. List the possible boot sequences of an embedded system. Execute from ROM using R AM for data Execute from RAM after loading the image from RAM Execute from RAM a fter downloading from the host 10 NSS, VVCET - 2011

Embedded Systems-QB 43. What is meant by Debug port? Debugging a processor based board is very difficult. Hence, manufacturers provide a standardized interface for debugging. JTAG (Joint Test Access Group) port is a mechanism provided to de bug the embedded system hardware and also for downloading the software onto the embedded system board. 44. List out the layers of TCP/IP protocol suite. The TCP/IP protocol suit consist o f 5 layer Application layer Transport layer Internet protocol (IP) layer Data li nk layer(referred also as network layer) Physical layer 11 NSS, VVCET - 2011

Embedded Systems-QB UNIT II PROGRAMMING FOR EMBEDDED SYSTEMS 1. What are advantages of writing embedded software in Assembly Language? It giv es a precise control of the processor internal devices. The machine codes are co mpact. Device driver codes may need only a few assembly instructions What are ad vantages of writing embedded software in C Language? The development cycle is sh ort for complex systems. Type checking makes the program less prone to error. Co ntrol Structures make the program-flow path design tasks simple. Portability. Wh at is embedded C++? Embedded C++ is a version of C++ that provides for a selecti ve disabling which is the disadvantage in C++. So, there is a less run-time over head and less run-time library. How can optimization be used to eliminate the di sadvantages in embedded C++ programs? Optimization can be used as follows. Decla re private as many classes as possible. Use of char, int and boolean in place of the objects as arguments Use local variables as much as feasible. Recover memor y already used by changing the reference to an object to NULL. What is the use o f type checking? Type checking makes the program less prone to error. For e.g. I t does not allow subtraction, multiplication and division on the char data types. Define Configuration files. Configuration files are the files for the configurat ion of the system. Device configuration codes can be put in a file of basic vari ables and included when needed. What is difference between function and macro-fu nction? A macro function is a collection of codes that is defined in a program b y a name. It differs from a function in the sense that once a macro is defined b y a name, the compiler puts the corresponding codes for it at every place where that macro name appears. But the codes for a function are compiled once only. Wh at is recursive and reentrant function? Recursive Function: It is a function tha t calls itself. It must be a reentrant function also. Most often its use is avoi ded in embedded systems due to memory constraints. Reentrant Function: It is a f unction that is usable by the several tasks and routines at the same time. All i ts argument values are retrievable from the stack. 2. 3. 4. 5. 6. 7. 8. 12 NSS, VVCET - 2011

Embedded Systems-QB 9. What is the use of modifier register? When a modifier reg ister is inside a function block, a CPU register is temporarily allocated when n eeded. There is no ROM or RAM allocation. Define Queue. It is a data structure i nto which elements can be sequentially inserted and retrieved in a FIFO mode. It needs two pointers, one for the queue tail for insertion and other for the queu e head for deletion. Define Stack. A stack is a data structure in which elements can be pushed in or pulled out. It works on the principle of Last-In-First-Out (LIFO). How interrupts are handled in Queue? Queuing of pointers to the function on interrupts and later on calling the functions from this queue is a better ap proach as it provides the use of short execution time interrupt-service routines . Explain briefly stack overhead. The repeated call to recursive function may ca use the stack to full. This leads to insufficient memory. Hence the stack overhe ad may occur which is primarily due to overflow of the stack. What is meant by i nline assembly? Inserting the assembly language codes in between the high-level language codes are called inline assembly. It gives the benefits of processor sp ecific instructions and addressing modes. What is Optimization of memory? When c odes are made compact and fitted in small memory without affecting the code perf ormance, it is called memory optimization. Define scalar data types? The charact er, integer, unsigned integer, floating point number, long and double are called scalar data types. Unlike an array data consists of one single element. Give so me examples for reference data types. Arrays and strings are examples of referen ce data types. What is meant by platform independence? A code that can port on d ifferent machine and different operating systems is said to be platform independ ent code. What are preprocessor directives? It is the program statements and dir ectives for the compiler before the main function to define global variable, glo bal macro, new data type and global constants. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 13 NSS, VVCET - 2011

Embedded Systems-QB 20. What are the differences between including a header file and a text file or data file? The differences between including a header file a nd a text file or data file are, The header files are well tested and debugged m odules. They provide access to standard libraries. The header file can include s everal text file or C files. A text file is description of the text that contain s specific information. 21. List the Integer data types available in C programming language. Data type C har Short int Int Long int Char Short int Int Long int Size 8 bits 16 bits 16/32 bits 32 bits 8 bits 16 bits 16/32 bits 32 bits Range 0 to 255 0 to 65,535 same as unsigned short / long int 0 to 4,294,967,295 -128 to +127 -32768 to +32767 sa me as unsigned short / long int -2,147,483,648 to +2,147,483,647 unsigned signed 22. Why TYPEDEFS are used in embedded system programming? Cs primitive data type char m ay default to either signed or unsigned, and its primitive data type int may have size of 16 or 32 bits. In most of the embedded applications, its imperative to kn ow the number of bits and range of most variables. Hence, to avoid Cs ambiguity, derived data types are formed using TYPEDEFS and placed in a text file (Eg. type defs.h) and included in every source code file that uses them. 23. What are the two types of data conversions? PROMOTION: A conversion is called a promotion, when there is no potential loss of accuracy as when assigning an inte ger value to a floating point variable. DEMOTION: It is the conversion which cau ses a loss of accuracy, when a floating point variable is assigned to an integer variable, or when a 32-bit integer value is assigned to a 8bit char. Demotion u sually make the compiler to issue a warning. 24. List the Boolean and Bitwise operators. Operation AND OR XOR NOT Boolean Operato r && (Not supported) ! Bitwise Operator & ^ ~ NSS, VVCET - 2011 14

Embedded Systems-QB 25. Find the result of the following expression? a) Boolean: (5 !3) && 6 Ans:= = = = = Ans:= = = = = (True OR (NOT True)) AND True (True OR False) AND True (True ) AND True True 1 (00000101 OR !(00000011)) AND 00000110 (00000101 OR 11111100) AND 00000110 (11111101) AND 00000110 00000100 4 b) Bitwise: (5 26. List the bitwise operations performed on data bits. Testing bits Setting bits Cl earing bits Inverting bits Extracting bits Inserting bits 27. What is the significance of Pointers in C programming? A Pointer in C is a varia ble that contains an address of a variable. This helps to access the data of a v ariable faster in memory and in particular for array types of data. Eg. Int A, * B, C A = 10 B = &A C = *B ; ; ; ; A & C are normal variable and B is a Pointer variable Variable A is assigned wit h a value, 10 Variable B is assigned the address of variable A Variable C is now assigned the content at address stored in variable B 28. What is an Array? An Array is an aggregate data type composed of several members of same data type. The consecutive locations in memory are allocated for an arr ay. The starting address of the array (i.e., a[0]) is called Base address. Eg. I nt a[5]; a[0] a[1] a[2] a[3] a[4] 15 NSS, VVCET - 2011 !3) & 6

Embedded Systems-QB 29. Explain about manipulating bits in memory. 30. How testing a bit is made? 31. How setting a bit is made? 16 NSS, VVCET - 2011

Embedded Systems-QB 32. How clearing of a bit is made? 33. How inverting a bit is made? 34. How to extracting of a bit is made? 35. How to replacing of a bit is made? 17 NSS, VVCET - 2011

Embedded Systems-QB 36. What is a structure? A Structure is a aggregate data type composed of several di stinct members. A single structure variable can contain member elements that rep resent a mix of chars, ints, doubles, etc. Structure declaration in C program st ruct PERSON { Int age; Char gender; }; struct PERSON sue; (or) PERSON sue; Structure variable declaration Initialization of structure variable members sue.age = 25; sue.gender = F; (or) PERSON sue = {25, F}; 37. What is meant by packed structures? Structures are always stored in memory with their member components in the same order as they appear in the structure descri ption and there is no requirement that the components be contiguous. Struct {cha r c; Int I;} x; padding padding x.i padding x.c Sometimes, we need to use structures to describe a layout in which all the data is contiguous. Thus, packed structures are a layout of data in memory in which t he padding of zeros is disabled. Struct {char c; Int I; } x __attribute__ ((pack ed)); x.i x.c 18 NSS, VVCET - 2011

Embedded Systems-QB 38. What are Bit fields? Bit fields in structures allow us t o access the data using cleaner syntax that hides all the necessary bit manipula tion. Illustration of declaring structure bit fields Describing of time as struc ture in which the hours, minutes and seconds are declared as structure bit field s. typedef struct { WORD16 seconds minutes hours : 6, : 5, : 5; } TIME time1; Time of 13:34:18 can be initialized into the packed representation time1 using simple reference operator as follows, time1.hours time1.minutes tim e1.seconds = = = 13; 34; 18/2; 39. What is a Union? Union is an aggregate data type in which the members of it shar e a common memory space. typedef union { unsigned long int FIXED32PARTS part; } FIXED32REAL result; 31 result.part.whole 16 15 result.part.fract real; 0 --------------------------- result.real ---------------------------40. Explain the process of Assembler. The translation of assembly-language source co de into binary object code is a two-step process in assembler. The assembler mak es two complete passes over the source code of the program. During the first pas s; the assembler builds a symbol table that contains the information about progr ammerdefined identifiers, such as the labels attached to instructions and the nam es of variables stored in memory. During the second pass; the assembler uses thi s information to construct the representation of the individual instructions. 19 NSS, VVCET - 2011

Embedded Systems-QB 41. List the instructions in C that transfers the program co ntrol to another part of memory. In C language, unconditional jumps are created by break, continue, switch and goto statements and at the end of loops. 42. Explain the importance of String instructions. There are some common loop operat ions that can be implemented using the Intel string instructions for ultimate sp eed. For example, string instructions can be used to initialize a region of memo ry to a constant value, scan a region of memory for a particular value, copy one region of memory to another, or compare the contents of two regions of memory. 43. List the Intel conditional JUMP instructions. For comparing unsigned operands JA /JNBE JAE/JNB JBE/JNA JB/JNAE Jump if above / jump if not below or equal Jump if above or equal / jump if not below Jump if below or equal / jump if not above J ump if below / jump if not above or equal For comparing signed operands JG/JNLE JGE/JNL JLE/JNG JL/JNGE Jump if Greater / jump if not less or equal Jump if Greater or equal / jump if not less Jump if le ss or equal / jump if not greater Jump if less / jump if not greater or equal For equality comparisons JE/JZ Jump if equal / jump if zero (ZF=1) Jump if not e qual / jump if not zero (ZF=0) JNE/JNZ Other JUMP instructions JC JNC JS JNS Jump if CF=1 Jump if CF=0 Jump if SF=1 Jum p if SF=0 20 NSS, VVCET - 2011

Embedded Systems-QB 44. List the attributes of Objects stored in memory. Type Na me Value AddressScope Lifetime- char, int, unsigned int, etc. - The identifier u sed to access the object - The data held within the object The address in memory where the object resides - That part of the source code where the objects name i s recognized The notion of when the object is created and destroyed, and thus, w hen it is available for use. 45. What is meant by scope in memory management? Scope of a variable is based on the place of declaration in the program. It is either declared (1) outside of all f unctions to create global variables or (2) immediately following a function head er to create temporary variables local to the function. 46. List the types of Memory allocation available in C. Method Object is created Each time the program enters the function in which it is declared Object is initialized If specified in the declaration, initialization occurs each time the program ent ers the block Object is destroyed Automatic Each time the function returns Static Once: When the program is first loaded into the memory Once: Just before the program starts to run Once: When the program stops Dynamic By calling the library function malloc() By writing executable statements that modify its content By calling the library function free() 47. What is meant by shared memory? When two or more asynchronous (no predictable ti me relationship) instruction sequences access the same data, that data is called shared memory. Access to shared memory must be carefully coordinated or else da ta corruption may occur. 21 NSS, VVCET - 2011

Embedded Systems-QB 48. What is meant by shared functions? A shared function in one that is called by more than one thread; any function called by a shared func tion is also a shared function. Any static object referenced within a shared fun ction is thus form of shared memory. Since there is only a single instance of th e object, its content is inherently shared by all threads that call a function t hat references it. 49. Explain the type qualifier const. The keyword const is used to declare so that an objects value may not be modified by the program, i.e., that its value is read on ly. The declaration of a const object must include an initial value, since no su bsequent attempt to set its valued is allowed. 50. Explain the type qualifier Volatile. The keyword volatile may be attached as quali fier on the declaration of an object in C to indicate that its value may be asyn chronously modified by mechanism other than the code in which the declaration ap pears, such as DMA or ISR. 51. What is meant by Life Time of a variable? 52. What is Fragmentation? 22 NSS, VVCET - 2011

Embedded Systems-QB UNIT III HARDWARE PLATFORM 1. In what way is PIC microcontroller different from 8051? Most PIC microcontrol lers are RISC based processors with Harvard architecture, where as 8051 is based on Von-Neuman architecture. Harvard architecture makes use of separate program and data memories. PIC microcontroller has different data size for program and d ata memory and hence it is difficult to use external memory for PIC microcontrol ler. 2. List the features of PIC 16C6x/7x. PIC microcontroller is designed in Harvard Architecture Separate memory for program and data Program memory: has 13-bit ad dress & 14-bit data bus Data memory: has 8-bit address & 8-bit data bus 13-bit p rogram counter Pipelined architecture for fast execution speed Has inbuilt ADC a nd Watch-dog timer 3. Compare features of other PIC microcontrollers. 23 NSS, VVCET - 2011

Embedded Systems-QB 4. Draw the pin diagram of 16C61 and 16C71 microcontroller. 5. Describe the status register (Flag Reg) of PIC16C6X microcontroller. STATUS regi ster contains various flags and register bank select bits: D7 D6 D5 D4 D3 D2 D1 D0 RPO TO PD Z DC C RPO TO PD Z DC C Register bank select (to select 2 banks; one bit RPO is sufficient) Time-Out Bit (Reset status bit, is only readable) Power-Down Bit (Reset status bit, is only readable) Zero bit Digital-carry / Borrow bit Carry / Borrow bit 6. State the power consumption of PIC microcontroller. 24 NSS, VVCET - 2011

Embedded Systems-QB 7. What is meant by instruction pipelining? PIC16C6x/7x fami ly of microcontrollers use Harvard Architecture and instruction pipelining to ac hieve exceptionally fast execution speed for a given clock rate. Through pipelin ing, instruction fetch and execution are carried out simultaneously in a single cycle. 8. List the CPU registers of 16Cxx family microcontrollers. 9. What is PCL and PCLATH register? PC, wer the nto 25 NSS, VVCET - 2011 the program counter of PIC microcontroller is 13-bits wide and PCL is the lo byte of the PC. PCLATH, stand for PC Latch and it holds the upper 5-bits of program counter. PCLATH is transferred into the PC when content is written i PCL.

Embedded Systems-QB 10. List the SFRs of PIC microcontroller. The lower bytes of register bank are identified as Special Function Register (SFRs). The CPU and p eripheral modules use SFRs for controlling the operation of the device. 11. Describe the Register file structure in PIC microcontroller. The term Register F ile is PIC terminology used to denote the locations that an instruction can acce ss via an address. The register file consists of two components. 1. General purp ose register file 2. Special purpose register file 26 NSS, VVCET - 2011

Embedded Systems-QB The general purpose register file is another name given to R AM memory of PIC microcontroller. The special purpose register file contains inp ut and output ports as well as the control registers used to establish each bit of a port as either an input or an output. The register file structure is illust rated in figure below with addresses that span the 8-bit range from 00 to FF. Becaus e the direct addressing mode employed by many instructions use only 7-bit of the instruction to identify a register file address, the 8th bit of the register fi le address must come from a separate register bank selection bit, RP0. 12. List and brief the addressing modes in PIC microcontroller. Direct Addressin g: It uses 7 bits of instruction and the 8thbit from RP0. If RP0 bit is 0; then bank 0 is selected or otherwise bank 1 is selected. Indirect addressing: In this mode; the 8-bit address of the location in register file to be accessed is writ ten in FSR and INDF register is used for indirect addressing. 13. What is FSR? FSR stands for File Selection Register. FSR is the pointer used for indirect memory addressing in the whole register file. It must be noted that, i n PIC, every instruction that can be used for direct addressing may also be used in a different way for indirect addressing. The only difference in indirect add ressing mode is that one has to write the address byte in FSR and then use INDF in the instruction. Thus, FSR points to the desired memory location. 14.

List the reset action that takes place in PIC microcontroller. PIC reset action takes place due to difference mechanism. Those are Poweronreset (POR), MCLR res during the normal operation, Master clear MCLR reset during SLEEP mode, Watch do g timer reset during normal operation, Brownoutreset (BOR). 15. Explain the brown-out reset feature of PIC microcontroller. PIC microcontroller can be reset automatically in running condition, due to the brown-out. Brown-out reset takes place when the supply voltage falls below 4V. The device remains in brown-out reset condition until the supply voltage is restored. PIC 16C61 and 1 6C71 does not support this feature. 27 NSS, VVCET - 2011

Embedded Systems-QB 16. Explain the structure of Watchdog timer in PIC microcont roller. Watch-dog timer is a simple timer circuit that prevents the processor fr om endless loop (hanging condition) and looks after the functioning of the syste m with respect to time. The watch-dog timer will reset the PIC microcontroller w hen the CLRDWT instruction is not executed periodically. CLRDWT instruction resets the TO bit in the status register. WDT timer can also be reset the TO bit, when the CLRDWT is not executed periodically. The normal ti me-out period of PIC microcontroller is around 18ms. The watch-dog timer is enab led at the time of device programming and it cannot be turned off after programm ing. 17. Explain about Clock generation in PIC briefly. 28 NSS, VVCET - 2011

Embedded Systems-QB Alternate method of generating clock signal is by connecting quartz crystal to the PIC microcontroller along with two start-up capacitors. 18. Short notes on I/O ports of PIC microcontroller Port A: RA0 to RA4 (5 lines) (Ad dress 05). RA4 has alternate function. TRISA (85H) is SFR used to configure thes e lines individually as either inputs or outputs. Setting bit in TRIS will confi gure as input and 0 will configure as output. Port B: RB0 to RB7 (8 lines). TRIS B It has weak internal pull up which is to be enabled. POR disables pull-ups. 19. Explain about the interrupts in PIC There are 3 Interrupt Sources for PIC16C 6X. External Interrupt: Due to external source. Edge Sensitive RB0/INT causes th is interrupt. This interrupt wakes up processor from SLEEP. This must be set bef ore going into SLEEP mode. Timer 0: Timer 0 overflows when timer count overflows from FF to 00. Port B Change Interrupt: A change from high to low or low to hig h on port B pins RB4 to RB7 causes this interrupt. This interrupt can wake devic e from SLEEP. 20. Write short notes on Timers in PIC16C6X. All PIC16C6X devices have three timer m odules except for the PIC16C61, which has one timer module. The Timer0 module is a simple 8-bit overflow counter. The clock source can be either the internal sy stem clock (Fosc/4) or an external clock. When the clock source is an external c lock, the Timer0 module can be selected to increment on either the rising or fal ling edge. 29 NSS, VVCET - 2011

Embedded Systems-QB 21. List out the types of instructions in PIC Microcontrolle r. Each PIC16CXX instruction is a 14-bit word divided into an OPCODE which speci fies the instruction type and one or more operands which further specify the ope ration of the instruction. Byte-oriented, Bit-oriented, Literal and control oper ations 22. Explain Byte-oriented instruction set. Byte-oriented instructions, f represent s a file register designator and d represents a destination designator. The file r egister designator specifies which file register is to be used by the instructio n. The destination designator specifies where the result of the operation is to be placed. If d is zero, the result is placed in the W register. If d is one, the re sult is placed in the file register specified in the instruction. 23. Explain Bit-oriented instruction set. Bit-oriented instructions, b represents a bit field designator which selects the number of the bit affected by the opera tion, while f represents the number of the file in which the bit is located. 24. Short note on literal and control operation instruction set. Literal and control operations, k represents an eight or eleven bit constant or literal value. 30 NSS, VVCET - 2011

Embedded Systems-QB 25. Write short notes on INTCON register of PIC16C6x/7x cont roller. INTCON is an Interrupt control register in PIC microcontrollers for cont rolling all interrupts. 31 NSS, VVCET - 2011

Embedded Systems-QB 26. List the external interrupts & timers of PIC microcontroller. The PIC microcontr oller has one pin RB0/INT, which serves as its primary external interrupt input. In addition to above, it has three timers TIMER0 TIMER1 & TIMER2 with CCP modul e. 27. List the features of ADC in PIC 16C6x/7x microcontroller. PIC 16C7X supports ana log inputs. PIC 16C71 microcontroller has four analog channels of 8bit ADC, with 20 s of conversion time per channel. Four analog channels AIN0, AIN1, AIN2 and A IN3 are the alternate functions of Port_A pins RA0, RA1, RA2, and RA3 respective ly. ADCON0 controls the function of pins RA0 to RA3. This allows the configuring pins RA0-RA3 as analog or digital inputs. 29. What is sleep mode in PIC microcontroller? PIC microcontroller supports a power saving Sleep mode. The clock may be frozen with all the data preserved in the proc essor memory. A software command allows the processor to enter into this mode. I t will be in sleep mode until the PIC is reset again. 32 NSS, VVCET - 2011

Embedded Systems-QB 30. Explain the operation of OPTION register. 33 NSS, VVCET - 2011

Embedded Systems-QB 31. Instruction set of PIC microcontroller. 34 NSS, VVCET - 2011

Embedded Systems-QB 32. Programming examples for PIC microcontroller. A. Program to configure PORT_B using TRISB B. Program to implement a Delay routine. 35 NSS, VVCET - 2011

Embedded Systems-QB C. Program to initialize PORT_A D. Program to initialize PORT_B 36 NSS, VVCET - 2011

Embedded Systems-QB E. Program to alter PORT_B in response to external interrupt on pin RB0 37 NSS, VVCET - 2011

Embedded Systems-QB F. Program for A/D conversion. 38 NSS, VVCET - 2011

Embedded Systems-QB UNIT IV REAL TIME OPERATING SYSTEMS CONCEPTS 1. Define RTOS. It is an operating System for embedded system with real time tas k scheduling, interruptlatency control, synchronization of tasks with IPCs and p redictable timing behavior of the system. 2. Name some RTOS services. (i) Basic OS functions (ii) RTOS Main functions (Task S cheduling & interrupt latency control) (iii) Time Management (iv) Predictability 3. Compare OS and RTOS. OS: On a PC, OS takes control of the PC as soon as it is tu rned on and then it lets the application program to start. OS checks any pointer which passes into a system function for its validity. OS consumes lot of memory space and it contains all in-built functions. RTOS: Application program is link ed to the RTOS. At boot-up, application usually gets control first and then it s tarts RTOS. Many RTOS don not protect themselves and skip the checking process f or better performance. To save memory, RTOS has only the functions needed for an application. 4. What is Round Robin or cyclic scheduling? It is a scheduling algorithm in which the tasks are scheduled in sequence from a list of ready tasks. 5. Explain briefly about Preemptive scheduling. A scheduling algorithm in which a h igher priority task is forced (Preempted) to block the low priority task by the scheduler. 6. What is a h it ling 7. Explain briefly the term Task. Task is a subroutine in an application that makes certain action to be performed. A Task that has its independent program counter values and an independent stack. A single CPU system runs one task at a time. 39 NSS, VVCET - 2011 is Time Slicing and Fixed real time scheduling? Time Slicing Scheduling It scheduling algorithm in which each task is allotted a time slice after whic is blocked and waits for its turn on the next cycle. Fixed Real Time Schedu It is a scheduling strategy in which the time for each task is fixed.

Embedded Systems-QB 8. What is Task State? A state of a task changes on schedule r directions. A task at an instance can be in one of the four states, idle, read y, blocked ad running that are controlled by the scheduler. 9. Explain Task scheduler. It is part of a RTOS. It keeps track of the state of eac h task and decides which one task should go into the running state. Scheduler in an RTOS looks at the priorities assigned to tasks, and among the tasks that not in the blocked state, the one with highest priority is allowed to run and the r est of them are made to wait in the ready state. 10. When a blocked task is allowed to run on a processor? When a task is blocked, it never gets the processor. Therefore, an interrupt routine or some another task in the system should signal that whatever the blocked task waiting for has happe ned. Otherwise, the task will be blocked forever. How does a scheduler know whet her a task is blocked or not? RTOS provides a collection of functions that tasks can tell a scheduler what events they wait for and to signal that events have h appened. 11. 12. What happens if all the tasks are blocked? If all the tasks are blocked, then th e scheduler will spin in some tight loop somewhere inside the RTOS, waiting for something to happen. If nothing ever happens, then it ends in an infinite loop. Therefore care must be taken by programmer to invoke a interrupt routine that ca ll some RTOS function that unblocks a task. 13. What if two tasks with the same priority are ready? There are two options in thi s situation. (1) RTOS should declare as illegal when two tasks are assigned with same priority. (2) RTOS can time-slice between two tasks that has the same prio rity. 14. List the rules to decide if a function is Re-entrant. 1. A reentrant function ma y not use variables in a non-atomic way unless they are stored on the stack of t he task that call the function or are otherwise the private variables of that ta sk. 2. A reentrant function may not call any other functions that are not themse lves reentrant. 3. A reentrant function may not use the hardware in a non-atomic way. 15. Define Inter process communication (IPC). An output from one task (or process) p assed to another task through the scheduler and use of signals, exceptions, sema phores, queues, mailboxes, pipes, sockets, and remote procedure call is known as inter process communication. 40 NSS, VVCET - 2011

Embedded Systems-QB 16. Define Semaphore. Semaphore is a special variable or fun ction that is used to take note of certain actions to prevent another task or pr ocess from proceeding. 17. List the semaphore related problems. Forgetting to take the semaphore Forgetting to release the semaphore Taking the wrong semaphore Holding a semaphore too lon g 18. Explain Mutex, Counting and Resource Semaphore. Mutex Semaphore A special variab le used to take note of certain actions to prevent any task or process from proc eeding further and at the same time let another task exclusively proceed further . Counting Semaphore Sometimes, a semaphore can be taken multiple times. A semap hore can be an integer which can be incremented when released and decremented wh en taken. If a task tries to take a semaphore when the integer value is equal to 0, then the task will be blocked. This is called Counting semaphore. Resource S emaphore Sometimes RTOS allows a semaphore to be released only by the task that has taken them. These semaphores are useful for shared data problem, but cannot be used for communication between two tasks. Such semaphores are called as Resou rce semaphores. 19. What are the problems that may arise while using semaphores? The problems that m ay while using semaphores are, Sharing of two semaphores creates a deadlock prob lem. Without a timeout an ISR worst-case latency may exceed the deadline. If a s emaphore is not taken, and another task uses a shared variable. When using multi ple semaphores, if an unintended task takes the semaphore, it creates a problem. It may introduce priority inversion problem. 20. What is shared data problem? If a variable is used in two different tasks and an other task if interrupts without before the operation on that variable is comple ted, then the shared data problem arises. 21. List the ways to protect the shared data. Disabling the interrupts Taking semaph ores Disabling the task switches 41 NSS, VVCET - 2011

Embedded Systems-QB 22. Explain briefly Deadly embrace situation. Consider a sit uation in which two tasks (task1 and task2) are using two semaphores, semaphore_ A and semaphore_B. When task1 is run, it takes semaphore_A and before it proceed s further and takes semaphore_B, RTOS switches to task2. Now task2 takes semapho re_B and it waits for release of semaphore_A by task1. None of these tasks are a ble to proceed further. This situation is called Deadly embrace. 23. What is priority inversion problem? How it can be solved? A problem in which a l ow priority task unintentionally do not release the semaphore for a higher prior ity task. This makes the high priority task to wait for low priority task to rel ease the semaphore. This is called Priority Inversion. This problem can be solve d by temporarily boosting the low priority task to higher priority task which is called as priority inheritance. 24. Explain the term (i) Message Queue (ii) Mailbox (iii) Pipe (iv) Socket. Mess age Queue RTOS allows a task to send multiple messages into a FIFO queue for use by another task(s) using queue message as an input. Mailbox RTOS allows a certa in no. of messages to be stored in each mailbox. Separate functions are used to identify the appropriate mailbox, to add and read a message from the selected ma ilbox. Pipe Pipes are like queues. RTOS can create them, write to them, read fro m them and so on. Socket It provides the logical link using a protocol between t he tasks in a client-server or peer-topeer environment. 42 NSS, VVCET - 2011

Embedded Systems-QB 25. List the pitfalls in using Mailbox, Message queues and P ipes. Most of the RTOS do not restrict which tasks can read from or write to any given queue, mailbox or pipe. Therefore, programmer must ensure that tasks use the correct one each time. RTOS cannot ensure that data written onto a queue, ma ilbox or a pipe will be properly interpreted by the tasks that read it. Running out of space in queues, mailboxes or pipes is usually a disaster for embedded so ftware. Passing pointers from one task to another through a queue, mailbox or pi pe is one of the several ways to create shared data inadvertently. 26. What is Timer and counting devices? A Timer gets the inputs from the internal cl ock of a processor or from system clock and generates a required time delay. Cou nting device is a unit for getting the count-inputs on the occurrence of events that may be at irregular intervals. 27. What are the types of Timer? There are two types of timer. They are, Hardware ti mer Software timer 28. What is Timer Overflow or Time-Out? A state in which the number of count inputs exceeded the last acquirable value and on reaching that state, an interrupt can be generated. This state is called Time-Out or Timer Overflow. 29. What is the difference between hardware timer and software timer? Hardware timer gets the inputs from the internal clock with the processor or system clock. A d evice driver program programs it like any other physical device. Software timer executes a program which increases or decreases a count variable on an interrupt from a timer output or from a real-time clock interrupt. 30. What are the different states in a timer? The different states in a timer are, R eset State Idle State Present State Overflow State Active or Blocked State Done State 43 NSS, VVCET - 2011

Embedded Systems-QB 31. Is it necessary to have a hardware timer device in a sys tem? How does it work? Yes, it is necessary to have atleast one hardware timer d evice in a system. It is used as a system clock. The hardware timer gets the inp ut from a clock out signal from the processor and activates the system clock as per the num ticks preset at the hardware timer. 32. What is an Event? An event is essentially a Boolean flag that tasks can set or r eset and that other tasks can wait for. Event invokes a interrupt routine that r uns a waiting task. 33. Compare Semaphores, Events and Queues/Mailbox/Pipe. Semaphores are usually the f astest and simplest methods. However, not much information can be passed through a semaphore, which passes just a 1-bit message saying that it has been released . Events are a little more complicated than semaphores and take little more of p rocessor time. The advantage of events over semaphores is that a task can wait f or any one of the several events at the same time and it can wait for only one s emaphore. Queues (also mailboxes & pipes) allow sending a lot of information fro m one task to another. The drawback of queues (also mailboxes and pipes) is that adding and reading a message is more processor intensive and more prone to inse rt bugs while programming them. 34. How a block of data is passed using queue? Passing a pointer to a buffer from on e task to another through a queue is a common way to pass a block of data. 35. Explain the problem in using malloc() and free() functions for memory management in RT embedded systems. In real time embedded systems, malloc() and free() are avoided because of their slow response and unpredictable execution times. Instea d, most of the RTOS offer fast and predictable functions along with free fixed s ize buffers. 36. List the two rules that an interrupt routine must follow in RTOS environment tha t do not apply to task codes. Rule-1: An interrupt routine must not call any RTO S function that might block the caller. Rule-2: An interrupt routine may not cal l any RTOS function that might cause the RTOS to switch tasks unless the RTOS kn ows that an interrupt routine, and not a task is executing. 44 NSS, VVCET - 2011

Embedded Systems-QB UNIT V REAL TIME OPERATING SYSTEMS TOOLS AND CASE STUDIES 1. Name the important RTOS used in embedded systems. MUCOS, Vxworks, PSoS, RTX51 , WinCE, RT Linux, Nucleus, Symbian are the important RTOS. 2. List the Main functions of RTOS. (i) Handling of interrupts. (ii) Task schedulin g. 3. List the basic functions in an RTOS. The basic functions in an RTOS are, Kernel (Task Scheduler) Error handling functions System level functions System clock fu nctions Time and delay functions Task state switch functions ISR functions Memor y related functions IPC functions. 4. List the need for well tested & debugged RTOS. When designing a complex embedded system, one needs the thoroughly tested bug free codes for the following softwa re components. Multiple task functions in Embedded C or C++ Real time clock base d software timers employing system clock Software for cooperative scheduler to m aintain time deadlines If cooperative scheduler is not suitable, then software f or Pre-emptive scheduler Device drivers and device managers Functions for IPC Ne tworking functions Error handling and Exception handling functions Testing and s ystem debugging software A readily available, well tested and debugged RTOS thus not only simplifies the coding process greatly for a developer, but also helps in building a product fast; it aids in building robust and bug free software by thorough testing and simulation before locating the codes into the hardware. 45 NSS, VVCET - 2011

Embedded Systems-QB 5. Explain C/OS-II (MUCOS) RTOS. C/OS-II is a freeware RTOS, d eveloped by Jean J. Labrosse in 1992. C/OS-II is designed for non-commercial use. C/OS-II is well documented for developers reference. C/OS-II codes are written in C and in assembly language. C/OS-II code ports on any processor that are used for embedded systems 6. What are the files associated with C/OS-II RTOS? The source files of C/OS-II are c ategorized into two groups. a) Processor dependent source file: Two header files at the master are the following. os_cpu.h is the processor definitions header f ile os_cfg.h is the kernel building configuration file Two C files for ISR and R TOS timer are os_tick.c and os_cpu_c.c Assembly codes for task switching functio ns is os_cpu_a.s12 b) Processor independent source file: Two files, MUCOS header and C files are ucos.ii.h and ucos.ii.c. The C files for RTOS core, timer and t ask are os_core.c, os_time.c and os_task.c The memory partitioning, semaphore, q ueue and mailbox codes are os_mem.c, os_sem.c, os_q.c and os_mbox.c respectively . 7. List the features of C/OS-II (MUCOS) RTOS. The features of MUCOS are as follows. MUCOS operating system functions has a prefix of OS or OS_. MUCOS is a scalable OS. For multitasking, MUCOS employs pre-emptive scheduler. MUCOS has system leve l functions. MUCOS has task service functions. MUCOS has task delay functions. M UCOS has memory allocation functions. MUCOS has Inter-Process Communication (IPC ) functions. MUCOS has semaphore functions. MUCOS has mailbox functions. MUCOS h as queue functions. 46 NSS, VVCET - 2011

Embedded Systems-QB 8. List the System level functions in MUCOS. MUCOS support t he following system level functions. void OSInit (void) void OSStart (void) void OSTickInit (void) void OSIntEnter (v oid) void OSIntExit (void) OS_ENTER_CRITICAL OS_EXIT_CRITICAL At the beginning p rior to OSStart() After OSInit() and task creating functions To initialize Syste m timer ticks Just after the start of ISR codes before return form the ISR codes Macro to disable all interrupts Macro to enable all interrupts 9. List the Task service functions in MUCOS. MUCOS support the following task servi ce functions to create, suspend and resume tasks, and to set and retrieve time. unsigned byte OSTaskCreate () unsigned byte OSTaskSuspend (..) unsigned byte OSTa skResume (..) void OSTimeset (..) unsigned int OSTimeGet (void) Must call before running a task Called for blocking a task Called for resuming a blocked task Wh en system time is to be set Find present count when time is read 10. List the Time delay functions in MUCOS. MUCOS Time delay functions are, void OSTimeDly () To delay a task by count-1 value unsigned byte OSTimeDlyResume () To resume a task after a preset delay void OSTim eDlyHMSM () Time delay to block a task 47 NSS, VVCET - 2011

Embedded Systems-QB 11. List the Memory related functions in MUCOS. MUCOS memory related functions are, OSMem *OSMemCreate () void *OSMemGet (..) unsigned byte OSMemQuery (..) unsigned byte OSMemPut () To create and initialize memory partition To find the pointer of memory control block To find pointers of memory blocks and data structures To r eturn a pointer of memory block 12. List the Semaphore related functions in MUCOS. MUCOS semaphore related functions are, OS_Event OSSemCreate () void OSSemPend (..) unsigned short OSSemAccept (..) unsig ned byte OSSemPost () unsigned byte OSSemQuery () To create and initialize a semap hore To check whether a semaphore is pending To check whether SemVal > 0 If SemV al = 0 or more, increments, and makes a semaphore again not pending. To get sema phore information When a semaphore created by OS and used a resource acquiring key, it must be ini tialized with 1 to indicate the resource is available. 13. What is a signal in the RTOS environment? A signal is a flag like intimation to RTOS for development of certain situations during a run that need urgent attenti on by executing as ISR. 14. What is meant by task delay? Time delay is the minimum number of system ticks th at a task must wait. 15. What is meant by task resumption? Task can be scheduled when its turn comes, whi ch was delayed or suspended earlier. 16. What are the different types of scheduling supported by MUCOS? The different typ es of scheduling supported by MUCOS are, (i) Round robin time sliced scheduling. (ii) Preemptive scheduling. 48 NSS, VVCET - 2011

Embedded Systems-QB 17. Explain briefly about the system timer in MUCOS. There a re functions for initiating the system time in MUCOS. Starting a multitasking sy stem by a first and later suspending if forever is shown as a technique in progr amming for a multitasking system. 18. Briefly explain the features supported for mailbox by MUCOS. MUCOS has mailbox f unctions and a simple feature that a mailbox has one message pointer per mailbox . There can be any number of messages or bytes, provided the same pointer access es them. 19. Explain briefly the queue functions adapted in MUCOS. A queue in MUCOS receives from a sender task and array of message pointers. Message pointers insertion can be such that later on it can retrieve in FIFO method as well as in LIFO method from a queue. It depends on whether the post was used or post front function was used, respectively. This helps in taking notice of a high priority message at t he queue. 20. List the tasks involved in Automatic Chocolate Vending Machine (ACVM). Task_Read Ports Task_Collect Task_Deliver Task_Refund Task_ExcessRefund Task_Display Task_ TimeDateDisplay Waits for Coins & Action as per coins collected Collect coins >= cost, wait till timeout Deliver the chocolate Refund coins, if coins are insert ed in shortage Refund coins, if coins are inserted in excess Display the present operation & status Updates the display of Time & date in 3rd line of the LCD di splay 21. Draw the task synchronization model in ACVM. 49 NSS, VVCET - 2011

Embedded Systems-QB 22. What is Cruise control? Cruise control is a system that takes charge of controlling the throttle from the driver and cruising the vehicl e at a present constant speed. Cruising control may also maintain the steering s tability in case of multiple cars streaming through highways or in case of VIP c onvoys. Cruise control relieves the driver from the duty and driver hands over t he charge to ACC when the road conditions are suitable, and if the car is cruisi ng at high speed when there is no heavy traffic. The driver resumes the charge i n adverse conditions. 23. List the main components of Automatic Cruise Control (ACC). Cruise control panel Vacuum actuator Throttle position sensor Throttle valve Cruise control system ( Embedded System) with inputs from steering wheel, vehicle speedometer, clutch pe dal and brake pedal. 24. List the important hardware standards used in Automotives. A hardware system in automotive electronics has to provide functional safety. Important hardware stan dards and guidance provided at present are the following. TTP Time Triggered Pro tocol CAN Controller Area Network MOST Media Oriented System Transport IEE guida nce standard exists for EMC and functional safety. 25. Explain the function of Port_Align and Port_Ranging in ACC. Port_Align: It is a stepper motor port. Motor steps up clockwise or anticlockwise on an interrupt si gnal. The motor helps in aligning the radar in line with the front-end car. Port_Ranging: It is a port that determines the range of the front-end car throug h time difference. Radar emits a signal and sensor receives the reflected signal from the front-end car. The time delay between the above two instances are meas ured and the range distance of the front-end car is calculated by multiplying th e delay with the speed of the car. 50 NSS, VVCET - 2011

Embedded Systems-QB 26. List the special requirements needed in embedded softwar e & RTOS for the automotive system over and above the features of MUCOS. Languag e can be application specific, and need not be just C / C++. OS should be scalab le for optimizing memory needs. OS should be able to schedule Tasks and ISR in d istinct ways. Interrupt system should get disabled at the beginning and enabled on return. Tasks can be scheduled in real-time. Task can consist of three type o f objects, event (semaphore), resource (statement and functions) and devices. Ti mer, task or semaphore objects creation and deletion cannot be allowed. IPC, mes sage queue posting by a task is not allowed as a waiting task may wait indefinit ely for its entire message needs. Before entering a critical section, interrupt system must be disabled. 27. List the software standards used in automotive electronics. Software used in aut omotive electronics must be to industrial standard. The industry standards are, AMI-C (Automotive Mutli-media interface Collaboration) for important software st andards and guidance. MISRA-C (Motor Industry Reliability Association Standard) for C language software guidelines for automotive systems. OSEK/VDX for RTOS, Co mmunication and Network management. 28. What is Smart Card? Smart card is an embedded system-on-chip (SOC) consisting of microcontroller and EEPROM memory which is used for bank ATM operations, identi fication, and other innovative applications. 29. List the contents stored in ROM of smart card. Fabrication key Personalization k ey RTOS codes Application codes Utilization lock 51 NSS, VVCET - 2011

Embedded Systems-QB 30. List the contents stored in EEPROM / Flash memory of sma rt card. Personal Identification Number (PIN) for user Unblocking PIN for use by authorizer (bank) Access conditions Card user personal data Post issuing data t hat application generates Applications non-volatile data Invalidation lock to loc k card after expiry / theft 31. Describe the I/O system of the smart card. I/O system of the chip and the host i nteract through asynchronous serial UART at 9.6 / 106 / 115.2 bauds. The communi cation between the chip and the host may be through gold contacts or contact les s through BPSK modem operating at 13.66 MHz with 10% modulation index. 32. List special features needed in embedded software for smart card. Protected envi ronment (data stored in protected part of ROM) Restricted Run-time environment O S must be scalable in all aspects Code size generated should be optimum Limited use of data types Three layered file system for data (master, elementary & dedic ated) Fixed length or variable length file management system with predefined off set. It should have classes for networks, sockets, connections, data grams, char acter I/O streams, digital certification; DES/AES based cryptography and digital signatures. 52 NSS, VVCET - 2011

You might also like