Lecture 2 Introduction To Microcontrollers

2y ago
48 Views
8 Downloads
1.53 MB
29 Pages
Last View : 1m ago
Last Download : 3m ago
Upload by : Warren Adams
Transcription

Lecture 2Introduction to Microcontrollers1

Microcontrollers Microcontroller CPU Microprocessor CPU (on single chip)2

What is a Microcontroller Integrated chip that typically contains integrated CPU, memory (RAMROM), I/O ports on a single Chip. System on a single Chip/ small computer on a single chip Designed to execute a specific task to control a single system Smaller & Specified (design cost) Differs from Microprocessorgeneral-purpose chipUsed to design multi purpose computers or devicesRequire Multiple chips to handle various tasks Typically Microcontroller embedded inside some device Microcontrollers are important part of Embedded systems3

What is a Development Board A printed circuit boarddesigned to facilitatework with a particularmicrocontroller. Typical components include: power circuitprogramming interfacebasic input; usually buttons and LEDsI/O pins4

The Arduino Development BoardArduino (The name is an Italian , meaning “strong friend”) is an opensource platform used for building electronics projects. Arduino consists of both aphysical programmable circuit board (often referred to as a microcontroller) and apiece of software, or IDE (Integrated Development Environment) that runs on yourcomputer, used to write and upload computer code to the physical board.5

Arduino Microcontroller Boards6MicrocontrollerOperating VoltageInput Voltage(recommended)Input Voltage (limits)Digital I/O PinsAnalog Input PinsDC Current per I/O PinDC Current for 3.3V PinFlash MemorySRAMEEPROMClock SpeedATmega3285V7-12 V6-20 V14 (of which 6 provide PWM output)640 mA50 mA32 KB (ATmega328) of which 2 KB used bybootloader2 KB (ATmega328)1 KB (ATmega328)16 MHz

ATmega328 Internal Architecture7

ATmega328 MicrocontrollerPin numberPin nameSpecialfunction8

Microcontroller Ports and Pins The communication channelsthrough which informationflows into or out of themicrocontroller CEx. PORTB Pins PB0 – PB7 May not be contiguous Often bi-directional9

ATmega328Block DiagramInputOutput10

Setting the Pin Data Direction Arduino pinMode(pin no., dir) Ex. Make Arduino pin 3 (PD3) an output pinMode(3, OUTPUT);Note: one pin at a timeSuppose you wanted Arduino pins 3, 5, and 7(PD3, PD5, and PD7) to be outputs? Is there a way to make them all outputs at thesame time? Yes! Answer coming later 11

Atmega328 OverviewInternalmemories 32KB Flash 1KB EEPROM 2KB SRAM8-bit CPUTimer/CounterSerial PeripheralInterfaceUniversal Synchronousand Asynchronousserial Receiver andTransmitter (Serial)GPIO2-wire SerialInterface12

AVR MicrocontrollerAVR stand for? Advanced Virtual RISC,the founders are Alf Egil Bogen Vegard Wollan RISC AVR architecture was conceived by two students atNorwegian Institute of Technology (NTH) and further refinedand developed at Atmel Norway (Atmel AVR).13

AVR Microcontroller AVR Micro controllers is Family of RISCMicrocontrollers from Atmel. There are multiple architecturesRISC (Reduced Instruction Set Computer)CISC (Complex Instruction Set Computer)14

RISC MicrocontrollerReduced Instruction Set Computers Advantages Fast Execution of Instructions due to simple instructions forCPU. RISC chips require fewer transistors, which makes themcheaper to design and produce. Emphasis on software Single-clock , reduced instruction only Register to register: “LOAD" and "STORE“ are independentinstructions Spends more transistors on memory registers15

On ChipDebuggerTwo WireInterface16

AVR MicrocontrollerThe AVR is a Harvard architecture CPU. Harvard Architecture Computer architectures that used physically separate storageand signal pathways for their instructions and data. CPU can read both an instruction and data fromat the same time that makes it faster.memory von Neumann architecture CPU can Read an instruction or data from/to the memory. Read, Write can t occur at the same time due to samememory and signal pathway for data and instructions.17

AVR MicrocontrollerHarvard ArchitectureHarvard Architecture diagram18

AVR Microcontroller AVR is a family of 8-bit microntrollers with a large range of variantsdiffering in:- size of program-memory (flash)- size of EEPROM memory- number of I/O pins- number of on-chip features such as UART and ADC Smallest microcontroller is the ATTiny11 with 1k flash ROM, no RAMand 6 I/O pins. Large such as the ATMEGA128 with 128k flash, 4KB RAM, 53 I/O pinsand lots of on-chip features.19

AVR Microcontroller20

AVR Architecture RegistersInstruction SetI/O portsMemory (flash & RAM & ROM)CPU21

AVR Architecture Registers: Two types of registersGERNEL purpose & SPECIAL purpose registers GERNEL purpose32 general purpose registers having storage capacity of8-BitsNamed as R0,R1,R2 to R31.Register 0 to 15 & 16 to 31 are different.Can store both Data & Addresses. SPECIAL purpose: Three registersProgram counterStack PointerStatus Register22

AVR Memory Space Program Flash– Vectors, Code, and(Unchangeable) Constant Data Working Registers– Includes X, Y, and Z registers. I/O Register Space– Includes “named” registers SRAM – Data Space– Runtime Variables and Data– Stack space EEPROM space– For non-volatile but alterable data23

AVR ArchitecturePointer RegisterThree 16-bit address registers pairs of registers 26 to 31have extra meaning in AVR assembly.X (r27:r26), y (r29:r28), z (r31:r30).pointerSequenceXRead/Write from address X,don't change the pointer24

AVR Architecturestatus register(SREG) It is 8-bit long each bit has a different meaning.ITHSVNZCI: Global Interrupt Enable/Disable Flag, SREG7T: Transfer bit used by BLD and BST instructions, SREG6H: Half Carry Flag, SREG5S: For signed tests Instruction Set, SREG4V: Two's complement overflow indicator, SREG3N: Negative Flag, SREG2Z: Zero Flag, SREG1C: Carry Flag, SREG025

AVR ArchitectureStack Pointer (SP)16-bit stack pointer (SP) holds address in data space of areato save function call information.26

AVRRegister Architecture27

AVR ArchitectureMemory:There are two separatememoriesProgram MemoryData Memory28

AVR Studio Integrated Development Environment (IDE) forwriting and debugging AVR applications forwindows environments. AVR Studio provides a project management tool,source file editor, chip simulator and In-circuitemulator interface for the powerful AVR 8-bitRISC family of microcontrollers.29

AVR Microcontroller 17. Harvard Architecture AVR Microcontroller Harvard Architecture diagram 18. AVR Microcontroller AVR is a family of 8-bit microntrollers with a large range of variants differing in: - size of program-me

Related Documents:

Introduction of Chemical Reaction Engineering Introduction about Chemical Engineering 0:31:15 0:31:09. Lecture 14 Lecture 15 Lecture 16 Lecture 17 Lecture 18 Lecture 19 Lecture 20 Lecture 21 Lecture 22 Lecture 23 Lecture 24 Lecture 25 Lecture 26 Lecture 27 Lecture 28 Lecture

Lecture 1: A Beginner's Guide Lecture 2: Introduction to Programming Lecture 3: Introduction to C, structure of C programming Lecture 4: Elements of C Lecture 5: Variables, Statements, Expressions Lecture 6: Input-Output in C Lecture 7: Formatted Input-Output Lecture 8: Operators Lecture 9: Operators continued

pher on 8-bit AVR microcontrollers, 32-bit RISC-V processors, and 64-bit ARM processors. The optimal performance is achieved through e cient register allo-cation and instruction techniques. 3.1 8-bit Low-end AVR Microcontrollers Instruction set. AVR microcontrollers have useful instruction sets. Generally instructions take 1 or 2 clock cycles.

Lecture 1: Introduction and Orientation. Lecture 2: Overview of Electronic Materials . Lecture 3: Free electron Fermi gas . Lecture 4: Energy bands . Lecture 5: Carrier Concentration in Semiconductors . Lecture 6: Shallow dopants and Deep -level traps . Lecture 7: Silicon Materials . Lecture 8: Oxidation. Lecture

TOEFL Listening Lecture 35 184 TOEFL Listening Lecture 36 189 TOEFL Listening Lecture 37 194 TOEFL Listening Lecture 38 199 TOEFL Listening Lecture 39 204 TOEFL Listening Lecture 40 209 TOEFL Listening Lecture 41 214 TOEFL Listening Lecture 42 219 TOEFL Listening Lecture 43 225 COPYRIGHT 2016

Partial Di erential Equations MSO-203-B T. Muthukumar tmk@iitk.ac.in November 14, 2019 T. Muthukumar tmk@iitk.ac.in Partial Di erential EquationsMSO-203-B November 14, 2019 1/193 1 First Week Lecture One Lecture Two Lecture Three Lecture Four 2 Second Week Lecture Five Lecture Six 3 Third Week Lecture Seven Lecture Eight 4 Fourth Week Lecture .

Introduction to Quantum Field Theory for Mathematicians Lecture notes for Math 273, Stanford, Fall 2018 Sourav Chatterjee (Based on a forthcoming textbook by Michel Talagrand) Contents Lecture 1. Introduction 1 Lecture 2. The postulates of quantum mechanics 5 Lecture 3. Position and momentum operators 9 Lecture 4. Time evolution 13 Lecture 5. Many particle states 19 Lecture 6. Bosonic Fock .

PIC Microcontrollers Overview: o Using microcontrollers (MCUs): You will need to know how to connect the microcontroller to the hardware. You will need to know how to write and program code into the microcontroller. o Levels of Programming Languages: MCUs are programmed