Presentation on theme: "Dr. Richard Conway BM025 Richard.firstname.lastname@example.org Embedded Software 1 Dr. Richard Conway BM025 Richard.email@example.com."— Presentation transcript:
1 Dr. Richard Conway BM025 Richard.firstname.lastname@example.org Embedded Software 1Dr. Richard ConwayBM025
2 Aims & ObjectivesThe aim of the module is to provide an introduction to embedded processor systems and applications. The main objectives are to provide the student with an overview of the architecture of a simple microprocessor, to explain the operating principles and provide a functional understanding of assembly language.
3 SyllabusDescribe what an embedded system is. Detail application areas and examples.Introduce a simple microprocessor architecture – Registers, buses, and memory organization and how it is used in embedded applications. Describe memory and I/O devices. Explain memory and I/O accesses.Detail instruction machine formats, and instruction decoding. Introduce instruction sets, addressing modes, data move instructions, arithmetic instruction, stack operation and usage, Program flow control instructions, sub routines and loops.Detail assembler directives and the program translation process. Review the build and load process for embedded application programs. Introduce simulation tools and debugging techniques. Introduce the monitor program and how to use it to test applications using target hardware.Describe how to control/communicate with I/O devices through polling and interrupts. Interrupt service routines, interrupt priority, multiple interrupts, nesting.Use practical programming examples to illustrate concepts.
4 Module Evaluation Final Exam 60% written exam Term Work 20% lab 20% midtermLab starts week 4Repeat Exam 100% written exam
5 Module Information Recommended Text. “The 8051 Microcontroller”, 3rd Edition.I. Scott MacKenzie, 1999Available in Bookshop and Library (long term loan)8052 tutorial available on
6 Embedded System Computing systems widely used today Embedded System PCs, laptops, Palm pilot, ServersEasily identifiable as computing systemsCan easily change the operationAdd programs/applicationsAdd hardware resourcesEmbedded SystemMicrowave, mobile phone, EMU in car, digital camera, etc…Computing system that is embedded within a device/systemMay not be obvious from the outsideOften fixed in operationVolume of sales in billions50 devices in the home!
7 Basic components of a computing system All computing systems (big or small) containCPU – brains of the system. Executes instructionsMemory – storage. Stores program (instructions) and dataInput/Output – Interaction with outside worldCommunication achieved with busesGroups of signals to carry the data, address and control info
8 BusesA bus is a collection of signals (wires) that are collectively referred to by a common name that identifies their common purposeExample is the address bus. Could consist of 16 individual wires.Rather than draw all the signals, a wider shape is used on schematics
9 Address BusThe number of address lines that a CPU has determines the amount of memory that can be used with the CPU*16 address lines allow (or 64K) unique address locations.For n address lines, there are 2n unique address locationsIn CPU systems, the CPU supplies the addressThis could be the address of a memory location or an I/O device* This is without consideration of paging and memory management (MM) techniques
10 Data Bus The data bus is used to transfer data between Memory and CPUI/O devices and CPUI/O devices and MemoryThe transfer can be either way, so the data bus is a bi-directional busData bus size is normally a multiple of 8 bits (byte) and is usually the same size or less than the size of the CPU’s internal registers.For example, an 8 bit processor has internal registers of size 8 bits and would have an 8 bit data busClearly a bigger data bus means that more data can transferred, but this is at the cost of more pins and wider memoriesHigh end systems usually have wide data buses that reduce the bottleneck between CPU and memory
11 Data Bus Data bus contains data on its wires! This could be actually representInstructionsData ValuesIntegers, Characters, Floating point values, etc…AddressesAn instruction may contain an addressE.g. JUMP 459
12 Control BusThese signals are used to control the transfer of data between memory, I/O and the CPUThe 2 most basic areRead signal (1 wire)Write signal (1 wire)Both are outputs from the CPUOther control signals includeReset, interrupt and direct memory access
13 Bus cycles Transfer of data occurs between Processor and memoryProcessor and I/OMemory and I/O (DMA)Bus cycles are used to perform these transfersMost common types areMemory readMemory writeI./O readI/O writeBus cycles are concerned with the synchronisation of the data transferCover in lecture
14 Bus cycle example Memory Read bus cycle CPU outputs address CPU activates read signalMemory responds with data on data busCPU reads data and deactivates read signal
15 CPUIntel introduced the first widely used microprocessor in 1971, the 8080A computing system could be built using the microprocessor, memory devices and I/O devices on a printed circuit board
16 CPU CPU has 2 main parts Brains of the system Controls what operations happenPerforms operations on dataCPU understands a finite number of instructionsActual instructions are defined by the instruction set for the CPUExample instructionADD R1,R2,R3CPU has 2 main partsControl unitControls and sequences themicrosteps in the fetch-decode-execute cycle of each instruction.Datapath sectionConsists of the register file (group of registers) and the Arithmetic Logic Unit (ALU)Microprocessor/processor
18 CPU Datapath section is most important section Register file, which is a group of registers, some of which have general purpose use and some may have specific usageArithmetic Logic Unit (ALU), which is logic that performs operations on data, e.g. addition, multiplication, logical OR, etc.The Program Counter (PC) register always stores the address of the next instruction to be fetched from memory.What is a register
19 CPUAn instruction read from memory is stored in the instruction register (IR) registerThe control unit decodes the instruction to determine what the instruction is and what to do to execute the instructionAfter the instruction is executed, the same steps are repeated, I.eFetchDecodeExecuteA series of instructions that are combined to perform a task form a program. As such the CPU operates under the control of a program
20 Example operation of CPU MemoryCPUINC R0DecodeData bus371Fetch371Address bus9897Read SignalWrite SignalExecute
21 Memory Programs and data are stored in memory Types of computer memory includeSemiconductor, considered primaryCommon classification is ROM (non-volatile) and RAM (volatile)Magnetic and optical, considered secondaryCPU communicates directly with semiconductor memory.
22 Main MemoryRAMRandom Access Memory that can be read from and written to. Contents are volatile, so contents are lost when power removedThis type of memory is fast. Memories for computers are rated by their capacity in bytes.ROMRead Only Memory can only be read from. Contents are non-volatile, so contents are NOT lost when power is removedAlso fast access
24 MicrocontrollerA device similar to the microprocessor is a microcontrollerEarly example is the Intel 8748 microcontrollerThe key difference is the integration of memory and basic I/O functions on a single chip and low costThe 8051 introduced in 1980Original 8051 had an 8-bit CPU, 4K program memory, 128 bytes of RAM and I/O functions (ports, timers and serial transmission support) all on a single chip!
25 Examples of microcontroller uses Antilock brakes Engine control unitToys, consumer products(white goods, entertainment)
27 Micrcontroller Many other companies that produce other microcontollers Microchip, Motorola, Atmel, Philips, Hitachi, etc …Differ in internal architecture, instruction set, speed, size of on-chip memories, package sizes, I/O support, power consumption, register size, costCompanies other than Intel make 8051 devicesPhilips, Atmel, Analog Devices, Cygnal, etc…Despite being over 25 years old, the 8051 microcontroller is still widely used! This is due to it’s proven track record and a wide knowledge baseUnlike personal computing where increased throughput is constantly required, there are still many embedded (not all) that require a low cost and simple microcontrollerCover in lecture
28 Microcontroller vs Microprocessor Microprocessor is a single chip CPU and requires many additional devices to form working systemMicrocontroller is a single chip with CPU, memory (small amount) and I/OMedium to high cost for systemLow cost for systemApplication is in microcomputer systems, with operation system and application software. Software and hardware can be easily upgradedApplication is in embedded system with fixed programs and low component count (also fixed). Typically control oriented applicationInstruction set and internal architecture focused for processing intensive operations and can support many addressing modes (CISC machines) and support of operating systems (OS).Instruction set and internal architecture focused on control of I/O and efficient use of on-chip resources. This can include bit instructions.Small amount of ROM relative to amount of RAM and secondary memory. E.g. 128K ROM, 512M RAM and 80 G HarddiskLarge amount of ROM relativeto small amount of RAM and usually no secondary memory. E.g. 32K ROM, 4K RAM
32 General Purpose Computing System General-purpose defined as user-programmableUsually not time-critical in nature.Uses a general purpose microprocessor
33 Magnetic Disks Types Hard disks Floppy disks Zip disks Provide long term storage (non-volatile).A hard disk cannot normally be removed and is fixed internally in the computer.A floppy disk and zip disk can be removed or inserted as needed.Disks store data using magnetic media.Accessing data on these disks is much slower than RAM.Also known as secondary storage
34 Other types of Storage Optical Disks Flash Memory Drives CD-ROM and DVDFlash Memory DrivesUses Flash Semiconductor TechnologyMemory sticks
36 Exercises What are the basic components of a computing system? With respect to a computing system, what is a bus?Describe the 3 buses that are used in a computing system.Using Figure 1., detail the steps that are involved in a memory write bus cycleFigure 1.
37 Exercises What is CPU an acronym for? What are the main sections of a CPU?What is the purpose of the PC register?What is the purpose of the IR register?Fill in the missing word. The CPU operates by repeatedly performing ________, decode and execute operations.What is a non-volatile memory?
38 Exercises What is an ALU? List 5 examples of embedded systems In the homeIn UniversityIn a carWhat are the differences between a microcontroller and a microprocessor?How many components (approximately) are needed for a simple working microcontroller system