Module1_Introduction_to_Embedded_Systems_Part1.pdf
Document Details
Tags
Full Transcript
Microcontroller Based Design Introduction (Week 1) Dr. Bilal Arain (Slides based on Dr. Bassel Soudan) Embedded Systems Overview Common Characteristics of Embedded Systems Design Constraints of Embedded Systems Definition of Embedded Systems...
Microcontroller Based Design Introduction (Week 1) Dr. Bilal Arain (Slides based on Dr. Bassel Soudan) Embedded Systems Overview Common Characteristics of Embedded Systems Design Constraints of Embedded Systems Definition of Embedded Systems OR a microcontroller-based system General Operating Concept of Embedded Systems Types of Embedded Systems Introduction to Microcontroller What is a microcontroller? An integrated chip that is often part of an embedded system. It is programmed to perform a single specific task/application. They are just “mini-computers”. A micro includes CPU, RAM, ROM, I/O ports and timers all in a single chip. Internal and external interrupt handling mechanism. Introduction to Microcontroller Microcontrollers do not need to A microcontroller needs Microcontrollers are be powerful because most applications only require a clock to be programmed to be only as useful as the of a few Mhz and a small useful. code written for it. amount of storage. Example: If you wanted to turn on a red light when the temperature reached a certain point, the programmer would have to explicitly specify how that will happen through his code Introduction to Microcontroller Microcontrollers are hidden in tons of appliances, gadgets, and other electronics. Examples of a microprocessor and microcontroller Introduction to Microcontroller Microcontrollers can be used to control the behavior of the system to achieve the desired functionality. Example: Windshield wipers on your car They are purely mechanical, but they need something to control their behavior. A system that measures time and enables the wipers’ motor at the right time, turns it off at the right time, etc. On newer cars, the system will sense the rain and turn the wipers on automatically. It may also sense that the wipers are old and dry and give you a warning message Introduction to Microcontroller Microprocessor Microcontroller General computing Appliances, specialized Applications (i.e. Laptops, tablets) devices Speed Very fast Relatively slow External Parts Many Few Cost High Low Energy Use Medium to high Very low to low Vendors Introduction to Microcontroller Microprocessor Introduction to Microcontroller Microcontroller Microcontroller Packaging DIP SOIC QFP BGA (Dual Inline Package) (Small Outline IC) (Quad Flat Package) (Ball Grid Array) Through hole Surface Mount Surface Mount Surface Mount 8 pins 18 pins 32 pins 100 pins 9mm x 6mm 11mm x 7mm 7mm x 7mm 6mm x 6mm 0.15pins/mm2 0.23pins/mm2 0.65pins/mm2 2.78pins/mm2 Advantages of microcontroller-based design Replacement Provide Provide easy Improve Protection of of discrete functional maintenance mechanical Intellectual logic-based upgrades. upgrades. performance. Property (IP). circuits. Why are microcontroller used? Cost Size and Weight Simple applications Reliability Speed Microcontrollers Microcontrollers If the application Since the All the components with the are compact and requires very few architecture is on the supplementary light compared to I/O, the code is much simpler than microcontroller are circuit components computers. relatively small, a computer it is less located on a single are much cheaper and a simple LCD is likely to fail. piece of silicon. than a computer sufficient as a user Hence, the with an analog and interface, a applications run digital I/O. microcontroller much faster than it would be more does on a suitable. computer. Examples Example of a controller board of a Washing Machine If a button is pressed or if a knob is turned, the microcontroller knows how to react to the event For example, if the start button is pressed, the microcontroller can switch the relay to turn on the motor. Examples: Why are microcontroller used? Microcontrollers are “typically” used where processing power is not critical. It is estimated that on average a middle-class household has a minimum of 35 microcontrollers in it. About 34 % of microcontroller applications are in office automation such as laser printers, fax machines, intelligent telephones and so forth. Another 33 % of microcontrollers are used in consumer electronic goods such as CD players. The remaining 33 % are used in the communications and automotive market. Microcontroller applications Many robots use microcontrollers to allow robots to interact with the real world. Example: If a proximity sensor senses an object nearby, the microcontroller will know to stop its motors and then find an unobstructed path. Knowledge Check Microcontrollers are used for specific applications They do not need to be powerful because most applications only require a clock of a few MHz and a small amount of storage A microcontroller needs to be programmed to be useful What is NOT a microcontroller-based system? Contains an advanced operating system Can have unlimited memory or space It is a general-purpose computer designed and capable of executing any program such as computer games, etc. What do we need to create an Embedded System? Microcontroller Programming Cycle Microcontroller based control system design Example: Programming cycle of windshield wipers on your car A sensor to sense or measure the current behavior, for example elapsed time, rain, etc. A desired behavior, for example turn on the wipers at every 2 seconds. Compare the current behavior and the desired behavior. We can also call this step as “error” computation. Issue the “adjustment” to achieve the desired behavior. Microcontroller Programming Cycle Sensors for measurements To measure data for the controller Microcontroller Programming Cycle The role of Microcontroller or Microprocessor To compute the “error” between the measurement and the desired value Microcontroller Programming Cycle Input and Output To read data from the measurements To produce the required adjustment signal to control the plant Microcontroller Programming Cycle Actuator To create the adjustment to the system/plant Microcontroller Programming Cycle Additional peripherals Memory, Timers, Interrupts, etc. Embedded System Design Microcontroller Programming Cycle The course will treat a sensor as an input wire carrying a certain type of signal. Basic The course will treat an actuator as an output wire that requires a specific signal sequence. Operations The focus is on learning how to use and program the microcontroller in typical engineering applications. Block diagram of Microcontroller The microcontroller operates on data that is fed in through its serial or parallel input ports controlled by the software stored in the on- chip memory. It contains timers to compute time interval It contains counters to count events It contains interrupt circuits to allow performing multiple tasks in parallel Definition of the microcontroller The microcontroller is a programmable device that receives values from sensors, performs on them simple arithmetic or logical operations according to the program and data stored in memory and then produces directives to the rest of the system as a result. Programmable device A microcontroller can perform different sets of operations on the data it receives depending on the sequence of instructions supplied in the given program. By changing the program, the microcontroller manipulates different types of data in different ways. Instructions: Each microcontroller is designed to execute a specific group of operations. This group of operations is called an instruction set. This instruction set defines what the microcontroller can and cannot do. Programmable device We will use PIC microcontroller, specifically PIC 16F877 as an example in this course. The datasheet of this microcontroller is available online https://www.microchip.com/en-us/product/PIC16F877#document-table Knowledge Check A car is moving at a speed of 50 km/h. which of the following can be used as an input for the microcontroller to find the car speed: 1. Gear position 2. Eyes 3. Speed sign 4. Speedometer The adjustment from the microcontroller-based control system must be based on: 1. Target behavior and measurement 2. Target behavior and adjustment 3. Disturbance and measurement 4. Measurement and adjustment