Design and Development of Microcontroller based Auto-Start ...
Microcontroller based system design
description
Transcript of Microcontroller based system design
![Page 1: Microcontroller based system design](https://reader036.fdocuments.net/reader036/viewer/2022062302/56816387550346895dd4736a/html5/thumbnails/1.jpg)
Microcontroller based system design
Asst. Prof. Dr. Alper ŞİŞMAN
![Page 2: Microcontroller based system design](https://reader036.fdocuments.net/reader036/viewer/2022062302/56816387550346895dd4736a/html5/thumbnails/2.jpg)
Course Objectives
• to develop an in-depth understanding of – the operation of microprocessors and microcontrollers– C language platform for embedded systems– microcontroller interfacing techniques– The path an embedded system, design&implementation of
embedded systems in both hardware and software
• to be able to use ST32F4 series high performance 32-bit ARM (Advanced RISC Machine) based microcontrollers.
![Page 3: Microcontroller based system design](https://reader036.fdocuments.net/reader036/viewer/2022062302/56816387550346895dd4736a/html5/thumbnails/3.jpg)
Outline
• Microcontroller basics and programming concepts,basic architecture.
• <Exercise: The compiler and its capabilities, simulation, debugging examples>
• Programming Model, Addressing Modes and Instruction Set
• <Exercise: LED on/off>• Interfacing concepts, IO module• <Exercise: push button,7-segment, keypad connection
and alphanumeric display examples>
![Page 4: Microcontroller based system design](https://reader036.fdocuments.net/reader036/viewer/2022062302/56816387550346895dd4736a/html5/thumbnails/4.jpg)
• Timer and ADC modules• <Exercise: Data acquisition and control examples>• The Stack, Subroutines and Interrupts• <Exercise: Use of external and timer interrupts>• Serial communications, Universal async.
Receive/transmit (UART)• <Exercise: An UART application>• Serial communication , I2C and SPI• <Exercise: An I2C application>
![Page 5: Microcontroller based system design](https://reader036.fdocuments.net/reader036/viewer/2022062302/56816387550346895dd4736a/html5/thumbnails/5.jpg)
Common computer organization (simplified view)
• ALU (Arithmetic Logic Unit) is a circuitry, which is capable of doing various operations (for example ADD, SHIFT, AND, OR, etc) on certain on-chip registers.
• CPU (Central Processing Unit) is the combination of the control logic, associated registers and the arithmetic logic unit.
![Page 6: Microcontroller based system design](https://reader036.fdocuments.net/reader036/viewer/2022062302/56816387550346895dd4736a/html5/thumbnails/6.jpg)
Block diagram of a typical CPU
![Page 7: Microcontroller based system design](https://reader036.fdocuments.net/reader036/viewer/2022062302/56816387550346895dd4736a/html5/thumbnails/7.jpg)
CPU structure
• The main functions are– data transfer– arithmetic and logic operations– decision making (instructional flow control)
• The register array consists of at least one accumulator, program counter and stack pointer
• The control unit controls all the operations in a CPU and basically it puts the CPU in one of the fetch and execution phases
![Page 8: Microcontroller based system design](https://reader036.fdocuments.net/reader036/viewer/2022062302/56816387550346895dd4736a/html5/thumbnails/8.jpg)
MemoryInput/Output
(I/O)
ALU
Control
CPU
![Page 9: Microcontroller based system design](https://reader036.fdocuments.net/reader036/viewer/2022062302/56816387550346895dd4736a/html5/thumbnails/9.jpg)
Computer Buses
• Address bus: carries the address of a unique memory or input/output (I/O) device
• Data bus: carries data stored in memory (or an I/O device) to the CPU or from the CPU to the memory (or I/O device)
• Control bus: is a collection of control signals that coordinate and synchronize the whole system
![Page 10: Microcontroller based system design](https://reader036.fdocuments.net/reader036/viewer/2022062302/56816387550346895dd4736a/html5/thumbnails/10.jpg)
Buses and common comp. arch.
![Page 11: Microcontroller based system design](https://reader036.fdocuments.net/reader036/viewer/2022062302/56816387550346895dd4736a/html5/thumbnails/11.jpg)
Memory
• The memory in a computer system stores the data and instructions of the programs.
Adress decoder Storage
Area
Adress bus
Data bus
Other signals (Vcc,Gnd, CS, etc.)
![Page 12: Microcontroller based system design](https://reader036.fdocuments.net/reader036/viewer/2022062302/56816387550346895dd4736a/html5/thumbnails/12.jpg)
Main memory types
• ROM (read-only memory) – programmed permanently at the factory, cannot be
altered• RAM (random-access memory) – read and write memory
• EPROM (erasable programmable ROM) – nonvolatile, written electrically but erased optically
• EEPROM (electrically ROM) – nonvolatile, both written and erased electrically
![Page 13: Microcontroller based system design](https://reader036.fdocuments.net/reader036/viewer/2022062302/56816387550346895dd4736a/html5/thumbnails/13.jpg)
Memory
![Page 14: Microcontroller based system design](https://reader036.fdocuments.net/reader036/viewer/2022062302/56816387550346895dd4736a/html5/thumbnails/14.jpg)
Operation of CPU
• Fetch cycle (phase): – The CPU puts the address of the instruction to be
executed on the address bus. The address info comes from the program counter (PC) maintained by the control unit.
– The control bus holds the info. for reading the memory location and the data bus holds the instruction from the memory which is stored into the instruction register (IR)
– PC is updated to point to the next instruction.
![Page 15: Microcontroller based system design](https://reader036.fdocuments.net/reader036/viewer/2022062302/56816387550346895dd4736a/html5/thumbnails/15.jpg)
• Execute cycle (phase): – Instruction in the IR is decoded – The required data transfer and the required logical and
arithmetic operation are performed– The result is written back either to one of the registers or
memory or I/O device• Common operations performed in ALU are:– addition, subtraction, – logical AND, OR, XOR, NOT– increment, decrement, shift, clear, etc.
![Page 16: Microcontroller based system design](https://reader036.fdocuments.net/reader036/viewer/2022062302/56816387550346895dd4736a/html5/thumbnails/16.jpg)
![Page 17: Microcontroller based system design](https://reader036.fdocuments.net/reader036/viewer/2022062302/56816387550346895dd4736a/html5/thumbnails/17.jpg)
Detailed operation
![Page 18: Microcontroller based system design](https://reader036.fdocuments.net/reader036/viewer/2022062302/56816387550346895dd4736a/html5/thumbnails/18.jpg)
Microcomputer/Microcontroller• CPU on a single ICmicroprocessor (µP).• the terms CPU, µP and MPU (microprocessor unit)
are synonymous.• CPU is the combination of the ALU and control unit
of any computer.• When the CPU is a single IC; it is called a µP and is
also referred to as the MPU.• When the MPU‘s connected to memory and I/O, the
arrangement becomes a MICROCOMPUTER.• What is microcontroller?: A microcontroller unit
(MCU) contains an MPU, memory, and I/O circuitry on a single chip.
![Page 19: Microcontroller based system design](https://reader036.fdocuments.net/reader036/viewer/2022062302/56816387550346895dd4736a/html5/thumbnails/19.jpg)
Microprocessor vs microcontroller • Microprocessors: high performance, generalpurpose “brains” for PCs and workstations– Instruction decode and control, arithmetic/logic operations,
registers, timing, external control– Typical cost: $75 -- $500– Annual demand: 10s of millions
• Microcontrollers: devices with high levels of integration for embedded control– Microprocessor functions plus on-chip memory and
peripheral functions (e.g. ports, timers)– "Swiss army knife" of microprocessor technology– Typical cost: $1-- $25– Annual demand: billions!
![Page 20: Microcontroller based system design](https://reader036.fdocuments.net/reader036/viewer/2022062302/56816387550346895dd4736a/html5/thumbnails/20.jpg)
Bottom-Up wiev of microcontroller systems
![Page 21: Microcontroller based system design](https://reader036.fdocuments.net/reader036/viewer/2022062302/56816387550346895dd4736a/html5/thumbnails/21.jpg)
Embedded System• The majority of microcontrollers in use today are
embedded in other machinery, such as automobiles, telephones, appliances, and peripherals for computer systems. These are called embedded system.
• Typical input and output devices include switches, relay, solenoids, LEDs, small or custom LCD displays, radio frequency devices, and sensors for data such as temperature, humidity, light level etc.
• Embedded systems usually have no keyboard, screen, disks, printers, or other recognizable I/O devices of a personal computer, and may lack human interaction devices of any kind.
![Page 22: Microcontroller based system design](https://reader036.fdocuments.net/reader036/viewer/2022062302/56816387550346895dd4736a/html5/thumbnails/22.jpg)
ARM based MCUs