An embedded system is a combination of computer hardware and software designed for a specific function. Embedded systems may also function within a larger system. The systems can be programmable or have a fixed functionality. Industrial machines, consumer electronics, agricultural and processing industry devices, automobiles, medical equipment, cameras, digital watches, household appliances, aeroplanes, vending machines and toys, as well as mobile devices, are possible locations for an embedded system.
The three main components of an embedded system are:
1. Hardware
2. Main application software
3. RTOS
2. What are the characteristics of embedded systems.
1. Single-functioned - An embedded system usually performs a specialized operation and does the same repeatedly. For example, A pager always functions as a pager.
2. Tightly constrained - All computing systems have constraints on design metrics, but those on an embedded system can be especially tight. Design metrics is a measure of an implementation's features such as its cost, size, power, and performance. It must be of a size to fit on a single chip, must perform fast enough to process data in real-time and consume minimum power to extend battery life.
3. Reactive and Real-time - Many embedded systems must continually react to changes in the system's environment and must compute certain results in real- time without any delay. Consider an example of a car cruise controller; it continually monitors and reacts to speed and brake sensors. It must compute acceleration or de-accelerations repeatedly within a limited time; a delayed computation can result in failure to control of the car.
4. Microprocessors based - It must be microprocessor or microcontroller based.
5. Memory-It must have a memory, as its software usually embeds in ROM. It does not need any secondary memories in the computer.
3. Explain the basic Structure of an Embedded System.
1. Sensor - It measures the physical quantity and converts it to an electrical signal which can be read by an observer or by any electronic instrument like an A2D converter. A sensor stores the measured quantity to the memory.
2. A-D Converter - An analog-to-digital converter converts the analog signal sent by the sensor into a digital signal.
3. Processor & ASICS - Processors process the data to measure the output and store it to the memory.
4. D-A Converter - A digital-to-analog converter converts the digital data fed by the processor to analog data
5. Actuator - An actuator compares the output given by the D-A Converter to the actual (expected) output. stored in it and stores the approved output.
4. What do you mean by Processors in a System.
A processor has two essential units -
• Program Flow Control Unit (CU) • Execution Unit (EU)
The CU includes a fetch unit for fetching instructions from the memory. The EU has circuits that implement the Instructions pertaining to data transfer operation and data conversion from one form to another.
The EU includes the Arithmetic and logical Unit (ALU) and also the circuits that execute instructions for a program control task such as interrupt, or jump to another set of instructions. A processor runs the cycles of fetch and executes the
instructions in the same sequence as they are fetched
from memory.
Processors can be of the following categories -
• General Purpose Processor (GPP)
1. Microprocessor
2. Microcontroller
3. Embedded Processor
4. Digital Signal Processor 5. Media Processor
• Application Specific System Processor (ASSP)
Application Specific Instruction Processors
(ASIPs) • GPP core(s) or ASIP core(s) on either an Application Specific Integrated Circuit (ASIC) or a Very Large Scale Integration (VLSI) circuit.
1. How does an embedded system work?
The processor may be a microprocessor or microcontroller. Microcontrollers are simply microprocessors with peripheral interfaces and integrated memory included. Microprocessors use separate integrated circuits for memory and peripherals instead of including them on the chip. Both can be used, but microprocessors typically require more support circuitry than microcontrollers because there is less integrated into the microprocessor. The term system on a chip (SoC) is often used. SoCs include multiple processors and interfaces on a single chip. They are often used for high-volume embedded systems. Some example SoC types are the application- specific integrated circuit (ASIC) and the field- programmable gate array (FPGA).
Often, embedded systems are used in real-time operating environments and use a real-time operating system (RTOS) to communicate with the hardware. Near-real-time approaches are suitable at higher levels of chip capability, defined by designers who have increasingly decided the systems are generally fast enough and the tasks tolerant of slight variations in reaction. In these instances, stripped-down versions of the Linux operating system are commonly deployed, although other OSes have been pared down to run on embedded systems, including Embedded Java and Windows loT (formerly Windows Embedded).
2. Short note on RTOS
RTOS real time operating system is another important component that is present in an embedded system. Now whether it is a real-time operating system or a normal operating system the function of an operating system is to coordinate hardware and software. RTOS that is real-time operating systems is coordinating mainly it is doing the function of coordination between hardware and software. Now a question arise in our minds that why we are going for a real-time operating system? Because if you take the case of automatic chocolate vending machine or automatic washing machine here there is a lot of importance to time at this time interval the washing should be completed or within this time interval the draining should be completed. The spinning should be completed or drying should be completed. So likewise there is actually a lot of importance to time if you take most of the embedded systems time is actually a very critical thing. So if you miss the time limit or the deadline the functioning of that embedded system will be completely disturbed. So in that case we are going for real-time operating systems.
6 What is an Embedded System Design?
A system designed with the embedding of hardware and software together for a specific function with a larger area is embedded system design. Steps in the Embedded System Design Process:
The different steps in the embedded system design flow/flow diagram include the following.
2. Hardware Software Architecture: Proper knowledge of hardware and software to be known before starting any design process.
3. Extra Functional Properties: Extra functions to be implemented are to be understood completely from the main design.
4. System-Related Family of Design: When designing a
system, one should refer to a previous system-related
family of design.
5. Modular Design: Separate module designs must be made so that they can be used later on when required.
6. Mapping: Based on software mapping is done. For example, data flow and program flow are mapped into one.
7. User Interface Design: In user interface design it
depends on user requirements, environment analysis and function of the system. For example, on a mobile phone if we want to reduce the power consumption of mobile phones we take care of other parameters, so that power consumption can be reduced.
8. Refinement: Every component and module must be refined appropriately so that the software team can understand.
Architectural description language is used to describe
the software design.
• Control Hierarchy
. Partition of structure
• Data structure and hierarchy
• Software Procedure.
4. Challenges in Embedded System Design.
A system designed with the embedding of hardware and software together for a specific function with a larger area is embedded system design. In embedded system design, a microcontroller plays a vital role. Micro-controller is based on Harvard architecture, it is an important component of an embedded system. External processor, internal memory and i/o components are interfaced with the microcontroller. It occupies less area, less power consumption. The application of microcontrollers is MP3, washing machines.
While designing any embedded system, designers face lots of challenges like as follows,
1. Environment adaptability
2. Power consumption 3. Area occupied
4. Packaging and integration
5. Updating in hardware and software
6. Security
7. There are various challenges the designers face while testing the design like Embedded hardware testing, Verification stage, Validation Maintainability.
1. Explain timer and counter device?
A timer is a specialized type of clock which is used to measure time intervals. A timer that counts from zero upwards for measuring time elapsed is often called a stopwatch. It is a device that counts down from a specified time interval and is used to generate a time delay, for example, an hourglass is a timer.
1. The register incremented for every machine cycle. 2. The maximum count rate is 1/12 of the oscillator
frequency. 3. A timer uses the frequency of the internal clock and generates delay.
A counter is a device that stores (and sometimes displays) the number of times a particular event or process occurred, with respect to a clock signal. It is used to count the events happening outside the microcontroller. In electronics, counters can be implemented quite easily using register-type circuits such as a flip-flop.
1. The register is incremented considering 1 to 0 transition at its corresponding to an external input pin (TO, T1).
2. Maximum count rate is 1/24 of the oscillator frequency. 3. A counter uses an external signal to count pulses.
2. Explain Serial Communication Protocol and Parallel Communication Protocols.
The communication is very well known terminology. which involves the exchange of information between two or more mediums. In embedded systems, the communication means the exchange of data between two microcontrollers in the form of bits. This exchange of data bits in microcontroller is done by some set of defined rules known as communication protocols. Now if the data is sent in series i.e. one after the other then the communication protocol is known as Serial Communication Protocol. More specifically, the data bits are transmitted one at a time in sequential manner over the data bus or communication channel in Serial Communication. There are different types of data transfer available in the digital electronics such as serial communication and parallel communication.
Similarly, the protocols are divided into two types such as Serial Communication Protocol and Parallel Communication Protocols. Examples of Parallel Communication Protocols are ISA, ATA, SCSI, PCI and IEEE-488. Similarly, there are several examples of Serial Communication Protocols such as CAN, ETHERNET, 12C, SPI, RS232, USB, 1-Wire, and SATA etc. Serial communication is the most widely used approach to transfer information between data processing peripherals. Every electronics device whether it is Personal Computer (PC) or Mobile runs on serial communication. The protocol is the secure and reliable form of communication having a set of rules addressed by the source host (sender) and destination host (receiver) similar to parallel communication.
3. What is ISR concept?
Interrupt Service Routines (ISR) are the portions of the program code that handle the interrupt requests. When an Interrupt is triggered (either a hardware or software interrupt), the processor breaks away from the current task, moves the instruction pointer to the ISR, and then continues operation. An interrupt service routine (ISR) is a software routine that hardware invokes in response to an interrupt. ISR examines an interrupt and determines how to handle it executes the handling, and then returns a logical interrupt value. If no further handling is required the ISR notifies the kernel with a return value. An Interrupt Service Routine is one that is registered to the hardware via the Operating system at initialisation time in order to process interrupts from a particular device when it generates interrupts, and that happens at I/O termination.
Upon entry, the routine needs to determine the reason for the interrupt and the device status, so as to take appropriate action - enter error recovery if an error. hand control back to the initiating program to process data transferred (input) or initiate another transfer (output) and so on. This is done by setting flags in the operating system: ISRS only process the interrupt and exit as quickly as possible; the OS does task switching.
4. What is interrupt and interrupt latency in embedded system?
In systems programming, an interrupt is a signal to the processor. It can be emitted either by hardware or software indicating an event that needs immediate attention. Interrupts are a commonly used technique in real-time computing and such a system is said to be interrupt-driven.
1. Hardware interrupt
A hardware interrupt is a signal which can tell the CPU that something happen in hardware device, and should be immediately responded. Hardware interrupts are
triggered by peripheral devices outside the microcontroller. An interrupt causes the processor to save its state of execution and begin execution of an interrupt service routine.
Unlike the software interrupts, hardware interrupts are asynchronous and can occur in the middle of instruction execution, requiring additional care in programming. The act of initiating a hardware interrupt is referred to as an interrupt request (IRQ).
2. Software interrupt
Software interrupt is an instruction which cause a context switch to an interrupt handler similar to a hardware interrupt. Usually it is an interrupt generated within a processor by executing a special instruction in the instruction set which causes an interrupt when it is executed.
Another type of software interrupt is triggered by an exceptional condition in the processor itself. This type of interrupt is often called a trap or exception.
Unlike the hardware interrupts where the number of interrupts is limited by the number of interrupt request (IRQ) lines to the processor, software interrupt can have hundreds of different interrupts.
Interrupt latency refers primarily to the software interrupt handling latencies. In other words, the amount of time that elapses from the time that an external interrupt arrives at the processor until the time that the interrupt processing begins. One of the most important aspects of kernel real-time performance is the ability to service an interrupt request (IRQ) within a specified amount of time.
1. Explain the real-world interfacing with 8051 microcontrollers?
When the 8051 is conducted to external memory port o(po) is used for the lower order address and data bus and port 2 (p2) is used for the higher order address bus. since the port 3 pins have an alternative function the net result is that only p1 is left for i/p $ o/p operation.
(1) Elevator interfacing: It's one of the common applications in which microprocessors can be used effectively. An elevator has many electrical and electronic components which have to work closely in association with the user-controlled switches. An elevator in generally will need the following minimum user interface switches.
(a) User-controlled switcher at each floor to call the elevator.
(b) Switcher inside the elevator to select the destination floor.
(c) open and close the switch for the door.
(d) An alarm switch, which the user can used.
(2) Interfacing stepper motor with 8051: These are used for position control applications such as the control by disk drive and in robotics. The most common stepper motor has 4 stator windings which are tailored with a central tapped common terminal.
(3) Interfacing ADC chip: The analog to digital converter is an essential component is any microprocessor/microcontroller system for interfacing analog input.
(4) Interfacing DAC chip: Digital to analogue convertors are used to get a proportional analog voltage/current for the digital data sent by microprocessor.
(5) Washing Machine control: It's an example of an appliance that uses modern technology. It has developed over the your from manual and semi to fully automation of a washing machine is easily achieved using programmed microcontrollers. In general washing in a washing. m/c is achieved by alternate arition of the clothes in detergent-soaked water.
2. Explain ARM architecture.
The architecture can be divided into A.R and M profiles. A profile is mainly for applications. R profile is for real- time and M profile is for Microcontroller.
(1) Instruction set in the architecture describes the function of each instruction and explains the representation of the instruction in the memory through encoding.
(2) Priority encoders helps to identify the registers and instructions easily in the architecture.
(3) Multiplexers are used in the architecture to manage the operations of processor buses. The architecture of the entity is optimized depending on the application of the processor and helps to construct of the processor and helps to construct and maintain the design.
(4) 32-bit input are used in arithmetic and logic unit which comes from the register in register flags. There are c flag, v flag, s flag and 2 flag.
(5) Booth Multiplier factor has 32 bit input to manage from the register file. The output given is also 32 bit and the multiplication starts. When the inputs is actively working with the processor.
(6) Also another multiplication rule is used in the system for 2's complement numbers. The Both algorithm manages both positive and negative number with the same importance and faster multiplication is performed by ignoring O's and 1's in the process.
(7) 32-bit input shifting is represented with the help of Barrel Shifter. The input is either from the register file or from the data given by the user for faster output. Shifter manages these with the help of different controls and also with the functionalities of the system.
(8) The Control unit controls the entire process of the architecture and manages the system operation. It can be made of circuits or can be the combination of functions and circuits in the design. Timing is managed in the control unit and works with a combination of a state machine in the processor. The operation in the processor is managed and controlled with the help of signals from the control unit as these are connected with different components in the system.
(9) There is a register set in the architecture to help in managing the registers with their corresponding time in the structure. It is important to check for the number of registers and the size of the same for the proper
(10) The exception model in the architecture helps to know the different levels of access provided in the system and the types of exceptions in the system. When an exception is accepted, the changes undergone in the system are also noticed. Breakpoints are noticed and information is captured with the help of tracepoints.
The ARM Cortex-M3 memory is divided into the following regions:
System -
1. Private Peripheral Bus - External - Provides access to:
⚫ the Trace Port Interface Unit (TPIU),
the Embedded Trace Macrocell (ETM),
the ROM table,
⚫ implementation-specific areas of the PPB
memory map.
2. Private Peripheral Bus - External - Provides access to:
⚫ the Instrumentation Trace Macrocell (ITM),
⚫ the Data Watchpoint and Trace (DWT),
⚫ the Flashpatch and Breakpoint (FPB),
⚫ the System Control Space (SCS), including the MPU and the Nested Vectored Interrupt Controller (NVIC).
3. External Device - This region is used for external
device memory.
4. External RAM - This region is used for data. 5. Peripheral - This region includes bit band and bit band alias areas.• Peripheral Bit-band alias - Direct accesses to this memory range behave as peripheral memory. accesses, but this region is also bit addressable through bit-band alias.
• Peripheral bit-band region - Data accesses to this region are remapped to bit band region. A write operation is performed as read-modify-write.
6. SRAM - This executable region is for data storage. Code can also be stored here. This region includes bit band and bit band alias areas.
• SRAM Bit-band alias - Direct accesses to this memory range behave as SRAM memory accesses, but this region is also bit addressable through bit-band alias.
• SRAM bit-band region - Data accesses to this region are remapped to bit band region. A write operation is performed as read-modify-write.
7. Code-This executable region is for program code. Data can also be stored here.
4. What are serial and parallel communication ports used in embedded system?
Serial communication port:
In an embedded system, serial communication is the way of exchanging data using different methods in form of serial digital binary, some of the well-known interfaces used for the data exchange are RS-232, RS485, 12C, SPI etc.
A serial port connection can be used for inter- processor communication within a system or for communication with different parts of a system. The serial port equipment but a communication protocol has to used to ensure a reliable, error-free data path.
Parallel communication port:
In parallel communication, a chuck of data (8, 16 or 32 bit) is sent at a time. so, each bit data requires a separates physical I/O line. The advantage of parallel communication is it fact but its drawback is it use more number of I/O (input-output) lines.
1. What Is an Assembly Language?
An assembly language is a type of low-level programming language that is intended to communicate directly with a computer's hardware. Unlike machine language, which consists of binary and hexadecimal characters, assembly languages are designed to be readable by humans.
Low-level programming languages such as assembly language are a necessary bridge between the underlying hardware of a computer and the higher- level programming languages - such as Python or JavaScript-in which modern software programs are written.
1. An assembly language is a type of programming language that translates high-level languages into machine language.
2. It is a necessary bridge between software programs and their underlying hardware platforms.
3. Today, assemble languages are rarely written directly, although they are still used in some niche applications such as when performance requirements are particularly high.
4. What is pre-processor in embedded system?
The C pre-processor is a macro processor that is used automatically by the C compiler to transform your program before actual compilation (Pre-processor directives are executed before compilation.). It is called a macro processor because it allows you to define macros, which are brief abbreviations for longer constructs. A macro is a segment of code which is replaced by the value of macro. Macro is defined by #define directive.
Pre-processing directives are lines in your program that start with #. The # is followed by an identifier that is the directive name. For example, #define is the directive that defines a macro. Whitespace is also allowed before and after the #.
The # and the directive name cannot come from a macro expansion. For example, if foo is defined as a macro expanding to define, that does not make #foo a valid pre-processing directive.
List of pre-processor directives:
1. #include
2. #define
3. #undef
4. #ifdef
5. #ifndef
6. #if
7. #else
8. #elif
9. #endif
10. #error
11. #pragma
1. What are the C program elements in embedded.
(i) Header file:
1. A file with extension.h
2. It contains C function declarations and macro definitions to be shared between several source files.
3. There are two types of header files: files that programmer writes and files that come with compiler.
4. It is a simple practice in C or C++ programs to keep all constants, macros, system wide global variables and functions prototype in header file and include that header file whenever it is required.
5. Example:
#include <stdio.h>
Here
#include. Preprocessor directive to call header
file
<stdio.h>2. Header file
(ii) Macros:
1. It is a collection of codes that is defined in C program by a name.
2. It differs from function in sense that once a macro is defined by a name, the compiler will put the corresponding codes for it at every place where that macro name appears.
3. Advantages of using macro are that the speed of execution of program increases. There is a decrease in the length of the program. Also there is a decrease in errors caused by repetitive coding.
2. What are the features of embedded C++?
It is a dialect of the c++ programming language for embedded systems. It was defined by an industry group led by major japanese CPU manufacturers. Embedded Cis Procedure Oriented Programming and Embedded C++ is Object Oriented Programmimg(OOP). C++ is an object oriented programming language which encapsulates multiple datatype in one user-defined data type which is called class.
In many embedded system designs today, programmers can leverage all the features of C++ such as classes, templates, exception handling, and class inheritance that have proven so useful for mainstream computer applications. Some of these C++ features, however, bloat the compiled code significantly increasing memory requirements while reducing execution speed. A new C++ dialect called Embedded C++ (EC++) has been developed by an industry standards committee to address the limitations of C++ in some embedded applications where memory is limited and 32-bit processors are prevalent. EC++ proposes to maintain the most valuable C++ concepts while eliminating those most responsible for boosting memory requirements and reducing efficiency. Ideally, designers will be able to choose whether to use EC++, C++, or a hybrid of the two to match specific application requirements.
3. What is RTOS in embedded system?
A Real Time Operating System, commonly known as an RTOS, is a software component that rapidly switches between tasks, giving the impression that multiple programs are being executed at the same time on a single processing core.
In actual fact the processing core can only execute one program at any one time, and what the RTOS is actually doing is rapidly switching between individual programming threads (or Tasks) to give the impression that multiple programs are executing simultaneously.
An RTOS differs in that it typically provides a hard real
time response, providing a fast, highly deterministic
reaction to external events.
Scheduling Algorithms
When switching between Tasks the RTOS has to choose the most appropriate task to load next. There are several scheduling algorithms available, including Round Robin, Co-operative and Hybrid scheduling. However, to provide a responsive system most RTOS PI?'s use a pre-emptive scheduling algorithm.
• Tasks and Priorities
In a pre-emptive system each Task is given an individual priority value. The faster the required response, the higher the priority level assigned. When working in pre- emptive mode, the task chosen to execute is the highest priority task that is able to execute. This results in a highly responsive system.
4. What are the design principles of RTOS to design an embedded system explain?
RTOS are Operating Systems (OS) which act in Real Time (RT). This means that RTOS have other purposes than general OS or embedded operating systems (EOS). Where the general OS have the goal to maximize the average throughput of tasks (data?), in RTOS the keyword is determinism. Real-time tasks have to be completed before a certain deterministic deadline. This requires that responses to stimulus must always execute within a constant amount of time. Violation of the specified timing constraints is (normally) considered catastrophic. Non real-time systems are considered correct if certain inputs map to certain outputs: the system (code and hardware) must always do the proper thing given some current state and input. Real-time systems must achieve the same logical correctness, but must achieve this logical correctness using constant time algorithms. Because of this additional requirement on executional behavior, the implementations of RTOS differ significantly from other OS, although the general principles are the same.
RTOS have 4 main responsibilities:
1. Task management and scheduling: The responsibility of task management includes the scheduling of the multiple tasks. Because scheduling is pure overhead, the RTOS implement scheduling algorithms which are not too complex. The simpler the algorithm, the faster, smaller (less memory) and more predictable the task will be executed.
2. Interrupt servicing; Most modern OS are interrupt- driven. This means that if there are no processes waiting to be executed, no I/O-devices requesting a service and no users waiting for an answer, the OS waits till something happens. Events are almost always signaled by an interrupt or a trap. A trap is an interrupt that is generated by the software, either after an error or after a specific request of a user program to execute a system service. For each type of interrupt there are separate code segments available in the OS.
3. inter-process communication and
synchronization; Because there are tasks that have to communicate with each other, the need exists for synchronization of different tasks, as well as for data exchange between them. The RTOS should provide easy and safe IPC primitives which can be used for programmers to build their software systems. These primitives can have different effects on task scheduling (blocking, non-blocking, conditional blocking, blocking with time out), can use different degrees of coupling (named connection, broadcast, blackboard, object request broker) and buffering.
4. memory management; The job of the OS is memory allocation and memory mapping and to take action when a task uses memory that is not allocated (memory protection). Some of the points of attention in memory management in an RT-system are:
• Fast and deterministic memory management
• Page locking
Dynamic allocation
• Memory mapping
• Memory sharing
• RAM Disks
1. What is PIC microcontroller in embedded system?
PIC Microcontroller is the very smallest microcontroller in the world that can be designed to carry out a huge range of tasks. These microcontrollers are in electronic devices such as phones, computer, and Embedded Operating System etc. Also, the features of these microcontrollers are RAM, CCP, SSP, LCD, and ICSP, etc. PIC microcontroller can be used in different applications such as audio accessories, peripherals, and video games, etc.
PIC Microcontroller Advantages
• Interfacing of an analog device is easy without extra circuitry.
• When compared to other microcontrollers, power consumption is very low, and programming is very easy.
. It is consistent and faulty of PIC percentage is very low. Using RISC architecture the performance is high-speed.
2. What are the PIC 18 family device?
Microchip Technology PIC16(L)F18425/45 Low Pin Count MCUs are designed to implement extreme Low- Power (XLP) technology for general purpose and low- power applications.
These PIC16(L)F18425/45 MCUs combine intelligent analogy, communication peripherals, and Core Independent Peripherals (CIPs) with XLP technology for optimum low power operation. The
PIC16(L)F18425/45 MCUs feature a 12-bit Analog-to- Digital Converter with Computation (ADC2), Memory Access Partitioning (MAP), Device Information Area (DIA), and Peripheral Pin Select (PPS). These MCUs have up to 28KB program flash memory, up to 2KB data SRAM memory, and 256B data EEPROM.
The PIC16(L)F18425/45 MCUs have multiple digital peripherals including four Configurable Logic Cells (CLCs), two Complementary Waveform Generators (CWGs), and Capture/Compare/PWM (CCP) modules. The analog peripherals include Zero-Cross Detect (ZCD), temperature sensor circuit, Digital-to-Analog Converter (DAC), and Fixed Voltage Reference (FVR) module.
3. Explain watchdog timer?
The Watchdog Timer is a free running on-chip RC oscillator which does not require any external components. This RC oscillator is separate from the RC oscillator of the OSC1/CLKIN pin. That means that the WDT will run, even if the clock on the OSC 1/CLKIN and OSC2/CLKOUT pins of the device has been stopped, for example, by execution of a SLEEP instruction. During normal operation, a WDT time-out generates a device reset. If the device is in SLEEP mode, a WDT time-out causes the device to wake-up and continue with normal operation. The WDT can be permanently disabled by clearing configuration bit WDTE.
WDT PERIOD: The WDT has a nominal time-out period of 18 ms, (with no prescaler). The time-out periods vary with temperature, VDD and process variations from part to part (see DC specs). If longer time-out periods are desired, a prescaler with a division ratio of up to can be assigned to the WDT under software control by writing to the OPTION register. Thus, time-out periods up to seconds can be realized. The CLRWDT and SLEEP instructions clear the WDT and the postscaler, if assigned to the WDT, and prevent it from timing out and generating a device RESET condition. The TO bit in the STATUS register will be cleared upon a WDT time- out. WDT PROGRAMMING CONSIDERATIONS: It should also be taken in account that under worst case conditions (VDD = Min., Temperature = Max., max WDT prescaler) it may take several seconds before a WDT time-out occurs.
What are the Peripheral Features of PIC16F873.
Peripheral Features:
1. Timer0: 8-bit timer/counter with 8-bit prescaler
2. Timer1: 16-bit timer/counter with prescaler, can be incremented during SLEEP via external crystal/clock
3. Timer2: 8-bit timer/counter with 8-bit period register, prescaler and postscaler
4. Two Capture, Compare, PWM modules-Capture
is 16-bit, max. resolution is 12.5 ns-Compare is
16-bit, max. resolution is 200 ns-PWM max.
resolution is 10-bit
5. 10-bit multi-channel Analog-to-Digital converter 6. Synchronous Serial Port (SSP) with SPI (Master mode) and 12CP?(Master/Slave) ⚫Universal Synchronous Asynchronous Receiver Transmitter (USART/SCI) with 9-bit address detection
7. Parallel Slave Port (PSP) 8-bits wide, with external RD, WR and CS controls (40/44-pin only)
8. Brown-out detection circuitry for Brown-out Reset (BOR)
1. Explain the Architecture of PIC Microcontroller
The architecture of this microcontroller consists of CPU, I/O ports, interrupts, oscillator, timers/counters, A/D converter, memory organization, serial communication, and CCP module, etc.
1. I/O Ports: PIC microcontroller consists of five ports such as Port A, Port B, Port C, Port D and Port E. Port A: It is a 16-bit port that can be mainly used for
input and output port based on the status of the TRISA register. Port B: This is an 8-bit port that can be used as input and output.
Port C: An 8-bit port and the input or output operation is decided by the status of the TRISC register. Port D: An 8-bit port that acts as a slave port for connection to the ARM Microcontroller. Port E: It is a 3-bit port which serves the additional function of the control signals to the analog into a digital converter.
2. Memory Organization: This microcontroller architecture consists of Random Access Memory, Read Only Memory and STACK.
3. Random Access Memory: Random Access Memory is an unstable memory that is used to store the data temporarily in registers. As well as, it is classified into two banks, each bank consists of a number of registers. Also, these registers are divided into two types. They are Special Function Register and General Purpose Register.
4. Read Only Memory: It is a stable memory that is used to store the data permanently. The ROM is also called as a program memory, where the user will write a program and save it permanently and finally the program is executed by the CPU.
5. STACK: The process of a stack is when an interrupt occurs, the PIC microcontroller has to execute the interrupt and existing process address. That is being executed is stored in the stack. After completing the execution of the interrupt, microcontroller calls the process with help of address, that is stored in the stack and get executes the process.
6. Timers/Counters: Timers are mainly used for generating accuracy actions. Although, it has four- timer/counters where the one 8-bit timer and the remaining timers have the choice to select 8 or 16-bit mode.
7. Oscillators: Generally, oscillators are used to generating timing. It consists of an external oscillator such as RC and crystal oscillators. In RC oscillator, the value of capacitor and resistor that is used to determine the clock frequency. The range of clock frequency is 30 KHz to 4MHz.
8. Interrupts: It consists of 20 internal interrupts and three external interrupts, which is associated with different peripherals such as ADC, USART, and Timers etc.
9. CCP module: Generally, CCP stands for Capture/ Compare/ PWM. CCP module works in three modes such as Capture mode, Compare mode and PWM mode.
2. What are the salient features of PIC Microcontroller?
SALIENT FEATURES
1. Speed: When operated at its maximum clock rate a PIC executes most of its instructions in 0.2 us or five instructions per microsecond.
2. Instruction set Simplicity: The instruction set is so simple that it consists of only just 35 instructions
3. Integration of operational features: Power-on-reset (POR) and brown-out protection ensure that the chip operates only when the supply voltage is within specifications. A watch dog timer resets the PIC if the chip malfunctions or deviates from its normal operation at any time.
4. Programmable timer options: Three timers can characterize inputs, control outputs and provide internal timing for the program execution.
5. Interrupt control: Up to 12 independent interrupt sources can control when the CPU deal with each source.
6. Powerful output pin control: A single instruction can select and drive a single output pin high or low in its 0.2 us instruction execution time. The PIC can drive a load of up to 25μA.
7.1/0 port expansion: With the help of built in serial peripheral interface the number of 1/0 ports can be expanded. EPROM/DIP/ROM options are provided.
3. Explain Memory organization of PIC
Microcontroller?
Memory organization: The memory module of the PICcontroller has three memory blocks. a) Program memory b) Data memory and c) Stack a) Program Memory:
The PIC 16F8XX has 4k x14 program memory space (0000H-OFFFH). It has a 13 bit Program counter(PC) to access any address (213-4k). This PIC family uses 13- bit program counter allowing the controllers to an 8k- program memory without changing the CPU structure.
Two addresses in the program memory address space are treated in a special way by the CPU. The first address H'000' being a go to mainline instruction the second special address, H' 004' being a 'go to in service' instruction can be assigned to this address to make the CPU to jump to the beginning of the Interrupt Service routine located elsewhere in the memory space. When we deal with tables, they are assigned to addresses in the range H'005 - H'OFF' because for most of the applications this space is sufficient. The main line program begins after the tables.
DATA MEMORY The data memory of PIC 16F8XX is partitioned into multiple banks which contain the general-purpose registers and the Special function Registers. (SFRs). The bits RP1 and RPO bits of the status register are used to select these banks. Each bank extends up to 7FH (128 Bytes). The lower bytes of the each bank are reserved for the Special Function Registers. Above the SFRS are general purpose registers implemented as static RAM.
4. Asynchronous communication of PIC16F873.
When doing a data communication, the condition of "O" and "1" to have let out from the side of the sending it must be able to be recognized in the receiving side. In the asynchronous communication, it puts a start bit to the head of the transferred data (8 bits or 9 bits) and it puts a stop bit at the end of the data. Recognition in the data block is done by it. The start bit is an L level and the stop bit is the signal of the H level.
The circuit of the condition not to transfer data is H level. When becoming an L level (Start bit) from this condition, the receiving side recognizes that the data transfer begins. After that, according to the signalling speed, the transfer of the data is done. The transfer of the block ends when a stop bit (H level) is detected last. A signalling speed is controlled by the timer which is independent in the sender and the receiving side. So, it isn't possible to do correct communication when there is an error in this timer.
In the asynchronous mode communication of USART, the RX port is used for receiving and the TX port is used for the transmission, so, it is possible to send and receive at the same time. (Full duplex)
Post a Comment
0 Comments