SlideShare a Scribd company logo
1 of 114
Download to read offline
EMBEDDED 
SYSTEMS 
18-10-2014 
EMBEDDED SYSTEMS 
1
Agenda 
Embedded System Basics – PART 1 
Introduction to Embedded systems 
Embedded Processors & their Architectures 
Serial communication 
RTOS Concepts 
Videos of Embedded applications 
18-10-2014 
2 
EMBEDDED SYSTEMS
Embedded Programming in C- PART 2 
Embedded Software Development Process and Tools 
Embedded programming Demo for PIC Microcontroller & simulation using Proteus & MPLAB IDE 
How to write a program 
How to handle the datasheets of the processors 
Embedded programming Demo for MSP430 by using Code Composer Studio 
How to write a program 
How to handle the datasheets of the processors 
18-10-2014 
EMBEDDED SYSTEMS 
3
System Definition 
A way of working, organizing or performing one or many tasks according to a fixed set of rules, program or plan. 
Also an arrangement in which all units assemble and work together according to a program or plan. 
Examples: 
Time display system – A watch 
 Automatic cloth washing system- A washing machine 
18-10-2014 
4 
EMBEDDED SYSTEMS
System Examples 
It is an automatic clothes washing system Parts: Status display panel, Switches & Dials, Motor, Power supply & control unit, Inner water level sensor and solenoid valve. 
Process: 
1.Wash by spinning 
2.Rinse 
3.Drying 
4.Wash over by blinking 
5.Each step display the process stage 
6.In case interruption, execute only the remaining 
18-10-2014 
5 
EMBEDDED SYSTEMS
Embedded Systems- Definition 
“An embedded system is a system that has software embedded into computer-hardware, which makes a system dedicated for an application(s) or specific part of an application or product or part of a larger system.” 
It is any device that includes a programmable computer but is not itself intended to be a general purpose computer.” 
18-10-2014 
6 
EMBEDDED SYSTEMS
Embedded Systems- Architecture 
18-10-2014 
7 
EMBEDDED SYSTEMS
Microprocessors 
CPU for Computers 
No RAM, ROM, I/O on CPU chip itself 
Example:Intel’s x86, Motorola’s 680x0 
CPU 
General- Purpose Micro- processor 
RAM 
ROM 
I/O Port 
Timer 
Serial COM Port 
Data Bus 
Address Bus 
General-Purpose Microprocessor System 
Many chips on mother’s board 
18-10-2014 
8 
EMBEDDED SYSTEMS
•A smaller computer 
•On-chip RAM, ROM, I/O ports... 
•Example:Motorola’s 6811, Intel’s 8051, Zilog’s Z8 and PIC 16X 
A single chip 
RAM 
ROM 
I/O Port 
Timer 
Serial COM Port 
Microcontroller 
CPU 
Microcontrollers 
18-10-2014 
9 
EMBEDDED SYSTEMS
Processor Architectures 
1-Von Neumann Architecture 
Single memory & single bus for transferring the data into & out of the CPU. 
Multiplication of two numbers require atleast 3 clk cycles 
18-10-2014 
10 
EMBEDDED SYSTEMS
2-Harvard Architecture 
 Separate memory for data & program with separate buses for each 
Both program instructions & data can be fetched at the same time 
Operational speed is higher than Von Neumann 
18-10-2014 
11 
EMBEDDED SYSTEMS
3-Super Harvard Architecture (DSP Processors) 
18-10-2014 
12 
EMBEDDED SYSTEMS 
 DSP Algorithms spend their most of the time in loops. So instruction Cache is added 
 Processing of many “high” frequency signals in real time 
 Multiply–Accumulate operation 
 Fixed point/ floating point, Matrix operations, convolution , correlation, parallelism etc. 
eg:C5000, C6000 single core processor families
DSP Pipeline Architecture 
18-10-2014 
EMBEDDED SYSTEMS 
13 
C6000 fetch eight 32 bit instructions per clock cycles
Mechanism in Microcontrollers 
18-10-2014 
14 
EMBEDDED SYSTEMS
Difference between DSP & μC 
DSPs often don't have a flash program memory. They need the software to be 'loaded' into them. Whereas, microcontrollers have a non power off erasable program memory inside, some with EPROM store capabilities. 
DSPs are much faster for integer mathematics operations, whereas many microcontrollers do not have the hardware. 
DSPs are much faster for floating point operations. In microcontrollers, this has to be done in software. 
DSPs are oriented to be an input/output device with 'fast calculating machine'. Microcontrollers are a multi-feature device with several ways of interfacing with the world, however none are the fastest. 
18-10-2014 
EMBEDDED SYSTEMS 
15
DSPs are not designed to be a 'robust' device. They need a well designed board to work properly. Microcontrollers can work on a Test Board. 
DSPs are a fast calculator microprocessor, that is very effective for computing calculations and moving data, whereas, microcontrollers are a more flexible device with more features. 
Eg: 1) Image, audio & video processing by DSP 
2)Data-transmission & control signals by Microcontroller 
18-10-2014 
EMBEDDED SYSTEMS 
16
Texas Instruments (DSP+ARM processor) 
Davinci- (video streaming applications ) 
Multicore processors 
 OMAP application processors (Image processing) 
Analog Devices 
Black-fin Processor (DSP+ARM) 
18-10-2014 
EMBEDDED SYSTEMS 
17 
Digital Signal Controllers (Combined Processor Architectures)
How the PC Starts 
Microcontroller searches its first instruction to execute 
BIOS in Flash chip provides the Initial instructions to the μc 
BIOS does several sequences: 
1. Check the CMOS Setup for custom settings 
CMOS setup present in Nonvolatile RAM (NVRAM) or CMOS RAM 
CMOS RAM & RTC integrated as a Southbridge Chipset, which is powered by CMOS battery (CMOS RAM-64 to 512 bytes capacity) 
CMOS setup consists of sys time/date, Chipsets status, memory management 
18-10-2014 
EMBEDDED SYSTEMS 
18
2. Load the interrupt handlers and device drivers 
3. Initialize registers and power management 
4. Perform the power-on self-test (POST) 
5. Display system settings 
6. Determine which devices are bootable 
7. Initiate the bootstrap sequence – the order to Boot OS 
Cold boot – restart PC with the power being off 
Warm boot or normal boot- restart PC when the power is ON 
18-10-2014 
EMBEDDED SYSTEMS 
19
18-10-2014 
EMBEDDED SYSTEMS 
20
18-10-2014 
EMBEDDED SYSTEMS 
21 
HARD DISK 
MOTHER BOARD
VARIOUS MICROCONTROLLERS 
INTEL 
8031,8032,8051,8052,8751,8752, Pentium etc 
PIC 
8-bit PIC16, PIC18, 16-bit DSPIC33 / PIC24, PIC16C7x 
Motorola 
MC68HC11 
ARM – ARM7, ARM9, ARM 11 
18-10-2014 
22 
EMBEDDED SYSTEMS
Types of Processors 
18-10-2014 
EMBEDDED SYSTEMS 
23
EMBEDDED PROCESSOR 
Special microprocessors & microcontrollers often called, Embedded processors. 
An embedded processor is used when fast processing fast context-switching & atomic ALU operations are needed. 
Examples : ARM 7, INTEL i960, AMD 29050. 
18-10-2014 
24 
EMBEDDED SYSTEMS
DIGITAL SIGNAL PROCESSOR 
DSP as a GPP is a single chip VLSI unit. 
It includes the computational capabilities of microprocessor and multiply & accumulate units (MAC). 
DSP has large number of applications such as image processing, audio, video & telecommunication processing systems. 
It is used when signal processing functions are to be processed fast. 
Examples : TMS320Cxx, SHARC, Motorola 5600xx 
18-10-2014 
25 
EMBEDDED SYSTEMS
APPLICATION SPECIFIC SYSTEM PROCESSOR (ASSP) 
ASSP is dedicated to specific tasks and provides a faster solution. 
An ASSP is used as an additional processing unit for running the application in place of using embedded software. 
Examples : IIM7100, W3100A 
18-10-2014 
26 
EMBEDDED SYSTEMS
APPLICATIONS 
Household appliances: 
Microwave ovens, Television, DVD 
Players & Recorders 
Audio players 
Integrated systems in aircrafts and 
missiles 
Cellular telephones 
Electric and Electronic Motor controllers 
Engine controllers in automobiles 
Calculators 
 Medical equipments etc... 
18-10-2014 
27 
EMBEDDED SYSTEMS
Automotive embedded systems 
Today’s high-end automobile may have 100 microprocessors 
4-bit microcontroller checks seat belt 
microcontrollers run dashboard devices 
16/32-bit microprocessor controls engine 
18-10-2014 
28 
EMBEDDED SYSTEMS
18-10-2014 
29 
EMBEDDED SYSTEMS
SERIAL COMMUNICATION 
18-10-2014 
30 
EMBEDDED SYSTEMS
SERIAL PORT: 
one bit can communicate & the bits transmitted at periodic intervals generated by a clock. 
Short and long distance communication. 
PARALLEL PORT: 
Multiple bits can communicate over a set of parallel lines at any given instance. 
Communication within the same board. 
Short distance communication. 
18-10-2014 
31 
EMBEDDED SYSTEMS
Serial communication 
Mainly divided into 
Synchronous- Data is received or transmitted at constant time intervals with uniform phase differences. Eg: audio inputs, frames sent over a LAN 
Asynchronous- Data is received or transmitted at variable time intervals. Eg: keypad communication, Modem. 
18-10-2014 
32 
EMBEDDED SYSTEMS
Synchronous 
Asynchronous 
Constant time intervals 
Random time intervals 
No Handshaking between Tx & Rx 
Handshaking between Tx & Rx 
Clock is known to the receiver explicitly 
Clock is known to the receiver implicitly 
Eg: SPI, SCI, SI and SDIO 
Eg: RS232, UART, HDLC etc 
DIFFERENCE 
18-10-2014 
33 
EMBEDDED SYSTEMS
Synchronous Transmission 
18-10-2014 
34 
EMBEDDED SYSTEMS
Asynchronous Transmission 
18-10-2014 
35 
EMBEDDED SYSTEMS
What is the difference between RS232 and UART? 
RS232 is a specification for serial communications between a DCE and DTE it defines electrical characteristics, the 25-way 'D' connector and the various functions of the various signal lines. 
A UART is a Universal Asynchronous Receiver and Transmitter - it is an electronic circuit which handles communication over an asynchronous serial interface - very often an RS232 interface. 
18-10-2014 
36 
EMBEDDED SYSTEMS
UART Frame format 
1 
0 
1bit time= 1/baud rate 
10 transition 
18-10-2014 
37 
EMBEDDED SYSTEMS
RS232 
Interfacing signal standard 
Follows asynchronous UART protocol 
Point to point interface 
18-10-2014 
38 
EMBEDDED SYSTEMS
UART circuit within microcontroller 
RS232 
18-10-2014 
39 
EMBEDDED SYSTEMS
SERIAL COMMUNICATION PROTOCOLS 
18-10-2014 
40 
EMBEDDED SYSTEMS
SPI- Synchronous Peripheral Interface 
-Defined by Motorola on the MC68HCxx line of microcontrollers 
-Full duplex 
-It supports 1) full master mode 2) slave mode(with general address call) - Addressing each device is not needed 
•-If SS pin set as 1- Master 
-If SS pin set as 0- Slave 
-It is called as 3 wire communication 
-Allows 8 bit to transmit & receive 
-Generally faster than I2C, capable of several Mbps 
-Bus Arbitration logic is needed 
18-10-2014 
41 
EMBEDDED SYSTEMS
 A master sends a clock signal, and upon each clock pulse it shifts one bit out to the slave, and one bit in, coming from the slave. 
Master PIC 
Slave PIC 
18-10-2014 
42 
EMBEDDED SYSTEMS
18-10-2014 
EMBEDDED SYSTEMS 
43 
Using separate chip selects Daisy chaining 
43 
BUS ARBITRATION
Applications of SPI 
Like I2C, used in EEPROM, Flash, and real time clocks 
Better suited for “data streams”, i.e. ADC converters 
Full duplex capability, i.e. communication between a codec and digital signal processor 
18-10-2014 
44 
EMBEDDED SYSTEMS
I2C (Inter Integrated Circuit) 
Developed by Philips Semiconductor for TV sets in the 1980’s 
2-wire serial bus – Serial data (SDA) and Serial clock (SCL) 
Half-duplex, synchronous 
I2c supports 1) master mode 
2)slave mode 
3)multi master mode 
 Addressing is needed (eg: In PIC- MSSP Address Register ) 
No chip select or arbitration logic required 
18-10-2014 
45 
EMBEDDED SYSTEMS
I2C 
1. Master sends start condition (S) and controls the clock signal 
2. Master sends a unique 7-bit slave device address 
3. Master sends read/write bit (R/W) – 0 - slave receive, 1 - slave transmit 
4. Wait for/Send an acknowledge bit (A). 
5. Send/Receive the data byte (8 bits) (DATA). 
6. Expect/Send acknowledge bit (A). 
7. Send the STOP bit (P). 
18-10-2014 
46 
EMBEDDED SYSTEMS
I2C Data Transfer 
Data Transfer from master to slave 
Data transfer from slave to master 
18-10-2014 
47 
EMBEDDED SYSTEMS
18-10-2014 
48 
EMBEDDED SYSTEMS 
Example
Applications 
Used as a control interface to signal processing devices that have separate data interfaces, e.g. RF tuners, video decoders and encoders, and audio processors. 
18-10-2014 
49 
EMBEDDED SYSTEMS
CAN 
CAN is a serial bus system, which was originally developed for automotive applications in 1980 by BOSCH 
Data link layer protocol internationally standard as ISO 11898-1 
Referred as network of independent controllers 
CAN provides 2 Communication Services: 
Sending of a message- data frame transmission 
Requesting of a message- remote transmission request 
Message based protocol not an address based protocol 
Bidirectional and the data rate is 1 Mbps 
18-10-2014 
50 
EMBEDDED SYSTEMS
12 
6 
7Bits(all zeros) 
1 1 1 
If RTR sets as 1- packet is a data to the RX 
If RTR sets as 0- packet is a request for the data from the RX 
CAN DATA FRAME FORMAT 
18-10-2014 
51 
EMBEDDED SYSTEMS
3.75v 
2.5v 
1.25 
2.5v 
1 
0 
1 
CAN HIGH 
CAN LOW 
Idle 
Transmitting Bits 
Idle 
Recessive Dominant Recessive 
18-10-2014 
52 
EMBEDDED SYSTEMS
USB (Universal Serial Bus) 
Bus between host system & number of interconnected peripheral devices 
Addressable bus system 
Hot swapping or hot plugging or plug & play- no Interruption, no reboot, auto configuration. 
Bus powered 
Star topology 
18-10-2014 
53 
EMBEDDED SYSTEMS
18-10-2014 
EMBEDDED SYSTEMS 
54 
Star topology
3 standards are : 
USB 1.1-1.5 Mbps to 12 Mbps, support up to 127 devices 
USB2.0-1.5, 12 and 480 megabits per second data transfer 
USB 3.0-Super Speed >4.8 Gbits/sec 
18-10-2014 
55 
EMBEDDED SYSTEMS 
Up stream 
Down stream 
PIN Diagram
USB ROOT HUB CONTROLLER or HOST INTERFACE CONTROLLER 
USB STICK 
MASTER 
SLAVE 
MEMORY CONTROLLER 
18-10-2014 
56 
EMBEDDED SYSTEMS
When the Host powers up, Enumeration process starts (host address 0x00) 
-polls each of the Slave devices 
-assigns unique address (7bit address code) 
-finds each device Speed and type of data transfer 
-device drivers are loaded for auto configuration 
-virtual pipes are established for data communication 
18-10-2014 
EMBEDDED SYSTEMS 
57 
(Unidirectional)
18-10-2014 
EMBEDDED SYSTEMS 
58 
USB can support four data transfer types or transfer mode: 1. Control 2. Isochronous eg: keyboard, mouse 3. Bulk eg: printer 4. Interrupt eg: memory stick
Secure Digital (or SD) is a non-volatile FLASH memory card format for use in portable devices, such as mobile phones, digital cameras, GPS navigation devices, and tablet computers. 
Flash memory is an electronic non-volatile computer storage device that can be electrically erased and reprogrammed. 
Programmable for communication in SPI mode or 1bit SD mode or 4bit SD 
Secure Digital Card(SDIO) 
18-10-2014 
59 
EMBEDDED SYSTEMS
Multi media cards 
2 NAND CHIPS AND ONE SD CONTROLLER 
Secure Digital Card(SDIO) 
18-10-2014 
60 
EMBEDDED SYSTEMS
18-10-2014 
61 
EMBEDDED SYSTEMS
18-10-2014 
62 
EMBEDDED SYSTEMS
Memory Model 
18-10-2014 
63 
EMBEDDED SYSTEMS 
When func calls, temporary variables are pushed. 
When func exits, variables are popped 
Dynamic memory allocation, Malloc,realloc,free 
Objects and 
Program memory 
Data memory
Stack : store temporary variables created by funcs 
Fast access 
Managed automatically by CPU 
Local variables only 
Limited stack size. (stack overflow will occur) 
Grows downwards- going to reach its limit 
Heap : memory allocation can be done by using malloc, realloc & free (dynamic memory allocation) 
Slow access 
Managed by the programmer 
Variables can be accessed globally 
No limit on memory 
Grows upwards- its limit increases continuously 
18-10-2014 
EMBEDDED SYSTEMS 
64
Process and Threads 
A process is an instance of a computer program that is being executed. It contains the program code and its current activity 
18-10-2014 
EMBEDDED SYSTEMS 
65 
PROCESS 
THREADS 
Instance of a computer program being executed 
Subsets of a process 
Independent resources & memory 
Shared resources & memory 
Context switching is slow 
Context switching is fast 
Independent 
Depends on their own process
Process Concept 
Process – a program in execution process execution must progress in sequential fashion 
A process includes: 
program counter 
stack 
data section 
Task is a similar one to process. But the term TASK is often used in RTOS. 
Task – a embedded program in execution 
But in some RTOS, the term PROCESS is also used 
18-10-2014 
66 
EMBEDDED SYSTEMS
Process State 
As a process executes, it changes state 
new: Create & memory allotted 
ready: The process is waiting to run while the high priority tasks are running 
running: executing with allotted resources. Some times it preempts by another priority task 
Waiting(blocked): The process is waiting for some event to occur 
terminated: The process has finished execution & memory gets de-allotted. 
18-10-2014 
67 
EMBEDDED SYSTEMS
Diagram of Process State 
18-10-2014 
68 
EMBEDDED SYSTEMS 
(Blocked)
Process Control Block (PCB) 
Information associated with each process 
Process state 
Program counter 
CPU registers 
CPU scheduling information 
Memory-management information 
Accounting information 
I/O status information 
18-10-2014 
69 
EMBEDDED SYSTEMS
CPU Switch From Process to Process 
18-10-2014 
70 
EMBEDDED SYSTEMS
Process Scheduling Queues 
Job queue – set of all processes in the system 
Ready queue – set of all processes residing in main memory, ready and waiting to execute 
Device queues – set of processes waiting for an I/O device 
Processes migrate among the various queues 
18-10-2014 
71 
EMBEDDED SYSTEMS
Ready Queue And Various I/O Device Queues 
18-10-2014 
72 
EMBEDDED SYSTEMS
Migration of ‘A’ From Disk to Register 
18-10-2014 
73 
EMBEDDED SYSTEMS
Interrupts is a mechanism for alleviating the delay caused by this uncertainty and for maximizing system performance. 
18-10-2014 
EMBEDDED SYSTEMS 
74 
Transferring Data Between the CPU and I/O Device 
What is Interrupt Mechanism ?
Transferring Data Between the CPU and I/O Device 
•Polling 
•Wait states 
•Interrupts 
18-10-2014 
75 
EMBEDDED SYSTEMS
Polling 
One method used in small system to alleviate the problem of I/O devices with variable delays. 
Repeatedly checking its ports 
18-10-2014 
76 
EMBEDDED SYSTEMS 
CPU 
I/0 device 
Request Again 
Device ready signal 
Fails 
Request 
Data transfer
wait states 
18-10-2014 
77 
EMBEDDED SYSTEMS 
CPU 
I/0 device 
am waiting 
Device ready signal 
Please wait 
Request 
Device ready signal 
Data transfer
Disadvantages of Polling & wait states 
The CPU does not perform any useful work while waiting for the I/O device to become ready to transfer data. To make use of this wasted CPU time, interrupts are developed. 
18-10-2014 
78 
EMBEDDED SYSTEMS
Interrupts 
Instead of polling the device or entering a wait state, the CPU continuously executing its instructions & performing useful work. 
When the device is ready to transfer data, it sends an interrupts request to the CPU; this is done via a dedicated signal on the control bus. 
18-10-2014 
79 
EMBEDDED SYSTEMS 
CPU 
I/0 device 
Interrupt ACK signal 
Interrupt Request 
Data transfer
1. Normal program execution 
2. Interrupt occurs 
3. Processor state saved 
4. Interrupt routine runs 
5. Interrupt routine terminates 
6. Processor state restored 
7. Normal program execution resumes 
Handling an Interrupt 
18-10-2014 
80 
EMBEDDED SYSTEMS 
Context switching 
Context switching
Shared data problem 
•Arises when an interrupt service routine and the task code share the data or between two tasks that share the data. 
•In order to solve the problem, we need to make the shared data “atomic” 
•A part of the program is said to be “atomic” if it cannot be interrupted by anything 
18-10-2014 
81 
EMBEDDED SYSTEMS
Semaphores 
Semaphores: Introduced by Dijkstra in 1960s 
Semaphore is a variable or a signal event 
Provides the synchronization mechanism 
Eg: open-close, up-down, pend-post, lock-unlock 
Synchronization mechanism is required at the entry and exit of critical section to ensure exclusive use. This mechanism is semaphore. 
18-10-2014 
82 
EMBEDDED SYSTEMS
Semaphores have two purposes 
Mutex: Ensure threads don’t access critical section at same time 
Scheduling constraints: Ensure threads execute in specific order 
18-10-2014 
83 
EMBEDDED SYSTEMS 
Semaphores
Real time Semaphores 
18-10-2014 
84 
EMBEDDED SYSTEMS 
Railways 
Airways 
Navy
Mutual Exclusion (Mutex) 
Mutex is a program or object that is created, when we start the process. 
Any task needs the resource must use the Mutex to lock the resource from other task while it is using the resource. 
If the Mutex is already locked, other tasks are queued. 
18-10-2014 
85 
EMBEDDED SYSTEMS
Critical section 
In concurrent programming, a critical section is a piece of code that accesses a shared resource that must not be concurrently accessed by more than one thread of execution. 
Semaphore taken critical section semaphore release 
18-10-2014 
86 
EMBEDDED SYSTEMS
Conditions for Implementing the Critical Section 
Disable the interrupts, when try to enter into the CS 
Avoid system calls that can cause a context switch while inside the CS. 
Whatever may be, any kind of code must not disturb the CS, until the original thread leaves its CS. 
This approach can be improved by using semaphores. 
Eg: Printer can only be accessed by one process at a time 
But other processes are free to gain the control of CPU & execute other code or CS that are protected by different semaphores. 
18-10-2014 
87 
EMBEDDED SYSTEMS
Deadlock Characterization 
Deadlock can arise if four conditions hold simultaneously. 
Mutual exclusion: only one process at a time can use a resource. 
Hold and wait: a process holding at least one resource is waiting to acquire additional resources held by other processes. 
No preemption: a resource can be released only voluntarily by the process holding it, after that process has completed its task. 
Circular wait: there exists a set {P0, P1, …, P0} of waiting processes such that P0 is waiting for a resource that is held by P1, P1 is waiting for a resource that is held by P2, …, Pn–1 is waiting for a resource that is held by Pn, and P0 is waiting for a resource that is held by P0. 
18-10-2014 
88 
EMBEDDED SYSTEMS
Pre-emption 
The act of temporarily interrupting a task being carried out by a computer system without requiring its cooperation. 
Preemptive scheduler consists of high priority tasks which has the power to preempt or interrupt any process. 
But kernel functions cannot be preempted 
18-10-2014 
89 
EMBEDDED SYSTEMS
Embedded Software's: 
IDE- Integrated Development Environment 
Compiler The compiler turns source code into machine code packaged in object files. (HI-tech compiler, CCS etc) 
Cross compilerA cross-compiler produces object files that will then be linked for the target instead of the computer running the compiler 
A cross compiler is a compiler capable of creating executable code for a platform other than the one on which the compiler is running.( eg: GCC for linux) 
DebuggerA special program used to find errors (bugs) in other programs. A debugger allows a programmer to stop a program at any point and examine and change the values of variables. 
18-10-2014 
90 
EMBEDDED SYSTEMS
The Simulator tries to duplicate the behaviour of the device. The Emulator tries to duplicate the inner workings of the device.(mimicry) 
Emulation is the replacement of a real world device with an model at a well defined interface for the purposes of allowing controlled responses from the emulated real world device. 
18-10-2014 
EMBEDDED SYSTEMS 
91
18-10-2014 
92 
EMBEDDED SYSTEMS
Introduction to MSP430 
The MSP430 can be used for low powered embedded devices. 
The electric current drawn in idle mode can be less than 1 μA. 
The top CPU speed is 25 MHz. It can be throttled back for lower power consumption. 
Six different low-power modes, which can disable unneeded clocks and CPU. 
Capable of wake-up times below 1 microsecond, allowing the microcontroller to stay in sleep mode longer, minimizing its average current consumption. 
18-10-2014 
93 
EMBEDDED SYSTEMS
18-10-2014 
94 
EMBEDDED SYSTEMS
PIN DIAGRAM OF MSP430G2553 
18-10-2014 
95 
EMBEDDED SYSTEMS
18-10-2014 
96 
EMBEDDED SYSTEMS
Digital IO Control: 
Digital I/O is configured by user software 
– Input Register PxIN 
– Output Register PxOUT 
– Direction Register PxDIR 
– Pullup/Pulldown Resistor Enable Register PxREN 
– Function Select Registers PxSEL and PxSEL2 
• Most likely will not need to use these 
– Each pin has interrupt capabilities 
18-10-2014 
97 
EMBEDDED SYSTEMS
Input Register PxIN 
Each bit in each PxIN register reflects the value of the input signal at the corresponding I/O pin when the pin is configured as I/O function. 
Bit = 0: The input is low 
Bit = 1: The input is high 
18-10-2014 
98 
EMBEDDED SYSTEMS
Output Registers PxOUT 
Each bit in each PxOUT register is the value to be output on the corresponding I/O pin when the pin is configured as I/O function, output direction, and the pullup/down resistor is disabled. 
Bit = 0: The output is low 
Bit = 1: The output is high 
If the pin's pullup/pulldown resistor is enabled, the corresponding bit in the PxOUT register selects pullup or pulldown. 
Bit = 0: The pin is pulled down 
Bit = 1: The pin is pulled up 
18-10-2014 
99 
EMBEDDED SYSTEMS
Direction Registers PxDIR 
Each bit in each PxDIR register selects the direction of the corresponding I/O pin, regardless of the selected function for the pin. PxDIR bits for I/O pins that are selected for other functions must be set as required by the other function. 
Bit = 0: The port pin is switched to input direction 
Bit = 1: The port pin is switched to output direction 
18-10-2014 
100 
EMBEDDED SYSTEMS
Pullup/Pulldown Resistor Enable Registers PxREN 
Each bit in each PxREN register enables or disables the pullup/pulldown resistor of the corresponding I/O pin. The corresponding bit in the PxOUT register selects if the pin is pulled up or pulled down. 
Bit = 0: Pullup/pulldown resistor disabled 
Bit = 1: Pullup/pulldown resistor enabled 
18-10-2014 
101 
EMBEDDED SYSTEMS
Function Select Registers PxSEL and PxSEL2 
Port pins are often multiplexed with other peripheral module functions. See the device-specific data sheet to determine pin functions. Each PxSEL and PxSEL2 bit is used to select the pin function - I/O port or peripheral module function. 
18-10-2014 
102 
EMBEDDED SYSTEMS
How to enable the pins or bits 
Each pin in port can also acts as a register. 
If the port 1 has 8 pins (p1.0 to p1.7) 
To enable the pins: just set 0 or 1 
For example set P1.1 & P1.6 and form the hexadecimal code 
4 2 
Write as 0x42 
P1.7 
P1.6 
P1.5 
P1.4 
P1.3 
P1.2 
P1.1 
P1.0 
0 
1 
0 
0 
0 
0 
1 
0 
18-10-2014 
103 
EMBEDDED SYSTEMS
Low power modes 
18-10-2014 
104 
EMBEDDED SYSTEMS
#define LPM0_bits (CPUOFF) 
#define LPM1_bits (SCG0+CPUOFF) 
#define LPM2_bits (SCG1+CPUOFF) 
#define LPM3_bits (SCG1+SCG0+CPUOFF) 
#define LPM4_bits (SCG1+SCG0+OSCOFF+CPUOFF) 
18-10-2014 
105 
EMBEDDED SYSTEMS
#define LPM0 _bis_SR_register(LPM0_bits) /* Enter Low Power Mode 0 */ 
#define LPM0_EXIT _bic_SR_register_on_exit(LPM0_bits) /* Exit Low Power Mode 0 */ 
#define LPM1 _bis_SR_register(LPM1_bits) /* Enter Low Power Mode 1 */ 
#define LPM1_EXIT _bic_SR_register_on_exit(LPM1_bits) /* Exit Low Power Mode 1 */ 
#define LPM2 _bis_SR_register(LPM2_bits) /* Enter Low Power Mode 2 */ 
#define LPM2_EXIT _bic_SR_register_on_exit(LPM2_bits) /* Exit Low Power Mode 2 */ 
#define LPM3 _bis_SR_register(LPM3_bits) /* Enter Low Power Mode 3 */ 
#define LPM3_EXIT _bic_SR_register_on_exit(LPM3_bits) /* Exit Low Power Mode 3 */ 
#define LPM4 _bis_SR_register(LPM4_bits) /* Enter Low Power Mode 4 */ 
#define LPM4_EXIT _bic_SR_register_on_exit(LPM4_bits) /* Exit Low Power Mode 4 */ 
18-10-2014 
106 
EMBEDDED SYSTEMS
Led toggling: 
#include <msp430g2553.h> 
unsigned int i; 
void main(void) 
{ 
 WDTCTL=WDTPW + WDTHOLD;// watch dog timer disabled 
 P1DIR |= 0X41; // here itself P1OUT = 0100 0001 //led on the pin will glow 
 while(1) 
 { 
 P1OUT ^= 0X41; //0100 0001 Exor 0100 0001= 0000 0000// led will off for the given delay 
 for(i=0;i<50000;i++); 
 } 
} 
18-10-2014 
107 
EMBEDDED SYSTEMS
Analog to digital module 
The ADC10 module is a high-performance 10-bit analog-to-digital converter. 
Refer the data sheet page no: 558 
18-10-2014 
108 
EMBEDDED SYSTEMS
The USCI module is used for serial data communication. The USCI module supports synchronous communication protocols such as SPI (3 or 4 pin) and I2C, an asynchronous communication protocols such as UART, enhanced UART with automatic baudrate detection (LIN), and IrDA. Not all packages support the USCI functionality. 
USCI_A0 provides support for SPI (3 or 4 pin), UART, enhanced UART, and IrDA. 
USCI_B0 provides support for SPI (3 or 4 pin) and I2C. 
Universal Serial Communications Interface (USCI) 
18-10-2014 
109 
EMBEDDED SYSTEMS
UART Steps: 
1. The I/O pins have to be selected for the UART function 
2. A clock with a certain frequency must be sourced to the UART module 
3. Enable UART TX or RX or Both 
4. Select the byte format as 7- or 8-bit data with odd, even, or non-parity 
5. Set the baud generator correctly so as to get a correct baud rate from the clock sourced 
6. Enable the module 
18-10-2014 
110 
EMBEDDED SYSTEMS
synchronous 
18-10-2014 
111 
EMBEDDED SYSTEMS
16X2 LCD PIN OUT 
18-10-2014 
112 
EMBEDDED SYSTEMS
EMBEDDED COMPANIES 
Intel 
Texas Instruments 
 Freescale 
 Philips 
 Samsung 
 LG Electronics 
 Tata Elxsi/Sasken 
 Ittiam Systems 
 Infosys/TCS 
 HCL Technologies/Wipro 
 Analog Devices 
 Mphasis/BFL 
 Symphony 
 Sonata Software 
 Mistral/eInfochips 
Dexcel Designs 
Robosoft/Yindusoft 
Qualcomm 
Etc……………. 
18-10-2014 
113 
EMBEDDED SYSTEMS
Thank you 
18-10-2014 
114 
EMBEDDED SYSTEMS

More Related Content

What's hot

Introduction to Embedded System
Introduction to Embedded SystemIntroduction to Embedded System
Introduction to Embedded SystemZakaria Gomaa
 
Embedded Systems - Training ppt
Embedded Systems - Training pptEmbedded Systems - Training ppt
Embedded Systems - Training pptNishant Kayal
 
Typical Embedded System
Typical Embedded SystemTypical Embedded System
Typical Embedded Systemanand hd
 
Ch 1 introduction to Embedded Systems (AY:2018-2019--> First Semester)
Ch 1 introduction to Embedded Systems (AY:2018-2019--> First Semester)Ch 1 introduction to Embedded Systems (AY:2018-2019--> First Semester)
Ch 1 introduction to Embedded Systems (AY:2018-2019--> First Semester)Moe Moe Myint
 
EE6602 Embedded System
EE6602 Embedded SystemEE6602 Embedded System
EE6602 Embedded Systemrmkceteee
 
Introduction to embedded systems
Introduction to embedded systemsIntroduction to embedded systems
Introduction to embedded systemsApurva Zope
 
PIC timer programming
PIC timer programmingPIC timer programming
PIC timer programmingAkash Puri
 
Introduction to embedded system design
Introduction to embedded system designIntroduction to embedded system design
Introduction to embedded system designMukesh Bansal
 
PIC 16F877A by PARTHIBAN. S.
PIC 16F877A   by PARTHIBAN. S.PIC 16F877A   by PARTHIBAN. S.
PIC 16F877A by PARTHIBAN. S.parthi_arjun
 
Embedded systems - UNIT-1 - Mtech
Embedded systems - UNIT-1 - MtechEmbedded systems - UNIT-1 - Mtech
Embedded systems - UNIT-1 - Mtechsangeetha rakhi
 
Introduction to AVR Microcontroller
Introduction to AVR Microcontroller Introduction to AVR Microcontroller
Introduction to AVR Microcontroller Mahmoud Sadat
 

What's hot (20)

Introduction to Embedded System
Introduction to Embedded SystemIntroduction to Embedded System
Introduction to Embedded System
 
Embedded Systems - Training ppt
Embedded Systems - Training pptEmbedded Systems - Training ppt
Embedded Systems - Training ppt
 
Typical Embedded System
Typical Embedded SystemTypical Embedded System
Typical Embedded System
 
Ch 1 introduction to Embedded Systems (AY:2018-2019--> First Semester)
Ch 1 introduction to Embedded Systems (AY:2018-2019--> First Semester)Ch 1 introduction to Embedded Systems (AY:2018-2019--> First Semester)
Ch 1 introduction to Embedded Systems (AY:2018-2019--> First Semester)
 
Embedded Systems
Embedded SystemsEmbedded Systems
Embedded Systems
 
Ccp
CcpCcp
Ccp
 
Embedded system
Embedded systemEmbedded system
Embedded system
 
Embedded System Basics
Embedded System BasicsEmbedded System Basics
Embedded System Basics
 
Interrupts
InterruptsInterrupts
Interrupts
 
EE6602 Embedded System
EE6602 Embedded SystemEE6602 Embedded System
EE6602 Embedded System
 
Introduction to embedded systems
Introduction to embedded systemsIntroduction to embedded systems
Introduction to embedded systems
 
PIC Microcontroller | ADC Interfacing
PIC Microcontroller | ADC InterfacingPIC Microcontroller | ADC Interfacing
PIC Microcontroller | ADC Interfacing
 
PIC timer programming
PIC timer programmingPIC timer programming
PIC timer programming
 
Introduction to embedded system design
Introduction to embedded system designIntroduction to embedded system design
Introduction to embedded system design
 
PIC 16F877A by PARTHIBAN. S.
PIC 16F877A   by PARTHIBAN. S.PIC 16F877A   by PARTHIBAN. S.
PIC 16F877A by PARTHIBAN. S.
 
ARM Processor
ARM ProcessorARM Processor
ARM Processor
 
Embedded system
Embedded systemEmbedded system
Embedded system
 
Embedded systems - UNIT-1 - Mtech
Embedded systems - UNIT-1 - MtechEmbedded systems - UNIT-1 - Mtech
Embedded systems - UNIT-1 - Mtech
 
Introduction to AVR Microcontroller
Introduction to AVR Microcontroller Introduction to AVR Microcontroller
Introduction to AVR Microcontroller
 
EC8791 UML-model train controller
EC8791 UML-model train controllerEC8791 UML-model train controller
EC8791 UML-model train controller
 

Viewers also liked

basic embedded system presentation
basic embedded system presentationbasic embedded system presentation
basic embedded system presentationVimal Tripathi
 
Basics of embedded system design
Basics of embedded system designBasics of embedded system design
Basics of embedded system designK Senthil Kumar
 
Ajal mod 1
Ajal mod 1Ajal mod 1
Ajal mod 1AJAL A J
 
Embedded Basics
Embedded Basics Embedded Basics
Embedded Basics Electro 8
 
Embedded c & working with avr studio
Embedded c & working with avr studioEmbedded c & working with avr studio
Embedded c & working with avr studioNitesh Singh
 
Introduction to Embedded Systems and its Applications
Introduction to Embedded Systems and its ApplicationsIntroduction to Embedded Systems and its Applications
Introduction to Embedded Systems and its ApplicationsGaurav Verma
 
Introduction to Embedded Systems
Introduction to Embedded SystemsIntroduction to Embedded Systems
Introduction to Embedded SystemsMohamed Tarek
 
Introduction to Embedded Systems
Introduction to Embedded SystemsIntroduction to Embedded Systems
Introduction to Embedded SystemsWalaaMohamed
 
Chapter 7 8051 programming in c
Chapter 7  8051 programming in cChapter 7  8051 programming in c
Chapter 7 8051 programming in cAbdelrahman Elewah
 
8051 programming skills using EMBEDDED C
8051 programming skills using EMBEDDED C8051 programming skills using EMBEDDED C
8051 programming skills using EMBEDDED CAman Sharma
 
Programming ATmega microcontroller using Embedded C
Programming ATmega microcontroller using Embedded CProgramming ATmega microcontroller using Embedded C
Programming ATmega microcontroller using Embedded CVarun A M
 
AVR Fundamentals
AVR FundamentalsAVR Fundamentals
AVR FundamentalsVinit Vyas
 

Viewers also liked (20)

basic embedded system presentation
basic embedded system presentationbasic embedded system presentation
basic embedded system presentation
 
Basics of embedded system design
Basics of embedded system designBasics of embedded system design
Basics of embedded system design
 
Ajal mod 1
Ajal mod 1Ajal mod 1
Ajal mod 1
 
Embedded Basics
Embedded Basics Embedded Basics
Embedded Basics
 
Embedded c & working with avr studio
Embedded c & working with avr studioEmbedded c & working with avr studio
Embedded c & working with avr studio
 
C Programming - Refresher - Part I
C Programming - Refresher - Part I C Programming - Refresher - Part I
C Programming - Refresher - Part I
 
Introduction to Embedded Systems and its Applications
Introduction to Embedded Systems and its ApplicationsIntroduction to Embedded Systems and its Applications
Introduction to Embedded Systems and its Applications
 
Embedded _c_
Embedded  _c_Embedded  _c_
Embedded _c_
 
Getting started with BeagleBone Black - Embedded Linux
Getting started with BeagleBone Black - Embedded LinuxGetting started with BeagleBone Black - Embedded Linux
Getting started with BeagleBone Black - Embedded Linux
 
Introduction to Embedded Systems
Introduction to Embedded SystemsIntroduction to Embedded Systems
Introduction to Embedded Systems
 
Introduction to Embedded Systems
Introduction to Embedded SystemsIntroduction to Embedded Systems
Introduction to Embedded Systems
 
Chapter 7 8051 programming in c
Chapter 7  8051 programming in cChapter 7  8051 programming in c
Chapter 7 8051 programming in c
 
8051 programming skills using EMBEDDED C
8051 programming skills using EMBEDDED C8051 programming skills using EMBEDDED C
8051 programming skills using EMBEDDED C
 
Programming ATmega microcontroller using Embedded C
Programming ATmega microcontroller using Embedded CProgramming ATmega microcontroller using Embedded C
Programming ATmega microcontroller using Embedded C
 
Embedded Android : System Development - Part III
Embedded Android : System Development - Part IIIEmbedded Android : System Development - Part III
Embedded Android : System Development - Part III
 
AVR Fundamentals
AVR FundamentalsAVR Fundamentals
AVR Fundamentals
 
Embedded Android : System Development - Part IV
Embedded Android : System Development - Part IVEmbedded Android : System Development - Part IV
Embedded Android : System Development - Part IV
 
Embedded Android : System Development - Part I
Embedded Android : System Development - Part IEmbedded Android : System Development - Part I
Embedded Android : System Development - Part I
 
Embedded c
Embedded cEmbedded c
Embedded c
 
Embedded C - Optimization techniques
Embedded C - Optimization techniquesEmbedded C - Optimization techniques
Embedded C - Optimization techniques
 

Similar to An Entire Concept of Embedded systems

INDUSTRIAL TRAINING REPORT EMBEDDED SYSTEM.pptx
INDUSTRIAL TRAINING REPORT EMBEDDED SYSTEM.pptxINDUSTRIAL TRAINING REPORT EMBEDDED SYSTEM.pptx
INDUSTRIAL TRAINING REPORT EMBEDDED SYSTEM.pptxMeghdeepSingh
 
Emb Sys Rev Ver1
Emb Sys   Rev Ver1Emb Sys   Rev Ver1
Emb Sys Rev Ver1ncct
 
Microcontoller and Embedded System
Microcontoller and Embedded SystemMicrocontoller and Embedded System
Microcontoller and Embedded SystemKaran Thakkar
 
Embedded Systems Introdution
Embedded Systems IntrodutionEmbedded Systems Introdution
Embedded Systems IntrodutionSheikh Ismail
 
2e062d07-4a72-4792-af77-5e53147d4c81.pdf
2e062d07-4a72-4792-af77-5e53147d4c81.pdf2e062d07-4a72-4792-af77-5e53147d4c81.pdf
2e062d07-4a72-4792-af77-5e53147d4c81.pdfkimavathmukeshnaik
 
2e062d07-4a72-4792-af77-5e53147d4c81.pdf
2e062d07-4a72-4792-af77-5e53147d4c81.pdf2e062d07-4a72-4792-af77-5e53147d4c81.pdf
2e062d07-4a72-4792-af77-5e53147d4c81.pdfkimavathmukeshnaik
 
Embedded system by owais
Embedded system by owaisEmbedded system by owais
Embedded system by owaisOwais Mushtaq
 
embededsystemfinal1-170130182030 (1).ppt
embededsystemfinal1-170130182030 (1).pptembededsystemfinal1-170130182030 (1).ppt
embededsystemfinal1-170130182030 (1).pptkimavathmukeshnaik
 
Introduction to EMBEDDED SYSTEM.pdf
Introduction to EMBEDDED SYSTEM.pdfIntroduction to EMBEDDED SYSTEM.pdf
Introduction to EMBEDDED SYSTEM.pdfAkashBhagat32
 
Introduction to embedded System.pptx
Introduction to embedded System.pptxIntroduction to embedded System.pptx
Introduction to embedded System.pptxPratik Gohel
 
embedded system and microcontroller
 embedded system and microcontroller embedded system and microcontroller
embedded system and microcontrollerSHILPA Sillobhargav
 
Introduction to Embedded Systems and Microcontrollers
Introduction to Embedded Systems and MicrocontrollersIntroduction to Embedded Systems and Microcontrollers
Introduction to Embedded Systems and MicrocontrollersIslam Samir
 
Sudhir tms 320 f 2812
Sudhir tms 320 f 2812 Sudhir tms 320 f 2812
Sudhir tms 320 f 2812 vijaydeepakg
 
Project report on embedded system using 8051 microcontroller
Project  report on embedded system using 8051 microcontrollerProject  report on embedded system using 8051 microcontroller
Project report on embedded system using 8051 microcontrollerVandna Sambyal
 
Summer training embedded system and its scope
Summer training  embedded system and its scopeSummer training  embedded system and its scope
Summer training embedded system and its scopeArshit Rai
 
Real Time Atomization of agriculture system for the modernization of indian a...
Real Time Atomization of agriculture system for the modernization of indian a...Real Time Atomization of agriculture system for the modernization of indian a...
Real Time Atomization of agriculture system for the modernization of indian a...SHAMEER C M
 
Real time atomization of agriculture system for the modernization of indian a...
Real time atomization of agriculture system for the modernization of indian a...Real time atomization of agriculture system for the modernization of indian a...
Real time atomization of agriculture system for the modernization of indian a...SHAMEER C M
 

Similar to An Entire Concept of Embedded systems (20)

INDUSTRIAL TRAINING REPORT EMBEDDED SYSTEM.pptx
INDUSTRIAL TRAINING REPORT EMBEDDED SYSTEM.pptxINDUSTRIAL TRAINING REPORT EMBEDDED SYSTEM.pptx
INDUSTRIAL TRAINING REPORT EMBEDDED SYSTEM.pptx
 
Emb Sys Rev Ver1
Emb Sys   Rev Ver1Emb Sys   Rev Ver1
Emb Sys Rev Ver1
 
Microcontoller and Embedded System
Microcontoller and Embedded SystemMicrocontoller and Embedded System
Microcontoller and Embedded System
 
Embeddedsystem
EmbeddedsystemEmbeddedsystem
Embeddedsystem
 
Embedded Systems Introdution
Embedded Systems IntrodutionEmbedded Systems Introdution
Embedded Systems Introdution
 
2e062d07-4a72-4792-af77-5e53147d4c81.pdf
2e062d07-4a72-4792-af77-5e53147d4c81.pdf2e062d07-4a72-4792-af77-5e53147d4c81.pdf
2e062d07-4a72-4792-af77-5e53147d4c81.pdf
 
2e062d07-4a72-4792-af77-5e53147d4c81.pdf
2e062d07-4a72-4792-af77-5e53147d4c81.pdf2e062d07-4a72-4792-af77-5e53147d4c81.pdf
2e062d07-4a72-4792-af77-5e53147d4c81.pdf
 
Embedded system by owais
Embedded system by owaisEmbedded system by owais
Embedded system by owais
 
embededsystemfinal1-170130182030 (1).ppt
embededsystemfinal1-170130182030 (1).pptembededsystemfinal1-170130182030 (1).ppt
embededsystemfinal1-170130182030 (1).ppt
 
Introduction to EMBEDDED SYSTEM.pdf
Introduction to EMBEDDED SYSTEM.pdfIntroduction to EMBEDDED SYSTEM.pdf
Introduction to EMBEDDED SYSTEM.pdf
 
Introduction to embedded System.pptx
Introduction to embedded System.pptxIntroduction to embedded System.pptx
Introduction to embedded System.pptx
 
embedded system and microcontroller
 embedded system and microcontroller embedded system and microcontroller
embedded system and microcontroller
 
Introduction to Embedded Systems and Microcontrollers
Introduction to Embedded Systems and MicrocontrollersIntroduction to Embedded Systems and Microcontrollers
Introduction to Embedded Systems and Microcontrollers
 
Sudhir tms 320 f 2812
Sudhir tms 320 f 2812 Sudhir tms 320 f 2812
Sudhir tms 320 f 2812
 
Project report on embedded system using 8051 microcontroller
Project  report on embedded system using 8051 microcontrollerProject  report on embedded system using 8051 microcontroller
Project report on embedded system using 8051 microcontroller
 
Training report on embedded sys_AVR
Training report on embedded sys_AVRTraining report on embedded sys_AVR
Training report on embedded sys_AVR
 
M&amp;i(lec#01)
M&amp;i(lec#01)M&amp;i(lec#01)
M&amp;i(lec#01)
 
Summer training embedded system and its scope
Summer training  embedded system and its scopeSummer training  embedded system and its scope
Summer training embedded system and its scope
 
Real Time Atomization of agriculture system for the modernization of indian a...
Real Time Atomization of agriculture system for the modernization of indian a...Real Time Atomization of agriculture system for the modernization of indian a...
Real Time Atomization of agriculture system for the modernization of indian a...
 
Real time atomization of agriculture system for the modernization of indian a...
Real time atomization of agriculture system for the modernization of indian a...Real time atomization of agriculture system for the modernization of indian a...
Real time atomization of agriculture system for the modernization of indian a...
 

Recently uploaded

Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . pptDineshKumar4165
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapRishantSharmaFr
 
Intro To Electric Vehicles PDF Notes.pdf
Intro To Electric Vehicles PDF Notes.pdfIntro To Electric Vehicles PDF Notes.pdf
Intro To Electric Vehicles PDF Notes.pdfrs7054576148
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdfKamal Acharya
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 
Unit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdfUnit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdfRagavanV2
 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdfSuman Jyoti
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...Call Girls in Nagpur High Profile
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756dollysharma2066
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfRagavanV2
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptMsecMca
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptNANDHAKUMARA10
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Arindam Chakraborty, Ph.D., P.E. (CA, TX)
 
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoordharasingh5698
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdfankushspencer015
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startQuintin Balsdon
 

Recently uploaded (20)

Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
Intro To Electric Vehicles PDF Notes.pdf
Intro To Electric Vehicles PDF Notes.pdfIntro To Electric Vehicles PDF Notes.pdf
Intro To Electric Vehicles PDF Notes.pdf
 
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
Unit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdfUnit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdf
 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.ppt
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
 
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 

An Entire Concept of Embedded systems

  • 1. EMBEDDED SYSTEMS 18-10-2014 EMBEDDED SYSTEMS 1
  • 2. Agenda Embedded System Basics – PART 1 Introduction to Embedded systems Embedded Processors & their Architectures Serial communication RTOS Concepts Videos of Embedded applications 18-10-2014 2 EMBEDDED SYSTEMS
  • 3. Embedded Programming in C- PART 2 Embedded Software Development Process and Tools Embedded programming Demo for PIC Microcontroller & simulation using Proteus & MPLAB IDE How to write a program How to handle the datasheets of the processors Embedded programming Demo for MSP430 by using Code Composer Studio How to write a program How to handle the datasheets of the processors 18-10-2014 EMBEDDED SYSTEMS 3
  • 4. System Definition A way of working, organizing or performing one or many tasks according to a fixed set of rules, program or plan. Also an arrangement in which all units assemble and work together according to a program or plan. Examples: Time display system – A watch  Automatic cloth washing system- A washing machine 18-10-2014 4 EMBEDDED SYSTEMS
  • 5. System Examples It is an automatic clothes washing system Parts: Status display panel, Switches & Dials, Motor, Power supply & control unit, Inner water level sensor and solenoid valve. Process: 1.Wash by spinning 2.Rinse 3.Drying 4.Wash over by blinking 5.Each step display the process stage 6.In case interruption, execute only the remaining 18-10-2014 5 EMBEDDED SYSTEMS
  • 6. Embedded Systems- Definition “An embedded system is a system that has software embedded into computer-hardware, which makes a system dedicated for an application(s) or specific part of an application or product or part of a larger system.” It is any device that includes a programmable computer but is not itself intended to be a general purpose computer.” 18-10-2014 6 EMBEDDED SYSTEMS
  • 7. Embedded Systems- Architecture 18-10-2014 7 EMBEDDED SYSTEMS
  • 8. Microprocessors CPU for Computers No RAM, ROM, I/O on CPU chip itself Example:Intel’s x86, Motorola’s 680x0 CPU General- Purpose Micro- processor RAM ROM I/O Port Timer Serial COM Port Data Bus Address Bus General-Purpose Microprocessor System Many chips on mother’s board 18-10-2014 8 EMBEDDED SYSTEMS
  • 9. •A smaller computer •On-chip RAM, ROM, I/O ports... •Example:Motorola’s 6811, Intel’s 8051, Zilog’s Z8 and PIC 16X A single chip RAM ROM I/O Port Timer Serial COM Port Microcontroller CPU Microcontrollers 18-10-2014 9 EMBEDDED SYSTEMS
  • 10. Processor Architectures 1-Von Neumann Architecture Single memory & single bus for transferring the data into & out of the CPU. Multiplication of two numbers require atleast 3 clk cycles 18-10-2014 10 EMBEDDED SYSTEMS
  • 11. 2-Harvard Architecture  Separate memory for data & program with separate buses for each Both program instructions & data can be fetched at the same time Operational speed is higher than Von Neumann 18-10-2014 11 EMBEDDED SYSTEMS
  • 12. 3-Super Harvard Architecture (DSP Processors) 18-10-2014 12 EMBEDDED SYSTEMS  DSP Algorithms spend their most of the time in loops. So instruction Cache is added  Processing of many “high” frequency signals in real time  Multiply–Accumulate operation  Fixed point/ floating point, Matrix operations, convolution , correlation, parallelism etc. eg:C5000, C6000 single core processor families
  • 13. DSP Pipeline Architecture 18-10-2014 EMBEDDED SYSTEMS 13 C6000 fetch eight 32 bit instructions per clock cycles
  • 14. Mechanism in Microcontrollers 18-10-2014 14 EMBEDDED SYSTEMS
  • 15. Difference between DSP & μC DSPs often don't have a flash program memory. They need the software to be 'loaded' into them. Whereas, microcontrollers have a non power off erasable program memory inside, some with EPROM store capabilities. DSPs are much faster for integer mathematics operations, whereas many microcontrollers do not have the hardware. DSPs are much faster for floating point operations. In microcontrollers, this has to be done in software. DSPs are oriented to be an input/output device with 'fast calculating machine'. Microcontrollers are a multi-feature device with several ways of interfacing with the world, however none are the fastest. 18-10-2014 EMBEDDED SYSTEMS 15
  • 16. DSPs are not designed to be a 'robust' device. They need a well designed board to work properly. Microcontrollers can work on a Test Board. DSPs are a fast calculator microprocessor, that is very effective for computing calculations and moving data, whereas, microcontrollers are a more flexible device with more features. Eg: 1) Image, audio & video processing by DSP 2)Data-transmission & control signals by Microcontroller 18-10-2014 EMBEDDED SYSTEMS 16
  • 17. Texas Instruments (DSP+ARM processor) Davinci- (video streaming applications ) Multicore processors  OMAP application processors (Image processing) Analog Devices Black-fin Processor (DSP+ARM) 18-10-2014 EMBEDDED SYSTEMS 17 Digital Signal Controllers (Combined Processor Architectures)
  • 18. How the PC Starts Microcontroller searches its first instruction to execute BIOS in Flash chip provides the Initial instructions to the μc BIOS does several sequences: 1. Check the CMOS Setup for custom settings CMOS setup present in Nonvolatile RAM (NVRAM) or CMOS RAM CMOS RAM & RTC integrated as a Southbridge Chipset, which is powered by CMOS battery (CMOS RAM-64 to 512 bytes capacity) CMOS setup consists of sys time/date, Chipsets status, memory management 18-10-2014 EMBEDDED SYSTEMS 18
  • 19. 2. Load the interrupt handlers and device drivers 3. Initialize registers and power management 4. Perform the power-on self-test (POST) 5. Display system settings 6. Determine which devices are bootable 7. Initiate the bootstrap sequence – the order to Boot OS Cold boot – restart PC with the power being off Warm boot or normal boot- restart PC when the power is ON 18-10-2014 EMBEDDED SYSTEMS 19
  • 21. 18-10-2014 EMBEDDED SYSTEMS 21 HARD DISK MOTHER BOARD
  • 22. VARIOUS MICROCONTROLLERS INTEL 8031,8032,8051,8052,8751,8752, Pentium etc PIC 8-bit PIC16, PIC18, 16-bit DSPIC33 / PIC24, PIC16C7x Motorola MC68HC11 ARM – ARM7, ARM9, ARM 11 18-10-2014 22 EMBEDDED SYSTEMS
  • 23. Types of Processors 18-10-2014 EMBEDDED SYSTEMS 23
  • 24. EMBEDDED PROCESSOR Special microprocessors & microcontrollers often called, Embedded processors. An embedded processor is used when fast processing fast context-switching & atomic ALU operations are needed. Examples : ARM 7, INTEL i960, AMD 29050. 18-10-2014 24 EMBEDDED SYSTEMS
  • 25. DIGITAL SIGNAL PROCESSOR DSP as a GPP is a single chip VLSI unit. It includes the computational capabilities of microprocessor and multiply & accumulate units (MAC). DSP has large number of applications such as image processing, audio, video & telecommunication processing systems. It is used when signal processing functions are to be processed fast. Examples : TMS320Cxx, SHARC, Motorola 5600xx 18-10-2014 25 EMBEDDED SYSTEMS
  • 26. APPLICATION SPECIFIC SYSTEM PROCESSOR (ASSP) ASSP is dedicated to specific tasks and provides a faster solution. An ASSP is used as an additional processing unit for running the application in place of using embedded software. Examples : IIM7100, W3100A 18-10-2014 26 EMBEDDED SYSTEMS
  • 27. APPLICATIONS Household appliances: Microwave ovens, Television, DVD Players & Recorders Audio players Integrated systems in aircrafts and missiles Cellular telephones Electric and Electronic Motor controllers Engine controllers in automobiles Calculators  Medical equipments etc... 18-10-2014 27 EMBEDDED SYSTEMS
  • 28. Automotive embedded systems Today’s high-end automobile may have 100 microprocessors 4-bit microcontroller checks seat belt microcontrollers run dashboard devices 16/32-bit microprocessor controls engine 18-10-2014 28 EMBEDDED SYSTEMS
  • 30. SERIAL COMMUNICATION 18-10-2014 30 EMBEDDED SYSTEMS
  • 31. SERIAL PORT: one bit can communicate & the bits transmitted at periodic intervals generated by a clock. Short and long distance communication. PARALLEL PORT: Multiple bits can communicate over a set of parallel lines at any given instance. Communication within the same board. Short distance communication. 18-10-2014 31 EMBEDDED SYSTEMS
  • 32. Serial communication Mainly divided into Synchronous- Data is received or transmitted at constant time intervals with uniform phase differences. Eg: audio inputs, frames sent over a LAN Asynchronous- Data is received or transmitted at variable time intervals. Eg: keypad communication, Modem. 18-10-2014 32 EMBEDDED SYSTEMS
  • 33. Synchronous Asynchronous Constant time intervals Random time intervals No Handshaking between Tx & Rx Handshaking between Tx & Rx Clock is known to the receiver explicitly Clock is known to the receiver implicitly Eg: SPI, SCI, SI and SDIO Eg: RS232, UART, HDLC etc DIFFERENCE 18-10-2014 33 EMBEDDED SYSTEMS
  • 34. Synchronous Transmission 18-10-2014 34 EMBEDDED SYSTEMS
  • 36. What is the difference between RS232 and UART? RS232 is a specification for serial communications between a DCE and DTE it defines electrical characteristics, the 25-way 'D' connector and the various functions of the various signal lines. A UART is a Universal Asynchronous Receiver and Transmitter - it is an electronic circuit which handles communication over an asynchronous serial interface - very often an RS232 interface. 18-10-2014 36 EMBEDDED SYSTEMS
  • 37. UART Frame format 1 0 1bit time= 1/baud rate 10 transition 18-10-2014 37 EMBEDDED SYSTEMS
  • 38. RS232 Interfacing signal standard Follows asynchronous UART protocol Point to point interface 18-10-2014 38 EMBEDDED SYSTEMS
  • 39. UART circuit within microcontroller RS232 18-10-2014 39 EMBEDDED SYSTEMS
  • 40. SERIAL COMMUNICATION PROTOCOLS 18-10-2014 40 EMBEDDED SYSTEMS
  • 41. SPI- Synchronous Peripheral Interface -Defined by Motorola on the MC68HCxx line of microcontrollers -Full duplex -It supports 1) full master mode 2) slave mode(with general address call) - Addressing each device is not needed •-If SS pin set as 1- Master -If SS pin set as 0- Slave -It is called as 3 wire communication -Allows 8 bit to transmit & receive -Generally faster than I2C, capable of several Mbps -Bus Arbitration logic is needed 18-10-2014 41 EMBEDDED SYSTEMS
  • 42.  A master sends a clock signal, and upon each clock pulse it shifts one bit out to the slave, and one bit in, coming from the slave. Master PIC Slave PIC 18-10-2014 42 EMBEDDED SYSTEMS
  • 43. 18-10-2014 EMBEDDED SYSTEMS 43 Using separate chip selects Daisy chaining 43 BUS ARBITRATION
  • 44. Applications of SPI Like I2C, used in EEPROM, Flash, and real time clocks Better suited for “data streams”, i.e. ADC converters Full duplex capability, i.e. communication between a codec and digital signal processor 18-10-2014 44 EMBEDDED SYSTEMS
  • 45. I2C (Inter Integrated Circuit) Developed by Philips Semiconductor for TV sets in the 1980’s 2-wire serial bus – Serial data (SDA) and Serial clock (SCL) Half-duplex, synchronous I2c supports 1) master mode 2)slave mode 3)multi master mode  Addressing is needed (eg: In PIC- MSSP Address Register ) No chip select or arbitration logic required 18-10-2014 45 EMBEDDED SYSTEMS
  • 46. I2C 1. Master sends start condition (S) and controls the clock signal 2. Master sends a unique 7-bit slave device address 3. Master sends read/write bit (R/W) – 0 - slave receive, 1 - slave transmit 4. Wait for/Send an acknowledge bit (A). 5. Send/Receive the data byte (8 bits) (DATA). 6. Expect/Send acknowledge bit (A). 7. Send the STOP bit (P). 18-10-2014 46 EMBEDDED SYSTEMS
  • 47. I2C Data Transfer Data Transfer from master to slave Data transfer from slave to master 18-10-2014 47 EMBEDDED SYSTEMS
  • 48. 18-10-2014 48 EMBEDDED SYSTEMS Example
  • 49. Applications Used as a control interface to signal processing devices that have separate data interfaces, e.g. RF tuners, video decoders and encoders, and audio processors. 18-10-2014 49 EMBEDDED SYSTEMS
  • 50. CAN CAN is a serial bus system, which was originally developed for automotive applications in 1980 by BOSCH Data link layer protocol internationally standard as ISO 11898-1 Referred as network of independent controllers CAN provides 2 Communication Services: Sending of a message- data frame transmission Requesting of a message- remote transmission request Message based protocol not an address based protocol Bidirectional and the data rate is 1 Mbps 18-10-2014 50 EMBEDDED SYSTEMS
  • 51. 12 6 7Bits(all zeros) 1 1 1 If RTR sets as 1- packet is a data to the RX If RTR sets as 0- packet is a request for the data from the RX CAN DATA FRAME FORMAT 18-10-2014 51 EMBEDDED SYSTEMS
  • 52. 3.75v 2.5v 1.25 2.5v 1 0 1 CAN HIGH CAN LOW Idle Transmitting Bits Idle Recessive Dominant Recessive 18-10-2014 52 EMBEDDED SYSTEMS
  • 53. USB (Universal Serial Bus) Bus between host system & number of interconnected peripheral devices Addressable bus system Hot swapping or hot plugging or plug & play- no Interruption, no reboot, auto configuration. Bus powered Star topology 18-10-2014 53 EMBEDDED SYSTEMS
  • 54. 18-10-2014 EMBEDDED SYSTEMS 54 Star topology
  • 55. 3 standards are : USB 1.1-1.5 Mbps to 12 Mbps, support up to 127 devices USB2.0-1.5, 12 and 480 megabits per second data transfer USB 3.0-Super Speed >4.8 Gbits/sec 18-10-2014 55 EMBEDDED SYSTEMS Up stream Down stream PIN Diagram
  • 56. USB ROOT HUB CONTROLLER or HOST INTERFACE CONTROLLER USB STICK MASTER SLAVE MEMORY CONTROLLER 18-10-2014 56 EMBEDDED SYSTEMS
  • 57. When the Host powers up, Enumeration process starts (host address 0x00) -polls each of the Slave devices -assigns unique address (7bit address code) -finds each device Speed and type of data transfer -device drivers are loaded for auto configuration -virtual pipes are established for data communication 18-10-2014 EMBEDDED SYSTEMS 57 (Unidirectional)
  • 58. 18-10-2014 EMBEDDED SYSTEMS 58 USB can support four data transfer types or transfer mode: 1. Control 2. Isochronous eg: keyboard, mouse 3. Bulk eg: printer 4. Interrupt eg: memory stick
  • 59. Secure Digital (or SD) is a non-volatile FLASH memory card format for use in portable devices, such as mobile phones, digital cameras, GPS navigation devices, and tablet computers. Flash memory is an electronic non-volatile computer storage device that can be electrically erased and reprogrammed. Programmable for communication in SPI mode or 1bit SD mode or 4bit SD Secure Digital Card(SDIO) 18-10-2014 59 EMBEDDED SYSTEMS
  • 60. Multi media cards 2 NAND CHIPS AND ONE SD CONTROLLER Secure Digital Card(SDIO) 18-10-2014 60 EMBEDDED SYSTEMS
  • 63. Memory Model 18-10-2014 63 EMBEDDED SYSTEMS When func calls, temporary variables are pushed. When func exits, variables are popped Dynamic memory allocation, Malloc,realloc,free Objects and Program memory Data memory
  • 64. Stack : store temporary variables created by funcs Fast access Managed automatically by CPU Local variables only Limited stack size. (stack overflow will occur) Grows downwards- going to reach its limit Heap : memory allocation can be done by using malloc, realloc & free (dynamic memory allocation) Slow access Managed by the programmer Variables can be accessed globally No limit on memory Grows upwards- its limit increases continuously 18-10-2014 EMBEDDED SYSTEMS 64
  • 65. Process and Threads A process is an instance of a computer program that is being executed. It contains the program code and its current activity 18-10-2014 EMBEDDED SYSTEMS 65 PROCESS THREADS Instance of a computer program being executed Subsets of a process Independent resources & memory Shared resources & memory Context switching is slow Context switching is fast Independent Depends on their own process
  • 66. Process Concept Process – a program in execution process execution must progress in sequential fashion A process includes: program counter stack data section Task is a similar one to process. But the term TASK is often used in RTOS. Task – a embedded program in execution But in some RTOS, the term PROCESS is also used 18-10-2014 66 EMBEDDED SYSTEMS
  • 67. Process State As a process executes, it changes state new: Create & memory allotted ready: The process is waiting to run while the high priority tasks are running running: executing with allotted resources. Some times it preempts by another priority task Waiting(blocked): The process is waiting for some event to occur terminated: The process has finished execution & memory gets de-allotted. 18-10-2014 67 EMBEDDED SYSTEMS
  • 68. Diagram of Process State 18-10-2014 68 EMBEDDED SYSTEMS (Blocked)
  • 69. Process Control Block (PCB) Information associated with each process Process state Program counter CPU registers CPU scheduling information Memory-management information Accounting information I/O status information 18-10-2014 69 EMBEDDED SYSTEMS
  • 70. CPU Switch From Process to Process 18-10-2014 70 EMBEDDED SYSTEMS
  • 71. Process Scheduling Queues Job queue – set of all processes in the system Ready queue – set of all processes residing in main memory, ready and waiting to execute Device queues – set of processes waiting for an I/O device Processes migrate among the various queues 18-10-2014 71 EMBEDDED SYSTEMS
  • 72. Ready Queue And Various I/O Device Queues 18-10-2014 72 EMBEDDED SYSTEMS
  • 73. Migration of ‘A’ From Disk to Register 18-10-2014 73 EMBEDDED SYSTEMS
  • 74. Interrupts is a mechanism for alleviating the delay caused by this uncertainty and for maximizing system performance. 18-10-2014 EMBEDDED SYSTEMS 74 Transferring Data Between the CPU and I/O Device What is Interrupt Mechanism ?
  • 75. Transferring Data Between the CPU and I/O Device •Polling •Wait states •Interrupts 18-10-2014 75 EMBEDDED SYSTEMS
  • 76. Polling One method used in small system to alleviate the problem of I/O devices with variable delays. Repeatedly checking its ports 18-10-2014 76 EMBEDDED SYSTEMS CPU I/0 device Request Again Device ready signal Fails Request Data transfer
  • 77. wait states 18-10-2014 77 EMBEDDED SYSTEMS CPU I/0 device am waiting Device ready signal Please wait Request Device ready signal Data transfer
  • 78. Disadvantages of Polling & wait states The CPU does not perform any useful work while waiting for the I/O device to become ready to transfer data. To make use of this wasted CPU time, interrupts are developed. 18-10-2014 78 EMBEDDED SYSTEMS
  • 79. Interrupts Instead of polling the device or entering a wait state, the CPU continuously executing its instructions & performing useful work. When the device is ready to transfer data, it sends an interrupts request to the CPU; this is done via a dedicated signal on the control bus. 18-10-2014 79 EMBEDDED SYSTEMS CPU I/0 device Interrupt ACK signal Interrupt Request Data transfer
  • 80. 1. Normal program execution 2. Interrupt occurs 3. Processor state saved 4. Interrupt routine runs 5. Interrupt routine terminates 6. Processor state restored 7. Normal program execution resumes Handling an Interrupt 18-10-2014 80 EMBEDDED SYSTEMS Context switching Context switching
  • 81. Shared data problem •Arises when an interrupt service routine and the task code share the data or between two tasks that share the data. •In order to solve the problem, we need to make the shared data “atomic” •A part of the program is said to be “atomic” if it cannot be interrupted by anything 18-10-2014 81 EMBEDDED SYSTEMS
  • 82. Semaphores Semaphores: Introduced by Dijkstra in 1960s Semaphore is a variable or a signal event Provides the synchronization mechanism Eg: open-close, up-down, pend-post, lock-unlock Synchronization mechanism is required at the entry and exit of critical section to ensure exclusive use. This mechanism is semaphore. 18-10-2014 82 EMBEDDED SYSTEMS
  • 83. Semaphores have two purposes Mutex: Ensure threads don’t access critical section at same time Scheduling constraints: Ensure threads execute in specific order 18-10-2014 83 EMBEDDED SYSTEMS Semaphores
  • 84. Real time Semaphores 18-10-2014 84 EMBEDDED SYSTEMS Railways Airways Navy
  • 85. Mutual Exclusion (Mutex) Mutex is a program or object that is created, when we start the process. Any task needs the resource must use the Mutex to lock the resource from other task while it is using the resource. If the Mutex is already locked, other tasks are queued. 18-10-2014 85 EMBEDDED SYSTEMS
  • 86. Critical section In concurrent programming, a critical section is a piece of code that accesses a shared resource that must not be concurrently accessed by more than one thread of execution. Semaphore taken critical section semaphore release 18-10-2014 86 EMBEDDED SYSTEMS
  • 87. Conditions for Implementing the Critical Section Disable the interrupts, when try to enter into the CS Avoid system calls that can cause a context switch while inside the CS. Whatever may be, any kind of code must not disturb the CS, until the original thread leaves its CS. This approach can be improved by using semaphores. Eg: Printer can only be accessed by one process at a time But other processes are free to gain the control of CPU & execute other code or CS that are protected by different semaphores. 18-10-2014 87 EMBEDDED SYSTEMS
  • 88. Deadlock Characterization Deadlock can arise if four conditions hold simultaneously. Mutual exclusion: only one process at a time can use a resource. Hold and wait: a process holding at least one resource is waiting to acquire additional resources held by other processes. No preemption: a resource can be released only voluntarily by the process holding it, after that process has completed its task. Circular wait: there exists a set {P0, P1, …, P0} of waiting processes such that P0 is waiting for a resource that is held by P1, P1 is waiting for a resource that is held by P2, …, Pn–1 is waiting for a resource that is held by Pn, and P0 is waiting for a resource that is held by P0. 18-10-2014 88 EMBEDDED SYSTEMS
  • 89. Pre-emption The act of temporarily interrupting a task being carried out by a computer system without requiring its cooperation. Preemptive scheduler consists of high priority tasks which has the power to preempt or interrupt any process. But kernel functions cannot be preempted 18-10-2014 89 EMBEDDED SYSTEMS
  • 90. Embedded Software's: IDE- Integrated Development Environment Compiler The compiler turns source code into machine code packaged in object files. (HI-tech compiler, CCS etc) Cross compilerA cross-compiler produces object files that will then be linked for the target instead of the computer running the compiler A cross compiler is a compiler capable of creating executable code for a platform other than the one on which the compiler is running.( eg: GCC for linux) DebuggerA special program used to find errors (bugs) in other programs. A debugger allows a programmer to stop a program at any point and examine and change the values of variables. 18-10-2014 90 EMBEDDED SYSTEMS
  • 91. The Simulator tries to duplicate the behaviour of the device. The Emulator tries to duplicate the inner workings of the device.(mimicry) Emulation is the replacement of a real world device with an model at a well defined interface for the purposes of allowing controlled responses from the emulated real world device. 18-10-2014 EMBEDDED SYSTEMS 91
  • 93. Introduction to MSP430 The MSP430 can be used for low powered embedded devices. The electric current drawn in idle mode can be less than 1 μA. The top CPU speed is 25 MHz. It can be throttled back for lower power consumption. Six different low-power modes, which can disable unneeded clocks and CPU. Capable of wake-up times below 1 microsecond, allowing the microcontroller to stay in sleep mode longer, minimizing its average current consumption. 18-10-2014 93 EMBEDDED SYSTEMS
  • 95. PIN DIAGRAM OF MSP430G2553 18-10-2014 95 EMBEDDED SYSTEMS
  • 97. Digital IO Control: Digital I/O is configured by user software – Input Register PxIN – Output Register PxOUT – Direction Register PxDIR – Pullup/Pulldown Resistor Enable Register PxREN – Function Select Registers PxSEL and PxSEL2 • Most likely will not need to use these – Each pin has interrupt capabilities 18-10-2014 97 EMBEDDED SYSTEMS
  • 98. Input Register PxIN Each bit in each PxIN register reflects the value of the input signal at the corresponding I/O pin when the pin is configured as I/O function. Bit = 0: The input is low Bit = 1: The input is high 18-10-2014 98 EMBEDDED SYSTEMS
  • 99. Output Registers PxOUT Each bit in each PxOUT register is the value to be output on the corresponding I/O pin when the pin is configured as I/O function, output direction, and the pullup/down resistor is disabled. Bit = 0: The output is low Bit = 1: The output is high If the pin's pullup/pulldown resistor is enabled, the corresponding bit in the PxOUT register selects pullup or pulldown. Bit = 0: The pin is pulled down Bit = 1: The pin is pulled up 18-10-2014 99 EMBEDDED SYSTEMS
  • 100. Direction Registers PxDIR Each bit in each PxDIR register selects the direction of the corresponding I/O pin, regardless of the selected function for the pin. PxDIR bits for I/O pins that are selected for other functions must be set as required by the other function. Bit = 0: The port pin is switched to input direction Bit = 1: The port pin is switched to output direction 18-10-2014 100 EMBEDDED SYSTEMS
  • 101. Pullup/Pulldown Resistor Enable Registers PxREN Each bit in each PxREN register enables or disables the pullup/pulldown resistor of the corresponding I/O pin. The corresponding bit in the PxOUT register selects if the pin is pulled up or pulled down. Bit = 0: Pullup/pulldown resistor disabled Bit = 1: Pullup/pulldown resistor enabled 18-10-2014 101 EMBEDDED SYSTEMS
  • 102. Function Select Registers PxSEL and PxSEL2 Port pins are often multiplexed with other peripheral module functions. See the device-specific data sheet to determine pin functions. Each PxSEL and PxSEL2 bit is used to select the pin function - I/O port or peripheral module function. 18-10-2014 102 EMBEDDED SYSTEMS
  • 103. How to enable the pins or bits Each pin in port can also acts as a register. If the port 1 has 8 pins (p1.0 to p1.7) To enable the pins: just set 0 or 1 For example set P1.1 & P1.6 and form the hexadecimal code 4 2 Write as 0x42 P1.7 P1.6 P1.5 P1.4 P1.3 P1.2 P1.1 P1.0 0 1 0 0 0 0 1 0 18-10-2014 103 EMBEDDED SYSTEMS
  • 104. Low power modes 18-10-2014 104 EMBEDDED SYSTEMS
  • 105. #define LPM0_bits (CPUOFF) #define LPM1_bits (SCG0+CPUOFF) #define LPM2_bits (SCG1+CPUOFF) #define LPM3_bits (SCG1+SCG0+CPUOFF) #define LPM4_bits (SCG1+SCG0+OSCOFF+CPUOFF) 18-10-2014 105 EMBEDDED SYSTEMS
  • 106. #define LPM0 _bis_SR_register(LPM0_bits) /* Enter Low Power Mode 0 */ #define LPM0_EXIT _bic_SR_register_on_exit(LPM0_bits) /* Exit Low Power Mode 0 */ #define LPM1 _bis_SR_register(LPM1_bits) /* Enter Low Power Mode 1 */ #define LPM1_EXIT _bic_SR_register_on_exit(LPM1_bits) /* Exit Low Power Mode 1 */ #define LPM2 _bis_SR_register(LPM2_bits) /* Enter Low Power Mode 2 */ #define LPM2_EXIT _bic_SR_register_on_exit(LPM2_bits) /* Exit Low Power Mode 2 */ #define LPM3 _bis_SR_register(LPM3_bits) /* Enter Low Power Mode 3 */ #define LPM3_EXIT _bic_SR_register_on_exit(LPM3_bits) /* Exit Low Power Mode 3 */ #define LPM4 _bis_SR_register(LPM4_bits) /* Enter Low Power Mode 4 */ #define LPM4_EXIT _bic_SR_register_on_exit(LPM4_bits) /* Exit Low Power Mode 4 */ 18-10-2014 106 EMBEDDED SYSTEMS
  • 107. Led toggling: #include <msp430g2553.h> unsigned int i; void main(void) {  WDTCTL=WDTPW + WDTHOLD;// watch dog timer disabled  P1DIR |= 0X41; // here itself P1OUT = 0100 0001 //led on the pin will glow  while(1)  {  P1OUT ^= 0X41; //0100 0001 Exor 0100 0001= 0000 0000// led will off for the given delay  for(i=0;i<50000;i++);  } } 18-10-2014 107 EMBEDDED SYSTEMS
  • 108. Analog to digital module The ADC10 module is a high-performance 10-bit analog-to-digital converter. Refer the data sheet page no: 558 18-10-2014 108 EMBEDDED SYSTEMS
  • 109. The USCI module is used for serial data communication. The USCI module supports synchronous communication protocols such as SPI (3 or 4 pin) and I2C, an asynchronous communication protocols such as UART, enhanced UART with automatic baudrate detection (LIN), and IrDA. Not all packages support the USCI functionality. USCI_A0 provides support for SPI (3 or 4 pin), UART, enhanced UART, and IrDA. USCI_B0 provides support for SPI (3 or 4 pin) and I2C. Universal Serial Communications Interface (USCI) 18-10-2014 109 EMBEDDED SYSTEMS
  • 110. UART Steps: 1. The I/O pins have to be selected for the UART function 2. A clock with a certain frequency must be sourced to the UART module 3. Enable UART TX or RX or Both 4. Select the byte format as 7- or 8-bit data with odd, even, or non-parity 5. Set the baud generator correctly so as to get a correct baud rate from the clock sourced 6. Enable the module 18-10-2014 110 EMBEDDED SYSTEMS
  • 111. synchronous 18-10-2014 111 EMBEDDED SYSTEMS
  • 112. 16X2 LCD PIN OUT 18-10-2014 112 EMBEDDED SYSTEMS
  • 113. EMBEDDED COMPANIES Intel Texas Instruments  Freescale  Philips  Samsung  LG Electronics  Tata Elxsi/Sasken  Ittiam Systems  Infosys/TCS  HCL Technologies/Wipro  Analog Devices  Mphasis/BFL  Symphony  Sonata Software  Mistral/eInfochips Dexcel Designs Robosoft/Yindusoft Qualcomm Etc……………. 18-10-2014 113 EMBEDDED SYSTEMS
  • 114. Thank you 18-10-2014 114 EMBEDDED SYSTEMS